test_class.declarator: dynamoDB = PowerMock.createMock(AmazonDynamoDB.class)
test_class.modifier: @Mock
      public
test_class.original_string: @Mock
      public AmazonDynamoDB dynamoDB = PowerMock.createMock(AmazonDynamoDB.class);
test_class.type: AmazonDynamoDB
test_class.var_name: dynamoDB
test_class.declarator: tableName = "table"
test_class.modifier: static final
test_class.original_string: static final String tableName = "table";
test_class.type: String
test_class.var_name: tableName
test_class.file: ingester/src/test/java/com/amazonaws/services/dynamodbv2/json/demo/mars/util/DynamoDBManagerTest.java
test_class.identifier: DynamoDBManagerTest
test_case.body: @Test
      public void testWaitForTableToBecomeActiveCreatingThenActive() {
          // Creating table
          final TableDescription table1 = new TableDescription();
          table1.setTableStatus(TableStatus.CREATING);
          final DescribeTableResult result1 = new DescribeTableResult().withTable(table1);
          // Active table
          final TableDescription table2 = new TableDescription();
          table2.setTableStatus(TableStatus.ACTIVE);
          final DescribeTableResult result2 = new DescribeTableResult().withTable(table2);
          EasyMock.expect(dynamoDB.describeTable(tableName)).andReturn(result1);
          EasyMock.expect(dynamoDB.describeTable(tableName)).andReturn(result2);
          PowerMock.replayAll();
          DynamoDBManager.waitForTableToBecomeActive(dynamoDB, tableName);
      }
test_case.class_method_signature: DynamoDBManagerTest.testWaitForTableToBecomeActiveCreatingThenActive()
test_case.full_signature: @Test public void testWaitForTableToBecomeActiveCreatingThenActive()
test_case.identifier: testWaitForTableToBecomeActiveCreatingThenActive
test_case.invocations: setTableStatus withTable setTableStatus withTable andReturn expect describeTable andReturn expect describeTable replayAll waitForTableToBecomeActive
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWaitForTableToBecomeActiveCreatingThenActive()
focal_class.declarator: LOGGER = Logger.getLogger(DynamoDBManager.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Logger.getLogger(DynamoDBManager.class.getName());
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: RETRY_DELAY = 20 * 1000
focal_class.modifier: private static final
focal_class.original_string: private static final long RETRY_DELAY = 20 * 1000;
focal_class.type: long
focal_class.var_name: RETRY_DELAY
focal_class.declarator: RETRY_COUNT = 3
focal_class.modifier: private static final
focal_class.original_string: private static final int RETRY_COUNT = 3;
focal_class.type: int
focal_class.var_name: RETRY_COUNT
focal_class.file: ingester/src/main/java/com/amazonaws/services/dynamodbv2/json/demo/mars/util/DynamoDBManager.java
focal_class.identifier: DynamoDBManager
focal_class.class_method_signature: DynamoDBManager.createTable(final AmazonDynamoDB dynamoDB, final CreateTableRequest request)
focal_class.full_signature: public static TableDescription createTable(final AmazonDynamoDB dynamoDB, final CreateTableRequest request)
focal_class.identifier: createTable
focal_class.modifiers: public static
focal_class.parameters: (final AmazonDynamoDB dynamoDB, final CreateTableRequest request)
focal_class.return: TableDescription
focal_class.signature: TableDescription createTable(final AmazonDynamoDB dynamoDB, final CreateTableRequest request)
focal_class.class_method_signature: DynamoDBManager.doesTableExist(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.full_signature: public static boolean doesTableExist(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.identifier: doesTableExist
focal_class.modifiers: public static
focal_class.parameters: (final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.return: boolean
focal_class.signature: boolean doesTableExist(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.class_method_signature: DynamoDBManager.getTableStatus(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.full_signature: public static TableStatus getTableStatus(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.identifier: getTableStatus
focal_class.modifiers: public static
focal_class.parameters: (final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.return: TableStatus
focal_class.signature: TableStatus getTableStatus(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.class_method_signature: DynamoDBManager.waitForTableToBecomeActive(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.full_signature: public static void waitForTableToBecomeActive(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.identifier: waitForTableToBecomeActive
focal_class.modifiers: public static
focal_class.parameters: (final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.return: void
focal_class.signature: void waitForTableToBecomeActive(final AmazonDynamoDB dynamoDB, final String tableName)
focal_class.class_method_signature: DynamoDBManager.DynamoDBManager()
focal_class.full_signature: private  DynamoDBManager()
focal_class.identifier: DynamoDBManager
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  DynamoDBManager()
focal_method.body: public static void waitForTableToBecomeActive(final AmazonDynamoDB dynamoDB, final String tableName) {
          int numTries = 0;
          TableStatus currentState;
          try {
              currentState = getTableStatus(dynamoDB, tableName);
          } catch (final ResourceNotFoundException e) {
              throw new IllegalStateException("Table " + tableName + " does not exist");
          }
          while (numTries < RETRY_COUNT) {
              try {
                  Thread.sleep(RETRY_DELAY);
              } catch (final InterruptedException e) {
                  LOGGER.severe(e.getMessage());
              }
              currentState = getTableStatus(dynamoDB, tableName);
              numTries++;
              LOGGER.info("Table " + tableName + " is in " + currentState + " state");
              switch (currentState) {
                  case ACTIVE:
                      return;
                  case DELETING:
                      throw new IllegalStateException("Table " + tableName
                          + " has DELETING status and will never become active");
                  case UPDATING:
                      break;
                  case CREATING:
                      break;
                  default:
                      throw new IllegalStateException("Unknown table status: " + currentState);
              }
          }
  
          final DescribeTableResult result = dynamoDB.describeTable(tableName);
          throw new IllegalStateException("Table " + tableName + " never went ACTIVE" + result);
      }
focal_method.class_method_signature: DynamoDBManager.waitForTableToBecomeActive(final AmazonDynamoDB dynamoDB, final String tableName)
focal_method.full_signature: public static void waitForTableToBecomeActive(final AmazonDynamoDB dynamoDB, final String tableName)
focal_method.identifier: waitForTableToBecomeActive
focal_method.invocations: getTableStatus sleep severe getMessage getTableStatus info describeTable
focal_method.modifiers: public static
focal_method.parameters: (final AmazonDynamoDB dynamoDB, final String tableName)
focal_method.return: void
focal_method.signature: void waitForTableToBecomeActive(final AmazonDynamoDB dynamoDB, final String tableName)