Package com.amazonaws.services.dynamodb.model

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


    public void deleteTable(String tableName) {
        ddbClient.deleteTable(new DeleteTableRequest(tableName));
    }

    public List<String> listTables() {
        ListTablesResult   list = ddbClient.listTables();
        return list.getTableNames();
    }
View Full Code Here


        deleteMarkerEnabled = conf.getBoolean("s3mper.metastore.deleteMarker.enabled", false);
       
        boolean checkTableExists = conf.getBoolean("s3mper.metastore.create", false);
       
        if(checkTableExists) {
            ListTablesResult tables = db.listTables();
           
            if(!tables.getTableNames().contains(tableName)) {
                createTable();
            }
        }
    }
View Full Code Here

    for (int i = startIndex; i < size; i++) {
      tables.add(this.tableList.get(i).getName());
    }

    // Create result object
    ListTablesResult result = new ListTablesResult().withTableNames(tables);
    if (setTableName) {
      result.setLastEvaluatedTableName(this.tableList.get(size).getName());
    }

    return result;
  }
View Full Code Here

    return result;
  }

  public com.amazonaws.services.dynamodbv2.model.ListTablesResult listTablesV2(com.amazonaws.services.dynamodbv2.model.ListTablesRequest v2Request) throws InternalServerErrorException, ResourceNotFoundException {
        ListTablesRequest request = AlternatorDBApiVersion2Mapper.MapV2ListTablesRequestToV1(v2Request);
        ListTablesResult result = listTables(request);
        return AlternatorDBApiVersion2Mapper.MapV1ListTablesResultToV2(result);
  }
View Full Code Here

    Request<ListTablesRequest> request = new ListTablesRequestMarshaller().marshall(listTablesRequest);

    Unmarshaller<ListTablesResult, JsonUnmarshallerContext> unmarshaller = new ListTablesResultJsonUnmarshaller();
    JsonResponseHandler<ListTablesResult> responseHandler = new JsonResponseHandler<ListTablesResult>(unmarshaller);

    ListTablesResult result = invoke(request, responseHandler);
                return result;
  }
View Full Code Here

  @Test
  public void listTables() {
    String name = createTableName();
    createTable(name);
    ListTablesResult res = getClient().listTables();
    Assert.assertTrue(res.getTableNames().contains(name));
  }
View Full Code Here

  @Test
  public void listTablesWithLimitOverTableCount() {
    String name = createTableName();
    createTable(name);
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withLimit(5));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 1);
  }
View Full Code Here

  public void listTablesWithLimitUnderTableCount() {
    String name = createTableName();
    createTable();
    createTable(name);
    createTable();
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withLimit(2));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 2);
  }
View Full Code Here

  public void listTablesWithExclusiveTableName() {
    String name = createTableName();
    createTable();
    createTable();
    createTable(name);
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withExclusiveStartTableName(name));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 1);
  }
View Full Code Here

    createTable();
    createTable();
    createTable(name);
    createTable();
    createTable();
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withLimit(1).withExclusiveStartTableName(name));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 1);
  }
View Full Code Here

TOP

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

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.