Topik ini menjelaskan cara melakukan kueri detail tabel global menggunakan Java SDK.
Prasyarat
Metode
public DescribeGlobalTableResponse describeGlobalTable(DescribeGlobalTableRequest request) throws TableStoreException, ClientExceptionContoh
private static void describeGlobalTableExample(SyncClient client) {
// Membuat permintaan.
DescribeGlobalTableRequest req = new DescribeGlobalTableRequest(
// ID tabel global.
"gt-ee1b54db-f5d9-43f3-ad36-ec44********",
// Nama tabel global.
"t-gt-test-1"
);
// Mengirim permintaan.
DescribeGlobalTableResponse descResp = client.describeGlobalTable(req);
// Mencetak informasi dasar tabel global.
System.out.println("Status: " + descResp.getStatus());
System.out.println("ID Tabel Global: " + descResp.getGlobalTableId());
// Mencetak informasi penerapan replika (Placement).
List<GlobalTableTypes.PhyTable> placements = descResp.getPhyTables();
for (GlobalTableTypes.PhyTable p : placements) {
System.out.println("Replika di " + p.getRegionId() +
", Instans: " + p.getInstanceName() +
", Dapat Ditulis: " + p.isWritable());
}
}