Esempio n. 1
0
        public override GraphDatabaseFacade NewGraphDatabase(Config config, GraphDatabaseFacadeFactory.Dependencies dependencies)
        {
            File storeDir = config.Get(GraphDatabaseSettings.database_path);

            config.Augment(stringMap(GraphDatabaseSettings.ephemeral.name(), "true", (new BoltConnector("bolt")).listen_address.name(), "localhost:0"));
            return(new ImpermanentGraphDatabase(storeDir, config, GraphDatabaseDependencies.newDependencies(dependencies)));
        }
Esempio n. 2
0
            public GraphDatabaseService newDatabase(Config config)
            {
                File absoluteStoreDir = _storeDir.AbsoluteFile;
                File databasesRoot    = absoluteStoreDir.ParentFile;

                if (!config.IsConfigured(GraphDatabaseSettings.shutdown_transaction_end_timeout))
                {
                    config.Augment(GraphDatabaseSettings.shutdown_transaction_end_timeout, "0s");
                }
                config.Augment(GraphDatabaseSettings.ephemeral, Settings.FALSE);
                config.augment(GraphDatabaseSettings.active_database, absoluteStoreDir.Name);
                config.augment(GraphDatabaseSettings.databases_root_path, databasesRoot.AbsolutePath);
                return(new GraphDatabaseFacadeFactoryAnonymousInnerClass(this, DatabaseInfo.ENTERPRISE, config)
                       .newFacade(databasesRoot, config, GraphDatabaseDependencies.newDependencies(_state.databaseDependencies())));
            }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkExpectedDatabaseDirectory()
        internal virtual void CheckExpectedDatabaseDirectory()
        {
            Config config = Config.builder().withServerDefaults().withSetting(mode, Mode.SINGLE.name()).withSetting(GraphDatabaseSettings.neo4j_home, _testDirectory.storeDir().AbsolutePath).withSetting((new BoltConnector("bolt")).listen_address.name(), "localhost:0").withSetting((new BoltConnector("http")).listen_address.name(), "localhost:0").withSetting((new BoltConnector("https")).listen_address.name(), "localhost:0").build();
            GraphDatabaseDependencies dependencies = GraphDatabaseDependencies.newDependencies().userLogProvider(NullLogProvider.Instance);
            OpenEnterpriseNeoServer   server       = new OpenEnterpriseNeoServer(config, dependencies);

            server.Start();
            try
            {
                Path expectedPath         = Paths.get(_testDirectory.storeDir().Path, "data", "databases", "graph.db");
                GraphDatabaseFacade graph = server.Database.Graph;
                assertEquals(expectedPath, graph.DatabaseLayout().databaseDirectory().toPath());
            }
            finally
            {
                server.Stop();
            }
        }
Esempio n. 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustIgnoreExceptionsFromPreLoadingCypherQuery()
        public virtual void MustIgnoreExceptionsFromPreLoadingCypherQuery()
        {
            // Given a lifecycled database that'll try to warm up Cypher when it starts
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.kernel.impl.factory.GraphDatabaseFacade mockDb = mock(org.neo4j.kernel.impl.factory.GraphDatabaseFacade.class);
            GraphDatabaseFacade mockDb = mock(typeof(GraphDatabaseFacade));
            Config config = Config.defaults();

            GraphDatabaseFacadeFactory.Dependencies deps = GraphDatabaseDependencies.newDependencies().userLogProvider(NullLogProvider.Instance);
            GraphFactory factory         = new SimpleGraphFactory(mockDb);
            LifecycleManagingDatabase db = new LifecycleManagingDatabaseAnonymousInnerClass(this, config, factory, deps);

            // When the execution of the query fails (for instance when this is a slave that just joined a cluster and is
            // working on catching up to the master)
            when(mockDb.Execute(LifecycleManagingDatabase.CYPHER_WARMUP_QUERY)).thenThrow(new TransactionFailureException("Boo"));

            // Then the database should still start up as normal, without bubbling the exception up
            Db.init();
            Db.start();
            assertTrue("the database should be running", Db.Running);
            Db.stop();
            Db.shutdown();
        }
Esempio n. 5
0
 public GraphDatabaseService newDatabase(Config config)
 {
     return(_outerInstance.customFacadeFactory.newFacade(_storeDir, config, GraphDatabaseDependencies.newDependencies(_state.databaseDependencies())));
 }
Esempio n. 6
0
 private static GraphDatabaseDependencies GraphDbDependencies()
 {
     return(GraphDatabaseDependencies.newDependencies().userLogProvider(NullLogProvider.Instance));
 }