Book Image

DynamoDB Applied Design Patterns

By : Uchit Hamendra Vyas
Book Image

DynamoDB Applied Design Patterns

By: Uchit Hamendra Vyas

Overview of this book

Table of Contents (17 chapters)
DynamoDB Applied Design Patterns
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Java SDK operations


There are eight user-defined private functions that are being invoked in the following code. We will see each and every function in detail:

public class AwsSdkDemo {

  static AmazonDynamoDBClient client;
  public static void main(String[] args) {
    try {

      initializeCredentials();
      String tableName = "Tbl_Book";

      if (Tables.doesTableExist(client, tableName)) {
        System.out.println("Table " + tableName + " already EXISTS");
      } 
      else {
        ArrayList<AttributeDefinition> attributeDefinitions = getTableAttributes();
        ArrayList<KeySchemaElement> keySchemaElements = getTableKeySchema();
        LocalSecondaryIndex localSecondaryIndex = getLocalSecondaryIndex();
        ArrayList<LocalSecondaryIndex> localSecondaryIndexes = newArrayList<LocalSecondaryIndex>();
        localSecondaryIndexes.add(localSecondaryIndex);
        GlobalSecondaryIndex globalSecondaryIndex = getGlobalSecondaryIndex();
        ProvisionedThroughput...