Package org.neo4j.kernel

Examples of org.neo4j.kernel.HighlyAvailableGraphDatabase


        db.shutdown();
    }

    private static GraphDatabaseService startDb() throws IOException
    {
        return new HighlyAvailableGraphDatabase( PATH.getPath(), MapUtil.stringMap(
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_MACHINE_ID, "1",
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_ZOO_KEEPER_SERVERS, "127.0.0.1:2181,127.0.0.1:2182",
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_SERVER, ME,
                Config.ENABLE_REMOTE_SHELL, "true",
                Config.KEEP_LOGICAL_LOGS, "true" ) );
View Full Code Here


        db.shutdown();
    }

    private static GraphDatabaseService startDb() throws IOException
    {
        return new HighlyAvailableGraphDatabase( PATH.getPath(), MapUtil.stringMap(
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_MACHINE_ID, "2",
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_ZOO_KEEPER_SERVERS, "127.0.0.1:2181,127.0.0.1:2182",
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_SERVER, ME,
                Config.ENABLE_REMOTE_SHELL, "port=1338",
                Config.KEEP_LOGICAL_LOGS, "true" ) );
View Full Code Here

    public static void main( String[] args )
    {
        String path = args[0];
        String configFile = args[1];
        Map<String, String> config = HighlyAvailableGraphDatabase.loadConfigurations( configFile );
        final GraphDatabaseService graphDb = new HighlyAvailableGraphDatabase( path, config );
        Runtime.getRuntime().addShutdownHook( new Thread()
        {
            @Override
            public void run()
            {
                graphDb.shutdown();
            }
        } );
    }
View Full Code Here

                zooKeeper.getConnectionString() )
        {
            @Override
            HighlyAvailableGraphDatabase start( String storeDir, Map<String, String> config )
            {
                HighlyAvailableGraphDatabase db = new HighlyAvailableGraphDatabase( storeDir,
                        config );
                System.out.println( "Started HA db (w/ zoo keeper)" );
                return db;
            }
        } )
View Full Code Here

                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 );
                System.out.println( "Started HA db (w/o zoo keeper)" );
                return db;
            }
View Full Code Here

            db();
        }

        public <T> T executeJob( Job<T> job ) throws Exception
        {
            HighlyAvailableGraphDatabase database = db();
            System.out.println( "Executing job " + job );
            T result = job.execute( database );
            System.out.println( "Job " + job + " executed" );
            return result;
        }
View Full Code Here

            return Integer.parseInt( db().getManagementBean( HighAvailability.class ).getMachineId() );
        }

        public void pullUpdates() throws StartupFailureException
        {
            HighlyAvailableGraphDatabase database = db();
            System.out.println( "pullUpdates" );
            database.pullUpdates();
        }
View Full Code Here

//        doStuff( db );
    }

    private static GraphDatabaseService startDb() throws IOException
    {
        return new HighlyAvailableGraphDatabase( PATH.getPath(), MapUtil.stringMap(
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_MACHINE_ID, "" + MY_MACHINE_ID,
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_ZOO_KEEPER_SERVERS, join( ZOO_KEEPER_SERVERS, "," ),
                HighlyAvailableGraphDatabase.CONFIG_KEY_HA_SERVER, ME,
                Config.ENABLE_REMOTE_SHELL, "true",
                Config.KEEP_LOGICAL_LOGS, "true" ) );
View Full Code Here

            Map<String, String> config = stringMap(
                    CONFIG_KEY_HA_MACHINE_ID, "" + i,
                    CONFIG_KEY_HA_SERVER, "localhost:" + (6666+i),
                    CONFIG_KEY_HA_ZOO_KEEPER_SERVERS, zk.getConnectionString(),
                    ENABLE_ONLINE_BACKUP, "port=" + (4444+i) );
            GraphDatabaseService instance = new HighlyAvailableGraphDatabase( storeDir, config );
            instances.add( instance );
        }
       
        // Really doesn't matter which instance
        representation = createSomeData( instances.get( 1 ) );
View Full Code Here

        config.put( HighlyAvailableGraphDatabase.CONFIG_KEY_HA_MACHINE_ID, "1" );
        config.put( HighlyAvailableGraphDatabase.CONFIG_KEY_HA_ZOO_KEEPER_SERVERS, zk.getConnectionString() );
        config.put( HighlyAvailableGraphDatabase.CONFIG_KEY_HA_SERVER, ( "127.0.0.1:" + haPort ) );
        config.put( Config.ENABLE_REMOTE_SHELL, "true" );
        config.put( Config.KEEP_LOGICAL_LOGS, "true" );
        return new HighlyAvailableGraphDatabase( storeDir.getAbsolutePath(), config );
    }
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.HighlyAvailableGraphDatabase

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.