This topic describes how to query the details of a global table using the Tablestore SDK for Java.
Prerequisite
Method
public DescribeGlobalTableResponse describeGlobalTable(DescribeGlobalTableRequest request) throws TableStoreException, ClientExceptionExample
private static void describeGlobalTableExample(SyncClient client) {
// Construct the request.
DescribeGlobalTableRequest req = new DescribeGlobalTableRequest(
// The global table ID.
"gt-ee1b54db-f5d9-43f3-ad36-ec44********",
// The name of the global table.
"t-gt-test-1"
);
// Send the request.
DescribeGlobalTableResponse descResp = client.describeGlobalTable(req);
// Print the basic information of the global table.
System.out.println("Status: " + descResp.getStatus());
System.out.println("Global Table ID: " + descResp.getGlobalTableId());
// Print the replica deployment information (Placement).
List<GlobalTableTypes.PhyTable> placements = descResp.getPhyTables();
for (GlobalTableTypes.PhyTable p : placements) {
System.out.println("Replica in " + p.getRegionId() +
", Instance: " + p.getInstanceName() +
", Writable: " + p.isWritable());
}
}