示例#1
0
        protected internal virtual System.Func <string, TokenHolders> CreateTokenHolderProvider(PlatformModule platform)
        {
            Config            config            = platform.Config;
            DataSourceManager dataSourceManager = platform.DataSourceManager;

            return(ignored => new TokenHolders(new DelegatingTokenHolder(CreatePropertyKeyCreator(config, dataSourceManager), Org.Neo4j.Kernel.impl.core.TokenHolder_Fields.TYPE_PROPERTY_KEY), new DelegatingTokenHolder(CreateLabelIdCreator(config, dataSourceManager), Org.Neo4j.Kernel.impl.core.TokenHolder_Fields.TYPE_LABEL), new DelegatingTokenHolder(CreateRelationshipTypeCreator(config, dataSourceManager), Org.Neo4j.Kernel.impl.core.TokenHolder_Fields.TYPE_RELATIONSHIP_TYPE)));
        }
示例#2
0
 internal UdcKernelExtension(Config config, DataSourceManager dataSourceManager, UsageData usageData, Timer timer)
 {
     this._config            = config;
     this._dataSourceManager = dataSourceManager;
     this._usageData         = usageData;
     this._timer             = timer;
 }
示例#3
0
        public CommunityEditionModule(PlatformModule platformModule)
        {
            Org.Neo4j.Kernel.impl.util.Dependencies dependencies = platformModule.Dependencies;
            Config                config            = platformModule.Config;
            LogService            logging           = platformModule.Logging;
            FileSystemAbstraction fileSystem        = platformModule.FileSystem;
            PageCache             pageCache         = platformModule.PageCache;
            DataSourceManager     dataSourceManager = platformModule.DataSourceManager;
            LifeSupport           life = platformModule.Life;

            life.Add(platformModule.DataSourceManager);

            WatcherServiceFactoryConflict = databaseDir => CreateFileSystemWatcherService(fileSystem, databaseDir, logging, platformModule.JobScheduler, config, FileWatcherFileNameFilter());

            this.AccessCapabilityConflict = config.Get(GraphDatabaseSettings.read_only) ? new ReadOnly() : new CanWrite();

            dependencies.SatisfyDependency(SslPolicyLoader.create(config, logging.InternalLogProvider));                   // for bolt and web server

            LocksFactory lockFactory = createLockFactory(config, logging);

            LocksSupplierConflict = () => createLockManager(lockFactory, config, platformModule.Clock);
            StatementLocksFactoryProviderConflict = locks => CreateStatementLocksFactory(locks, config, logging);

            ThreadToTransactionBridgeConflict = dependencies.SatisfyDependency(new ThreadToStatementContextBridge(GetGlobalAvailabilityGuard(platformModule.Clock, logging, platformModule.Config)));

            IdContextFactoryConflict = CreateIdContextFactory(platformModule, fileSystem);

            TokenHoldersProviderConflict = CreateTokenHolderProvider(platformModule);

            File kernelContextDirectory = platformModule.StoreLayout.storeDirectory();

            dependencies.SatisfyDependency(CreateKernelData(fileSystem, pageCache, kernelContextDirectory, config, life, dataSourceManager));

            CommitProcessFactoryConflict = new CommunityCommitProcessFactory();

            HeaderInformationFactoryConflict = CreateHeaderInformationFactory();

            SchemaWriteGuardConflict = CreateSchemaWriteGuard();

            TransactionStartTimeoutConflict = config.Get(GraphDatabaseSettings.transaction_start_timeout).toMillis();

            ConstraintSemanticsConflict = CreateSchemaRuleVerifier();

            IoLimiterConflict = Org.Neo4j.Io.pagecache.IOLimiter_Fields.Unlimited;

            ConnectionTrackerConflict = dependencies.SatisfyDependency(CreateConnectionTracker());

            PublishEditionInfo(dependencies.ResolveDependency(typeof(UsageData)), platformModule.DatabaseInfo, config);
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void doNotRestartServicesIfAlreadyStarted()
        public virtual void DoNotRestartServicesIfAlreadyStarted()
        {
            DataSourceManager dataSourceManager = mock(typeof(DataSourceManager));
            LocalDatabase     localDatabase     = NewLocalDatabase(NewAvailabilityGuard(), dataSourceManager);

            localDatabase.Start();

            verify(dataSourceManager).start();
            reset(dataSourceManager);

            localDatabase.Start();
            localDatabase.Start();

            verify(dataSourceManager, never()).start();
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void availabilityGuardRaisedBeforeDataSourceManagerIsStoppedForStoreCopy() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void AvailabilityGuardRaisedBeforeDataSourceManagerIsStoppedForStoreCopy()
        {
            AvailabilityGuard guard             = mock(typeof(DatabaseAvailabilityGuard));
            DataSourceManager dataSourceManager = mock(typeof(DataSourceManager));

            LocalDatabase localDatabase = NewLocalDatabase(guard, dataSourceManager);

            localDatabase.StopForStoreCopy();

            InOrder inOrder = inOrder(guard, dataSourceManager);

            // guard should be raised twice - once during construction and once during stop
            inOrder.verify(guard, times(2)).require(any());
            inOrder.verify(dataSourceManager).stop();
        }
示例#6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUp()
        public virtual void SetUp()
        {
            DataSourceManager  dataSourceManager = new DataSourceManager(Config.defaults());
            NeoStoreDataSource dataSource        = mock(typeof(NeoStoreDataSource));

            when(dataSource.DatabaseLayout).thenReturn(TestDirectory.databaseLayout());
            dataSourceManager.Register(dataSource);
            KernelData kernelData = new KernelData(_fs, mock(typeof(PageCache)), new File("storeDir"), Config.defaults(), dataSourceManager);

            Dependencies dependencies = new Dependencies();

            dependencies.SatisfyDependency(_clusterStateDirectory);
            dependencies.SatisfyDependency(_raftMachine);
            dependencies.SatisfyDependency(DatabaseInfo.CORE);

            when(dataSource.DependencyResolver).thenReturn(dependencies);
            ManagementData data = new ManagementData(new CausalClusteringBean(), kernelData, ManagementSupport.load());

            _ccBean = ( CausalClustering )(new CausalClusteringBean()).CreateMBean(data);
        }
示例#7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: TransactionManagerImpl(org.neo4j.jmx.impl.ManagementData management) throws javax.management.NotCompliantMBeanException
            internal TransactionManagerImpl(ManagementData management) : base(management)
            {
                this.TxMonitor         = management.ResolveDependency(typeof(DatabaseTransactionStats));
                this.DataSourceManager = management.ResolveDependency(typeof(DataSourceManager));
            }
示例#8
0
 private KernelData CreateKernelData(FileSystemAbstraction fileSystem, PageCache pageCache, File storeDir, Config config, LifeSupport life, DataSourceManager dataSourceManager)
 {
     return(life.Add(new KernelData(fileSystem, pageCache, storeDir, config, dataSourceManager)));
 }
示例#9
0
 private static LocalDatabase NewLocalDatabase(AvailabilityGuard databaseAvailabilityGuard, DataSourceManager dataSourceManager)
 {
     return(new LocalDatabase(mock(typeof(DatabaseLayout)), mock(typeof(StoreFiles)), mock(typeof(LogFiles)), dataSourceManager, () => mock(typeof(DatabaseHealth)), databaseAvailabilityGuard, NullLogProvider.Instance));
 }