in src/main/java/com/amazonaws/kda/flink/benchmarking/util/DDBUtil.java [53:74]
public static boolean insertParentJobStatus(DynamoDB dynamoDBClient, String dynamoDBTblName, String jobName, String jobId,
int numInteractionsProcessed, String jobStartTime, String jobStatus) {
boolean itemInserted = false;
Table table = dynamoDBClient.getTable(dynamoDBTblName);
Item item = new Item().withPrimaryKey("job_name", jobName)
.withString("job_id", jobId)
.withString("job_status", jobStatus)
.withNumber("number_of_interactions_processed", numInteractionsProcessed)
.withString("job_starttime", jobStartTime);
try {
PutItemOutcome outcome = table.putItem(item);
int statusCode = outcome.getPutItemResult().getSdkHttpMetadata().getHttpStatusCode();
if (statusCode == 200) {
itemInserted = true;
}
} catch (Exception e) {
e.printStackTrace();
System.out.println("Item could not be inserted to DynamoDB table.");
}
return itemInserted;
}