in src/main/java/com/amazonaws/services/dynamodbv2/AmazonDynamoDBLockClient.java [1000:1030]
private LockItem createLockItem(final GetLockOptions options, final Map<String, AttributeValue> immutableItem) {
Map<String, AttributeValue> item = new HashMap<>(immutableItem);
final Optional<ByteBuffer> data = Optional.ofNullable(item.get(DATA)).map(dataAttributionValue -> {
item.remove(DATA);
return dataAttributionValue.b().asByteBuffer();
});
final AttributeValue ownerName = item.remove(OWNER_NAME);
final AttributeValue leaseDuration = item.remove(LEASE_DURATION);
final AttributeValue recordVersionNumber = item.remove(RECORD_VERSION_NUMBER);
final boolean isReleased = item.containsKey(IS_RELEASED);
item.remove(IS_RELEASED);
item.remove(this.partitionKeyName);
/*
* The person retrieving the lock in DynamoDB should err on the side of
* not expiring the lock, so they don't start counting until after the
* call to DynamoDB succeeds
*/
final long lookupTime = LockClientUtils.INSTANCE.millisecondTime();
final LockItem lockItem =
new LockItem(this,
options.getPartitionKey(),
options.getSortKey(), data,
options.isDeleteLockOnRelease(),
ownerName.s(),
Long.parseLong(leaseDuration.s()), lookupTime,
recordVersionNumber.s(), isReleased, Optional.empty(), item);
return lockItem;
}