Search in sources :

Example 1 with MasterImpl

use of org.neo4j.kernel.ha.MasterImpl in project graphdb by neo4j-attic.

the class SingleJvmTest method startUpMaster.

@Override
protected void startUpMaster(Map<String, String> extraConfig) throws Exception {
    int masterId = 0;
    Map<String, String> config = MapUtil.stringMap(extraConfig, HighlyAvailableGraphDatabase.CONFIG_KEY_HA_MACHINE_ID, String.valueOf(masterId));
    String path = dbPath(0).getAbsolutePath();
    PlaceHolderGraphDatabaseService placeHolderDb = new PlaceHolderGraphDatabaseService(path);
    Broker broker = makeMasterBroker(master, masterId, placeHolderDb);
    HighlyAvailableGraphDatabase db = new HighlyAvailableGraphDatabase(path, config, wrapBrokerAndSetPlaceHolderDb(placeHolderDb, broker));
    placeHolderDb.setDb(db);
    // db.newMaster( null, new Exception() );
    master = new MasterImpl(db);
}
Also used : Broker(org.neo4j.kernel.ha.Broker) FakeMasterBroker(org.neo4j.kernel.ha.FakeMasterBroker) FakeSlaveBroker(org.neo4j.kernel.ha.FakeSlaveBroker) MasterImpl(org.neo4j.kernel.ha.MasterImpl) HighlyAvailableGraphDatabase(org.neo4j.kernel.HighlyAvailableGraphDatabase)

Aggregations

HighlyAvailableGraphDatabase (org.neo4j.kernel.HighlyAvailableGraphDatabase)1 Broker (org.neo4j.kernel.ha.Broker)1 FakeMasterBroker (org.neo4j.kernel.ha.FakeMasterBroker)1 FakeSlaveBroker (org.neo4j.kernel.ha.FakeSlaveBroker)1 MasterImpl (org.neo4j.kernel.ha.MasterImpl)1