예제 #1
0
  public static String stateToString(ManagedCluster cluster) {
    StringBuilder buf = new StringBuilder("\n");
    for (HighlyAvailableGraphDatabase database : cluster.getAllMembers()) {
      ClusterClient client =
          database.getDependencyResolver().resolveDependency(ClusterClient.class);
      buf.append("Instance ")
          .append(client.getServerId())
          .append(":State ")
          .append(database.getInstanceState())
          .append(" (")
          .append(client.getClusterServer())
          .append("):")
          .append("\n");

      ClusterMembers members =
          database.getDependencyResolver().resolveDependency(ClusterMembers.class);

      for (ClusterMember clusterMember : members.getMembers()) {
        buf.append("  ")
            .append(clusterMember.getInstanceId())
            .append(":")
            .append(clusterMember.getHARole())
            .append(" (is alive = ")
            .append(clusterMember.isAlive())
            .append(")")
            .append("\n");
      }
    }

    return buf.toString();
  }
예제 #2
0
 @Override
 public void repair() throws Throwable {
   cluster.startMember(serverId);
 }
예제 #3
0
 @Override
 public HighlyAvailableGraphDatabase repair() throws Throwable {
   cluster.startMember(serverId);
   return cluster.getMemberByServerId(serverId);
 }