Search in sources :

Example 1 with CreateTableEnhancedRequest

use of software.amazon.awssdk.enhanced.dynamodb.model.CreateTableEnhancedRequest in project serve by pytorch.

the class DDBSnapshotSerializerTest method createTable.

private void createTable() {
    ProvisionedThroughput provThroughput = ProvisionedThroughput.builder().readCapacityUnits(10L).writeCapacityUnits(5L).build();
    Projection projectAll = Projection.builder().projectionType(ProjectionType.ALL).build();
    EnhancedGlobalSecondaryIndex gsi = EnhancedGlobalSecondaryIndex.builder().indexName("createdOnMonth-index").projection(projectAll).provisionedThroughput(provThroughput).build();
    CreateTableEnhancedRequest createTableReq = CreateTableEnhancedRequest.builder().globalSecondaryIndices(Arrays.asList(gsi)).build();
    snapshotTable.createTable(createTableReq);
}
Also used : Projection(software.amazon.awssdk.services.dynamodb.model.Projection) ProvisionedThroughput(software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughput) EnhancedGlobalSecondaryIndex(software.amazon.awssdk.enhanced.dynamodb.model.EnhancedGlobalSecondaryIndex) CreateTableEnhancedRequest(software.amazon.awssdk.enhanced.dynamodb.model.CreateTableEnhancedRequest)

Aggregations

CreateTableEnhancedRequest (software.amazon.awssdk.enhanced.dynamodb.model.CreateTableEnhancedRequest)1 EnhancedGlobalSecondaryIndex (software.amazon.awssdk.enhanced.dynamodb.model.EnhancedGlobalSecondaryIndex)1 Projection (software.amazon.awssdk.services.dynamodb.model.Projection)1 ProvisionedThroughput (software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughput)1