@Override public Map<String, List<Object>> batchLoad(Iterable<? extends Object> itemsToGet, DynamoDBMapperConfig config) { config = mergeConfig(config); boolean consistentReads = (config.getConsistentReads() == ConsistentReads.CONSISTENT);
/** * Creates a new builder, optionally initialized with the defaults. */ private Builder(final boolean defaults) { if (defaults == true) { saveBehavior = DEFAULT.getSaveBehavior(); consistentReads = DEFAULT.getConsistentReads(); paginationLoadingStrategy = DEFAULT.getPaginationLoadingStrategy(); conversionSchema = DEFAULT.getConversionSchema(); batchWriteRetryStrategy = DEFAULT.getBatchWriteRetryStrategy(); batchLoadRetryStrategy = DEFAULT.getBatchLoadRetryStrategy(); } }
@Override public <T extends Object> T load(T keyObject, DynamoDBMapperConfig config) { @SuppressWarnings("unchecked") Class<T> clazz = (Class<T>) keyObject.getClass(); config = mergeConfig(config); final DynamoDBMapperTableModel<T> model = getTableModel(clazz, config); String tableName = getTableName(clazz, keyObject, config); GetItemRequest rq = new GetItemRequest() .withRequestMetricCollector(config.getRequestMetricCollector()); Map<String, AttributeValue> key = model.convertKey(keyObject); rq.setKey(key); rq.setTableName(tableName); rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT); GetItemResult item = db.getItem(applyUserAgent(rq)); Map<String, AttributeValue> itemAttributes = item.getItem(); if ( itemAttributes == null ) { return null; } T object = privateMarshallIntoObject( toParameters(itemAttributes, clazz, tableName, config)); return object; }
@Override public Map<String, List<Object>> batchLoad(Iterable<? extends Object> itemsToGet, DynamoDBMapperConfig config) { config = mergeConfig(config); boolean consistentReads = (config.getConsistentReads() == ConsistentReads.CONSISTENT);
/** * Creates a new builder, optionally initialized with the defaults. */ private Builder(final boolean defaults) { if (defaults == true) { saveBehavior = DEFAULT.getSaveBehavior(); consistentReads = DEFAULT.getConsistentReads(); paginationLoadingStrategy = DEFAULT.getPaginationLoadingStrategy(); conversionSchema = DEFAULT.getConversionSchema(); batchWriteRetryStrategy = DEFAULT.getBatchWriteRetryStrategy(); batchLoadRetryStrategy = DEFAULT.getBatchLoadRetryStrategy(); } }
@Override public <T extends Object> T load(T keyObject, DynamoDBMapperConfig config) { @SuppressWarnings("unchecked") Class<T> clazz = (Class<T>) keyObject.getClass(); config = mergeConfig(config); final DynamoDBMapperTableModel<T> model = getTableModel(clazz, config); String tableName = getTableName(clazz, keyObject, config); GetItemRequest rq = new GetItemRequest() .withRequestMetricCollector(config.getRequestMetricCollector()); Map<String, AttributeValue> key = model.convertKey(keyObject); rq.setKey(key); rq.setTableName(tableName); rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT); GetItemResult item = db.getItem(applyUserAgent(rq)); Map<String, AttributeValue> itemAttributes = item.getItem(); if ( itemAttributes == null ) { return null; } T object = privateMarshallIntoObject( toParameters(itemAttributes, clazz, tableName, config)); return object; }