Dynamo DB Java SDK: DescribeTable response is showing wrong item count

0

I am working on a client program to just read the tables metadata. I am using the Describe table java API to do the same: val describeTableRequest = DescribeTableRequest.builder() .tableName(tableName) .build() I am running this request again after adding an item into the table, but the DescribeTableResponse is still showing the item count as 0. I waited for 30 mins and its still the same 0. Below is the code snippet for the same: `val describeTableResponse = client.describeTable(describeTableRequest) val tableDescription = describeTableResponse.table()

    println("Table Name: ${tableDescription.tableName()}")
    println("Table Status: ${tableDescription.tableStatus()}")
    println("Items count: ${tableDescription.itemCount()}")`

Client is basically created using the below snippet: val client = DynamoDbClient.builder() .credentialsProvider { AwsBasicCredentials.create(accessKey, secretKey) } .region(Region.of(region)) .build()

Please note that the Scan Request-Response is showing the right count but it is scanning the whole table and is not needed for me. I just need the basic metadata of the table.

Please let me know if I am missing anything here.

Abraham
질문됨 8달 전280회 조회
1개 답변
1
수락된 답변

That item count is updated approximately every six hours. In the Console where you see the item count you get a note to this effect.

Console screen shot

If you want to track counts over time, there's a blog discussing that.

AWS
답변함 8달 전
profile picture
전문가
검토됨 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠