Remove um ou mais locais de distribuição de uma tabela global com o SDK do Java.
Observações de uso
Desvincular um local de distribuição remove apenas a associação entre a tabela de réplica e a tabela global. A tabela de réplica e seus dados são mantidos. Para excluir a tabela de réplica, chame a operação DeleteTable separadamente.
Esta operação inicia uma solicitação de desvinculação assíncrona. Para confirmar a conclusão da desvinculação, chame a operação Consultar informações da tabela global e verifique o status da tabela global. A desvinculação é concluída quando o status muda para
active.
Pré-requisitos
Antes de começar, certifique-se de ter inicializado um cliente.
Descrição do método
public UnbindGlobalTableResponse unbindGlobalTable(UnbindGlobalTableRequest request) throws TableStoreException, ClientException
Exemplo
private static void unbindGlobalTableExample(SyncClient client) {
// Construct the request.
UnbindGlobalTableRequest request = new UnbindGlobalTableRequest(
// The global table ID.
"gt-ee1b54db-f5d9-43f3-ad36-ec44********",
// The global table name.
"my-global-table"
);
// Build the list of replicas to remove (Removals).
List<GlobalTableTypes.Removal> removals = new ArrayList<>();
// Remove the replica in the China (Hangzhou) region.
GlobalTableTypes.Removal hangzhouRemoval = new GlobalTableTypes.Removal(
// The region ID where the replica is located.
"cn-hangzhou",
// The instance name to which the replica belongs.
"instance-replica-hz"
);
// Remove the replica in the China (Shanghai) region.
GlobalTableTypes.Removal shanghaiRemoval = new GlobalTableTypes.Removal(
// The region ID where the replica is located.
"cn-shanghai",
// The instance name to which the replica belongs.
"instance-replica-sh"
);
removals.add(hangzhouRemoval);
removals.add(shanghaiRemoval);
request.setRemovals(removals);
// Initiate the request.
UnbindGlobalTableResponse response = client.unbindGlobalTable(request);
System.out.println("Unbind start. Request ID: " + response.getRequestId());
}