CreateTableRequest createTableRequest = new CreateTableRequest()
.withTableName(config.getTableName())
.withProvisionedThroughput(
new ProvisionedThroughput().withReadCapacityUnits(10L).withWriteCapacityUnits(5L))
.withKeySchema(
new KeySchemaElement().withKeyType(KeyType.HASH).withAttributeName(
config.getHashKeyAttributeName()),
new KeySchemaElement().withKeyType(KeyType.RANGE).withAttributeName(
config.getRangeKeyAttributeName()))
.withAttributeDefinitions(
new AttributeDefinition().withAttributeType(ScalarAttributeType.N).withAttributeName(
config.getHashKeyAttributeName()),
new AttributeDefinition().withAttributeType(ScalarAttributeType.S).withAttributeName(
config.getRangeKeyAttributeName()),
new AttributeDefinition().withAttributeType(ScalarAttributeType.N).withAttributeName(
config.getGeohashAttributeName()))
.withLocalSecondaryIndexes(
new LocalSecondaryIndex()
.withIndexName(config.getGeohashIndexName())
.withKeySchema(
new KeySchemaElement().withKeyType(KeyType.HASH).withAttributeName(
config.getHashKeyAttributeName()),
new KeySchemaElement().withKeyType(KeyType.RANGE).withAttributeName(
config.getGeohashAttributeName()))
.withProjection(new Projection().withProjectionType(ProjectionType.ALL)));
return createTableRequest;
}