Search in sources :

Example 1 with AbstractBroker

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");
        }
    };
}
Also used : Master(org.neo4j.kernel.ha.Master) AbstractBroker(org.neo4j.kernel.ha.AbstractBroker) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) MasterClient(org.neo4j.kernel.ha.MasterClient) Machine(org.neo4j.kernel.ha.zookeeper.Machine)

Aggregations

GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)1 AbstractBroker (org.neo4j.kernel.ha.AbstractBroker)1 Master (org.neo4j.kernel.ha.Master)1 MasterClient (org.neo4j.kernel.ha.MasterClient)1 Machine (org.neo4j.kernel.ha.zookeeper.Machine)1