我在DynamoDB中编写了以下代码来创建表。我和Eclise一起运行这个。我已经配置了Tomcat服务器。我在Tomcat上部署了我的应用程序并打开了localhost URL。
DynamoDB dynamoDB = new DynamoDB(dynamo);
ArrayList<AttributeDefinition> attributeDefinitions = new ArrayList<AttributeDefinition>();
attributeDefinitions.add(new AttributeDefinition()
.withAttributeName("Id").withAttributeType("N"));
ArrayList<KeySchemaElement> keySchema = new ArrayList<KeySchemaElement>();
keySchema.add(new KeySchemaElement().withAttributeName("Id")
.withKeyType(KeyType.HASH));
CreateTableRequest request1 = new CreateTableRequest()
.withTableName("abcdef")
.withKeySchema(keySchema)
.withAttributeDefinitions(attributeDefinitions)
.withProvisionedThroughput(new ProvisionedThroughput()
.withReadCapacityUnits(5L)
.withWriteCapacityUnits(6L));
System.out.println("Issuing CreateTable request for abcde");
Table table = dynamoDB.createTable(request1);
System.out.println("Waiting for abcde to be created...this may take a while...");
table.waitForActive();
它成功运行。它还显示已成功创建的表。 但是当我打开Amazon DynamoDB控制台时,它并不反映新创建的表。谁能告诉我这里出了什么问题?我已正确配置secretKey和accessKey。
答案 0 :(得分:4)
它可能是创建表格和控制台显示的不同区域吗?