Package com.amazonaws.services.dynamodb.model

Examples of com.amazonaws.services.dynamodb.model.TableDescription


        super(ddbClient, configuration, exchange);
    }

    @Override
    public void execute() {
        TableDescription tableDescription = ddbClient
                .deleteTable(new DeleteTableRequest(determineTableName())).getTableDescription();

        addToResult(DdbConstants.PROVISIONED_THROUGHPUT, tableDescription.getProvisionedThroughput());
        addToResult(DdbConstants.CREATION_DATE, tableDescription.getCreationDateTime());
        addToResult(DdbConstants.ITEM_COUNT, tableDescription.getItemCount());
        addToResult(DdbConstants.KEY_SCHEMA, tableDescription.getKeySchema());
        addToResult(DdbConstants.TABLE_NAME, tableDescription.getTableName());
        addToResult(DdbConstants.TABLE_SIZE, tableDescription.getTableSizeBytes());
        addToResult(DdbConstants.TABLE_STATUS, tableDescription.getTableStatus());
    }
View Full Code Here


    long endTime = startTime + waitTime;
    while (System.currentTimeMillis() < endTime) {
      try {Thread.sleep(sleepDeleteTime);} catch (Exception e) {}
      try {
        DescribeTableRequest request = new DescribeTableRequest().withTableName(pTableName);
        TableDescription tableDescription = dynamoDBClient.describeTable(request).getTable();
        String tableStatus = tableDescription.getTableStatus();
        LOG.debug(pTableName + " - current state: " + tableStatus);
      } catch (AmazonServiceException ase) {
        if (ase.getErrorCode().equalsIgnoreCase("ResourceNotFoundException") == true)
          return;
        ase.printStackTrace();
View Full Code Here

    long endTime = startTime + waitTime;
    while (System.currentTimeMillis() < endTime) {
      try {Thread.sleep(sleepTime);} catch (Exception e) {}
      try {
        DescribeTableRequest request = new DescribeTableRequest().withTableName(tableName);
        TableDescription tableDescription = dynamoDBClient.describeTable(request).getTable();
        String tableStatus = tableDescription.getTableStatus();
        LOG.debug(tableName + " - current state: " + tableStatus);
        if (tableStatus.equals(TableStatus.ACTIVE.toString())) return;
      } catch (AmazonServiceException ase) {
        if (ase.getErrorCode().equalsIgnoreCase("ResourceNotFoundException") == false) throw ase;
      }
View Full Code Here

   * @throws IOException
   */
  @Override
  public boolean schemaExists() {
    LOG.info("Verifying schemas.");
  TableDescription success = null;
  if (mapping.getTables().isEmpty())  throw new IllegalStateException("There are not tables defined.");
  if (preferredSchema == null){
    LOG.debug("Verifying schemas");
    if (mapping.getTables().isEmpty())  throw new IllegalStateException("There are not tables defined.");
    // read the mapping object
View Full Code Here

   * Retrieves the table description for the specific resource name
   * @param tableName
   * @return
   */
  private TableDescription getTableSchema(String tableName){
    TableDescription tableDescription = null;
    try{
      DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
      tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
    }
    catch(ResourceNotFoundException e){
View Full Code Here

        String tableName = getConfiguration().getTableName();
        LOG.trace("Querying whether table [{}] already exists...", tableName);

        try {
            DescribeTableRequest request = new DescribeTableRequest().withTableName(tableName);
            TableDescription tableDescription = ddbClient.describeTable(request).getTable();
            if (!isTableActive(tableDescription)) {
                waitForTableToBecomeAvailable(tableName);
            }

            LOG.trace("Table [{}] already exists", tableName);
            return;
        } catch (ResourceNotFoundException e) {
            LOG.trace("Table [{}] doesn't exist yet", tableName);
            LOG.trace("Creating table [{}]...", tableName);
            TableDescription tableDescription = createTable(tableName);
            if (!isTableActive(tableDescription)) {
                waitForTableToBecomeAvailable(tableName);
            }

            LOG.trace("Table [{}] created", tableName);
View Full Code Here

                waitTime -= 5000;
            } catch (Exception e) {
            }
            try {
                DescribeTableRequest request = new DescribeTableRequest().withTableName(tableName);
                TableDescription tableDescription = getDdbClient().describeTable(request).getTable();
                if (isTableActive(tableDescription)) {
                    LOG.trace("Table [{}] became active", tableName);
                    return;
                }
                LOG.trace("Table [{}] not active yet", tableName);
View Full Code Here

   * Checks if a resource exists or not
   * @param tableName  Table name to be checked
   * @return
   */
  public TableDescription checkResource(String tableName){
    TableDescription tableDescription = null;
 
    try{
      DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
      tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
    }
View Full Code Here

    long endTime = startTime + waitTime;
    while (System.currentTimeMillis() < endTime) {
      try {Thread.sleep(sleepDeleteTime);} catch (Exception e) {}
      try {
        DescribeTableRequest request = new DescribeTableRequest().withTableName(pTableName);
        TableDescription tableDescription = dynamoDBClient.describeTable(request).getTable();
        String tableStatus = tableDescription.getTableStatus();
        LOG.debug(pTableName + " - current state: " + tableStatus);
      } catch (AmazonServiceException ase) {
        if (ase.getErrorCode().equalsIgnoreCase("ResourceNotFoundException") == true)
          return;
        ase.printStackTrace();
View Full Code Here

    long endTime = startTime + waitTime;
    while (System.currentTimeMillis() < endTime) {
      try {Thread.sleep(sleepTime);} catch (Exception e) {}
      try {
        DescribeTableRequest request = new DescribeTableRequest().withTableName(tableName);
        TableDescription tableDescription = dynamoDBClient.describeTable(request).getTable();
        String tableStatus = tableDescription.getTableStatus();
        LOG.debug(tableName + " - current state: " + tableStatus);
        if (tableStatus.equals(TableStatus.ACTIVE.toString())) return;
      } catch (AmazonServiceException ase) {
        if (ase.getErrorCode().equalsIgnoreCase("ResourceNotFoundException") == false) throw ase;
      }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodb.model.TableDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.