Package org.neo4j.graphdb.factory

Examples of org.neo4j.graphdb.factory.GraphDatabaseFactory


    }

    @Test(timeout = 5000)
    @RepeatRule.Repeat(times = 10)
    public void makeSureDeadlockDoesNotOccur5() {
        GraphDatabaseService database = new GraphDatabaseFactory()
                .newEmbeddedDatabaseBuilder(temporaryFolder.getRoot().getPath())
                .setConfig(RuntimeKernelExtension.RUNTIME_ENABLED, "true")
                .newGraphDatabase();

        try (Transaction tx = database.beginTx()) {
View Full Code Here


    }

    @Test(timeout = 5000)
    @RepeatRule.Repeat(times = 10)
    public void makeSureDeadlockDoesNotOccur6() throws InterruptedException {
        GraphDatabaseService database = new GraphDatabaseFactory()
                .newEmbeddedDatabaseBuilder(temporaryFolder.getRoot().getPath())
                .setConfig(RuntimeKernelExtension.RUNTIME_ENABLED, "true")
                .newGraphDatabase();

        try (Transaction tx = database.beginTx()) {
View Full Code Here

    @Configuration
    public class Config {

        @Bean(destroyMethod = "shutdown")
        public GraphDatabaseService graphDatabaseService() {
            GraphDatabaseService database = new GraphDatabaseFactory()
                    .newEmbeddedDatabaseBuilder("/tmp/test")
                    .loadPropertiesFromURL(
                            Config.class.getClassLoader().getResource("com/graphaware/runtime/spring/neo4j.properties"))
                    .newGraphDatabase();
View Full Code Here

        if (database != null) return database;
        return database = createDatabase();
    }

    private GraphDatabaseService createDatabase() {
        GraphDatabaseBuilder builder = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(path);
        if (config != null) {
            builder.setConfig(config);
        }
        return builder.newGraphDatabase();
    }
View Full Code Here

    configuration = properties;
  }

  @Override
  public GraphDatabaseService create() {
    GraphDatabaseBuilder builder = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder( dbLocation );
    setConfigurationFromLocation( builder, configurationLocation );
    setConfigurationFromProperties( builder, configuration );
    return builder.newGraphDatabase();
  }
View Full Code Here

            if (properties != null)
            {
                Map<String, String> config = new HashMap<String, String>((Map) properties);

                GraphDatabaseBuilder builder = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(datastoreFilePath);
                builder.setConfig(config);

                graphDb = builder.newGraphDatabase();
                // registerShutdownHook(graphDb);
            }
        }

        if (graphDb == null)
        {
            graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(datastoreFilePath);
            // registerShutdownHook(graphDb);
        }

        return graphDb;
    }
View Full Code Here

      this.name = name;
      this.value = value;
    }
  }
  public GraphDatabaseService connect(String dir, Map<String, String> properties) {
    GraphDatabaseService graphDb = new GraphDatabaseFactory()
        .newEmbeddedDatabaseBuilder(dir)
        .setConfig(properties)
        .newGraphDatabase();
    this.installShutdownHook(graphDb);
    return graphDb;
View Full Code Here

    private File graphMlFile = new File("test-data/Enron_Dataset_v0.12.graphml");

    @Before
    public void setUp() throws Exception {
        FileUtils.deleteRecursively(directory);
        db = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(directory.getAbsolutePath())
                .setConfig(GraphDatabaseSettings.nodestore_mapped_memory_size,String.valueOf(20*MEGABYTE))
                .setConfig(GraphDatabaseSettings.relationshipstore_mapped_memory_size,String.valueOf(100*MEGABYTE))
                .setConfig(GraphDatabaseSettings.nodestore_propertystore_index_keys_mapped_memory_size,String.valueOf(100*MEGABYTE))
                .setConfig(GraphDatabaseSettings.strings_mapped_memory_size,String.valueOf(100*MEGABYTE))
                .setConfig(GraphDatabaseSettings.keep_logical_logs, "false")
View Full Code Here

TOP

Related Classes of org.neo4j.graphdb.factory.GraphDatabaseFactory

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.