Package org.neo4j.kernel.ha

Examples of org.neo4j.kernel.ha.MasterClient


                {
                    broker = new FakeMasterBroker( machineId, placeHolderGraphDb );
                }
                else
                {
                    broker = new FakeSlaveBroker( new MasterClient( "localhost",
                            Protocol.PORT, placeHolderGraphDb ), masterId, machineId, placeHolderGraphDb );
                }
                HighlyAvailableGraphDatabase db = new HighlyAvailableGraphDatabase( storeDir, config,
                        AbstractHaTest.wrapBrokerAndSetPlaceHolderDb( placeHolderGraphDb, broker ) );
                placeHolderGraphDb.setDb( db );
View Full Code Here


    @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;
View Full Code Here

    private void invalidateMaster()
    {
        if ( cachedMaster != null )
        {
            MasterClient client = (MasterClient) cachedMaster.first();
            if ( client != null )
            {
                client.shutdown();
            }
            cachedMaster = Pair.<Master, Machine>of( null, Machine.NO_MACHINE );
        }
    }
View Full Code Here

    }

    protected Pair<Master, Machine> getMasterFromZooKeeper( boolean wait )
    {
        Machine master = getMasterBasedOn( getAllMachines( wait ).values() );
        MasterClient masterClient = null;
        if ( cachedMaster.other().getMachineId() != master.getMachineId() )
        {
            invalidateMaster();
            if ( master != Machine.NO_MACHINE && master.getMachineId() != getMyMachineId() )
            {
                masterClient = new MasterClient( master, graphDb );
            }
            cachedMaster = Pair.<Master, Machine>of( masterClient, master );
        }
        return cachedMaster;
    }
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.ha.MasterClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.