Esempio n. 1
0
 private void enablePartition() {
   if ("LEADER".equals(getNodeStatus())) {
     return;
   }
   participantManager
       .getClusterManagmentTool()
       .enablePartition(
           true, clusterName, instanceName, resourceName, asList(resourceName + "_0"));
   while (!"LEADER".equals(getNodeStatus())) {
     try {
       Thread.sleep(10);
     } catch (InterruptedException e) {
     }
   }
 }
Esempio n. 2
0
  private void disablePartition() {
    String nodeStatus = getNodeStatus();
    if ("STANDBY".equals(nodeStatus) || "OFFLINE".equals(nodeStatus)) {
      return;
    }
    participantManager
        .getClusterManagmentTool()
        .enablePartition(
            false, clusterName, instanceName, resourceName, asList(resourceName + "_0"));

    while (!("STANDBY".equals(nodeStatus) || "OFFLINE".equals(nodeStatus))) {
      try {
        Thread.sleep(10);
        nodeStatus = getNodeStatus();
      } catch (InterruptedException e) {
      }
    }
  }