use of org.neo4j.kernel.ha.AbstractBroker in project graphdb by neo4j-attic.
the class SingleJvmWithNettyTest method makeSlaveBroker.
@Override
protected Broker makeSlaveBroker(MasterImpl master, int masterId, int id, GraphDatabaseService graphDb) {
final Machine masterMachine = new //
Machine(//
masterId, //
-1, //
1, "localhost:" + Protocol.PORT);
final Master client = new MasterClient(masterMachine, graphDb);
return new AbstractBroker(id, graphDb) {
public boolean iAmMaster() {
return false;
}
public Pair<Master, Machine> getMasterReally() {
return getMaster();
}
public Pair<Master, Machine> getMaster() {
return Pair.of(client, masterMachine);
}
public Object instantiateMasterServer(GraphDatabaseService graphDb) {
throw new UnsupportedOperationException("cannot instantiate master server on slave");
}
};
}
Aggregations