AttributeValue avPath = new AttributeValue(normalize(path.getParent()));
AttributeValue avFile = new AttributeValue(path.getName());
AttributeValue avEpoch = new AttributeValue().withN(epoch+"");
PutItemRequest put = new PutItemRequest();
put.setTableName(tableName);
Map<String, AttributeValue> items = new HashMap<String, AttributeValue>();
items.put(HASH_KEY, avPath);
items.put(RANGE_KEY, avFile);
items.put(EPOCH_VALUE, avEpoch);
if(directory) {
items.put(DIRECTORY_VALUE, new AttributeValue(Boolean.TRUE.toString()));
}
put.setItem(items);
if(log.isDebugEnabled()) {
log.debug("Adding metastore entry for: " + path.toUri());
}
db.putItem(put);
PutItemRequest tsPut = new PutItemRequest();
tsPut.setTableName(tableName);
Map<String, AttributeValue> tsItems = new HashMap<String, AttributeValue>();
tsItems.put(HASH_KEY, new AttributeValue(TIMESERIES_KEY));
tsItems.put(RANGE_KEY, new AttributeValue(epoch+"-"+rand.nextInt()));
tsItems.put(LINK_HASH_KEY, avPath);
tsItems.put(LINK_RANGE_KEY, avFile);
tsPut.setItem(tsItems);
db.putItem(tsPut);
return null;
}