Package org.neo4j.kernel

Examples of org.neo4j.kernel.EmbeddedGraphDatabase


    {
        String storeDir = config.first();
        String backupConfigValue = config.other();
        if ( backupConfigValue == null )
        {
            this.db = new EmbeddedGraphDatabase( storeDir );
        }
        else
        {
            this.db = new EmbeddedGraphDatabase( storeDir, stringMap( ENABLE_ONLINE_BACKUP, backupConfigValue ) );
        }
    }
View Full Code Here


    public EmbeddedServer( String storeDir, String backupConfigValue )
    {
        if ( backupConfigValue == null )
        {
            this.db = new EmbeddedGraphDatabase( storeDir );
        }
        else
        {
            this.db = new EmbeddedGraphDatabase( storeDir, stringMap( ENABLE_ONLINE_BACKUP, backupConfigValue ) );
        }
    }
View Full Code Here

        return Collections.unmodifiableMap( lastCommittedTxs );
    }

    private EmbeddedGraphDatabase startTemporaryDb( String targetDirectory )
    {
        return new EmbeddedGraphDatabase( targetDirectory );
    }
View Full Code Here

   
    private GraphDatabaseService newDb( String onlineBackupConfig )
    {
        String path = SOURCE_DIR;
        return onlineBackupConfig == null ?
                new EmbeddedGraphDatabase( path ) :
                new EmbeddedGraphDatabase( path, stringMap( ENABLE_ONLINE_BACKUP, onlineBackupConfig ) );
    }
View Full Code Here

    @After
    public void shutdownDbsAndVerify() throws Exception
    {
        shutdownDbs();

        GraphDatabaseService masterDb = new EmbeddedGraphDatabase( dbPath( 0 ).getAbsolutePath() );
        try
        {
            for ( int i = 1; i < jvms.size(); i++ )
            {
                GraphDatabaseService slaveDb = new EmbeddedGraphDatabase( dbPath( i ).getAbsolutePath() );
                try
                {
                    verify( masterDb, slaveDb );
                }
                finally
                {
                    slaveDb.shutdown();
                }
            }
        }
        finally
        {
View Full Code Here

   
    private GraphDatabaseService newGraphDbService()
    {
        String path = getDbPath();
        Neo4jTestCase.deleteFileOrDirectory( new File( path ) );
        return new EmbeddedGraphDatabase( path );
    }
View Full Code Here

        {
            sleepNice( 100 );
        }
       
        // Start up and let it recover
        final GraphDatabaseService newGraphDb = new EmbeddedGraphDatabase( getDbPath() );
        newGraphDb.shutdown();
    }
View Full Code Here

      // Let it run for a while and then kill it, and wait for it to die
      Thread.sleep( 6000 );
      process.destroy();
      process.waitFor();
     
      GraphDatabaseService db = new EmbeddedGraphDatabase( path );
      assertTrue( db.index().existsForNodes( "myIndex" ) );
      Index<Node> index = db.index().forNodes( "myIndex" );
      for ( Node node : db.getAllNodes() )
      {
          for ( String key : node.getPropertyKeys() )
          {
              String value = (String) node.getProperty( key );
              boolean found = false;
              for ( Node indexedNode : index.get( key, value ) )
                {
                  if ( indexedNode.equals( node ) )
                  {
                      found = true;
                      break;
                  }
                }
              if ( !found )
              {
                  throw new IllegalStateException( node + " has property '" + key + "'='" +
                          value + "', but not in index" );
              }
          }
      }
      db.shutdown();
    }
View Full Code Here

        Node node = db.createNode();
        index.add( node, "key", "value" );
        db.shutdown();
       
        // This doesn't seem to trigger recovery... it really should
        new EmbeddedGraphDatabase( getDbPath() ).shutdown();
    }
View Full Code Here

        db.shutdown();
       
        assertEquals( 0, Runtime.getRuntime().exec( new String[] { "java", "-cp", System.getProperty( "java.class.path" ),
                AddDeleteQuit.class.getName(), getDbPath() } ).waitFor() );
       
        new EmbeddedGraphDatabase( getDbPath() ).shutdown();
        db.shutdown();
    }
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.EmbeddedGraphDatabase

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.