Tablestore SDK for Java retrieves a table's schema, settings, Stream status, encryption settings, reserved throughput, and secondary index metadata.
Prerequisites
Install the Tablestore SDK for Java and initialize the client.
Function description
Call describeTable to query the schema, configurations, Stream settings, server-side encryption settings, reserved throughput, and secondary indexes of a table.
public DescribeTableResponse describeTable(DescribeTableRequest request) throws TableStoreException, ClientException
The following example queries example_table and prints the main fields in the response.
DescribeTableRequest request = new DescribeTableRequest("example_table");
DescribeTableResponse response = client.describeTable(request);
System.out.println("Table metadata: " + response.getTableMeta());
System.out.println("Table options: " + response.getTableOptions());
System.out.println("Stream details: " + response.getStreamDetails());
SSEDetails sseDetails = response.getSseDetails();
System.out.println("Encryption enabled: " + sseDetails.isEnable());
if (sseDetails.isEnable()) {
System.out.println("Encryption type: " + sseDetails.getKeyType());
}
System.out.println("Reserved throughput: " + response.getReservedThroughputDetails());
System.out.println("Secondary indexes: " + response.getIndexMeta());
System.out.println("Partition split points: " + response.getShardSplits());
System.out.println("Creation time: " + response.getCreationTime());
Parameters
DescribeTableRequest contains the following parameter.
|
Name |
Type |
Description |
|
tableName (required) |
|
The name of the table. |
Response
DescribeTableResponse contains the following information.
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |