Ejemplo n.º 1
0
 private void assertMember(HighlyAvailableGraphDatabase db) {
   for (HighlyAvailableGraphDatabaseProxy highlyAvailableGraphDatabaseProxy : members.values()) {
     if (highlyAvailableGraphDatabaseProxy.get().equals(db)) {
       return;
     }
   }
   throw new IllegalArgumentException(
       "Db " + db + " not a member of this cluster " + name + stateToString(this));
 }
Ejemplo n.º 2
0
 ManagedCluster(Clusters.Cluster spec) throws URISyntaxException, IOException {
   this.spec = spec;
   this.name = spec.getName();
   for (int i = 0; i < spec.getMembers().size(); i++) {
     startMember(new InstanceId(i + 1));
   }
   for (HighlyAvailableGraphDatabaseProxy member : members.values()) {
     insertInitialData(
         member.get(), name, member.get().getConfig().get(ClusterSettings.server_id));
   }
 }
Ejemplo n.º 3
0
 @Override
 public void stop() throws Throwable {
   for (HighlyAvailableGraphDatabaseProxy member : members.values()) {
     member.get().shutdown();
   }
 }