List of usage examples for com.amazonaws.services.dynamodbv2.document TableWriteItems withItemsToPut
public TableWriteItems withItemsToPut(Collection<Item> itemsToPut)
From source file:com.telefonica.iot.cygnus.backends.dynamo.DynamoDBBackendImpl.java
License:Open Source License
@Override public void putItems(String tableName, ArrayList<Item> aggregation) throws Exception { try {/*w ww . j a v a 2 s . c o m*/ TableWriteItems tableWriteItems = new TableWriteItems(tableName); tableWriteItems.withItemsToPut(aggregation); BatchWriteItemOutcome outcome = dynamoDB.batchWriteItem(tableWriteItems); } catch (Exception e) { LOGGER.error("Error while putting a batch of items in the table " + tableName + ". Details=" + e.getMessage()); } // try catch }
From source file:org.chodavarapu.jgitaws.repositories.PackDescriptionRepository.java
License:Eclipse Distribution License
private TableWriteItems createBatchRequest(List<PackDescriptionOperation> operations) { List<Item> itemsToPut = createItemsToPutList(operations); List<PrimaryKey> keysToDelete = createKeysToDeleteList(operations); TableWriteItems request = new TableWriteItems(configuration.getPackDescriptionsTableName()); if (itemsToPut.size() > 0) { request.withItemsToPut(itemsToPut); }// w w w .j av a 2 s . c om if (keysToDelete.size() > 0) { request.withPrimaryKeysToDelete(keysToDelete.toArray(new PrimaryKey[keysToDelete.size()])); } return request; }