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
public DescribeTableResponse describeTable(DescribeTableRequest request) throws TableStoreException, ClientExceptiondescribeTable() returns a DescribeTableResponse that contains information about the specified table.
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.
tableName (required)
String: The name of the table.
Response
DescribeTableResponse contains the following information.
Field | Type | Description |
|
| Call |
|
| Call |
|
| Call |
|
| Call |
|
| Call |
|
| Call |
|
| Call |
|
| Call |