Пример #1
0
        private static ChildInitializer ChildInitializer(FileSystemAbstraction fileSystem, GraphDatabaseAPI graphDb)
        {
            ApplicationSupportedProtocols catchupProtocols  = new ApplicationSupportedProtocols(CATCHUP, emptyList());
            ModifierSupportedProtocols    modifierProtocols = new ModifierSupportedProtocols(COMPRESSION, emptyList());

            ApplicationProtocolRepository catchupRepository  = new ApplicationProtocolRepository(Protocol_ApplicationProtocols.values(), catchupProtocols);
            ModifierProtocolRepository    modifierRepository = new ModifierProtocolRepository(Protocol_ModifierProtocols.values(), singletonList(modifierProtocols));

            System.Func <CheckPointer>       checkPointer = () => graphDb.DependencyResolver.resolveDependency(typeof(CheckPointer));
            System.Func <bool>               availability = () => graphDb.DependencyResolver.resolveDependency(typeof(DatabaseAvailabilityGuard)).Available;
            System.Func <NeoStoreDataSource> dataSource   = () => graphDb.DependencyResolver.resolveDependency(typeof(NeoStoreDataSource));
            LogProvider logProvider = NullLogProvider.Instance;

            Org.Neo4j.Storageengine.Api.StoreId kernelStoreId = dataSource().StoreId;
            StoreId storeId = new StoreId(kernelStoreId.CreationTime, kernelStoreId.RandomId, kernelStoreId.UpgradeTime, kernelStoreId.UpgradeId);

            CheckPointerService         checkPointerService  = new CheckPointerService(checkPointer, createInitialisedScheduler(), Group.CHECKPOINT);
            RegularCatchupServerHandler catchupServerHandler = new RegularCatchupServerHandler(new Monitors(), logProvider, () => storeId, dataSource, availability, fileSystem, null, checkPointerService);

            NettyPipelineBuilderFactory pipelineBuilder = new NettyPipelineBuilderFactory(VoidPipelineWrapperFactory.VOID_WRAPPER);

            CatchupProtocolServerInstaller.Factory catchupProtocolServerInstaller = new CatchupProtocolServerInstaller.Factory(pipelineBuilder, logProvider, catchupServerHandler);

            ProtocolInstallerRepository <Org.Neo4j.causalclustering.protocol.ProtocolInstaller_Orientation_Server> protocolInstallerRepository = new ProtocolInstallerRepository <Org.Neo4j.causalclustering.protocol.ProtocolInstaller_Orientation_Server>(singletonList(catchupProtocolServerInstaller), Org.Neo4j.causalclustering.protocol.ModifierProtocolInstaller_Fields.AllServerInstallers);

            return(new HandshakeServerInitializer(catchupRepository, modifierRepository, protocolInstallerRepository, pipelineBuilder, logProvider));
        }
Пример #2
0
 public static Optional <Protocol_ApplicationProtocol> Find(Protocol_ApplicationProtocolCategory category, int?version)
 {
     return(Protocol.find(Protocol_ApplicationProtocols.values(), category, version, System.Func.identity()));
 }