コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Parameterized.Parameters(name = "{0}") public static java.util.Collection<Parameters> data()
        public static ICollection <Parameters> Data()
        {
            Stream <Optional <Protocol_ModifierProtocol> > noModifierProtocols         = Stream.of(null);
            Stream <Optional <Protocol_ModifierProtocol> > individualModifierProtocols = Stream.of(Protocol_ModifierProtocols.values()).map(Optional.of);

            return(Stream.concat(noModifierProtocols, individualModifierProtocols).flatMap(protocol => Stream.of(Raft1WithCompressionModifier(protocol), Raft2WithCompressionModifiers(protocol))).collect(Collectors.toList()));
        }
コード例 #2
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()
        {
            _logProvider = new AssertableLogProvider(true);
            ApplicationProtocolRepository applicationProtocolRepository = new ApplicationProtocolRepository(Org.Neo4j.causalclustering.protocol.Protocol_ApplicationProtocols.values(), _parameters.applicationSupportedProtocol);
            ModifierProtocolRepository    modifierProtocolRepository    = new ModifierProtocolRepository(Protocol_ModifierProtocols.values(), _parameters.modifierSupportedProtocols);

            NettyPipelineBuilderFactory serverPipelineBuilderFactory = new NettyPipelineBuilderFactory(VoidPipelineWrapperFactory.VOID_WRAPPER);
            NettyPipelineBuilderFactory clientPipelineBuilderFactory = new NettyPipelineBuilderFactory(VoidPipelineWrapperFactory.VOID_WRAPPER);

            _server = new Server(serverPipelineBuilderFactory);
            _server.start(applicationProtocolRepository, modifierProtocolRepository, _logProvider);

            Config config = Config.builder().withSetting(CausalClusteringSettings.handshake_timeout, TIMEOUT_SECONDS + "s").build();

            _client = new Client(applicationProtocolRepository, modifierProtocolRepository, clientPipelineBuilderFactory, config, _logProvider);

            _client.connect(_server.port());
        }
コード例 #3
0
 private void InitializeInstanceFields()
 {
     _applicationProtocolRepository = new ApplicationProtocolRepository(Protocol_ApplicationProtocols.values(), _supportedApplicationProtocol);
     _modifierProtocolRepository    = new ModifierProtocolRepository(Protocol_ModifierProtocols.values(), _supportedModifierProtocols);
 }
コード例 #4
0
        public virtual Server Build()
        {
            ApplicationProtocolRepository applicationProtocolRepository = new ApplicationProtocolRepository(Protocol_ApplicationProtocols.values(), _catchupProtocols);
            ModifierProtocolRepository    modifierProtocolRepository    = new ModifierProtocolRepository(Protocol_ModifierProtocols.values(), _modifierProtocols);

            CatchupProtocolServerInstaller.Factory catchupProtocolServerInstaller = new CatchupProtocolServerInstaller.Factory(_pipelineBuilder, _debugLogProvider, _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);

            HandshakeServerInitializer handshakeServerInitializer = new HandshakeServerInitializer(applicationProtocolRepository, modifierProtocolRepository, protocolInstallerRepository, _pipelineBuilder, _debugLogProvider);

            return(new Server(handshakeServerInitializer, _parentHandler, _debugLogProvider, _userLogProvider, _listenAddress, _serverName));
        }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Parameterized.Parameters(name = "{0}") public static java.util.Collection<org.neo4j.causalclustering.protocol.Protocol_ModifierProtocol> params()
        public static ICollection <Org.Neo4j.causalclustering.protocol.Protocol_ModifierProtocol> Params()
        {
            return(Arrays.asList(Protocol_ModifierProtocols.values()));
        }
コード例 #6
0
        public virtual CatchUpClient Build()
        {
            ApplicationProtocolRepository applicationProtocolRepository = new ApplicationProtocolRepository(Protocol_ApplicationProtocols.values(), _catchupProtocols);
            ModifierProtocolRepository    modifierProtocolRepository    = new ModifierProtocolRepository(Protocol_ModifierProtocols.values(), _modifierProtocols);

            System.Func <CatchUpResponseHandler, ChannelInitializer <SocketChannel> > channelInitializer = handler =>
            {
                IList <ProtocolInstaller.Factory <Client, ?> > installers = singletonList(new CatchupProtocolClientInstaller.Factory(_pipelineBuilder, _debugLogProvider, handler));

                ProtocolInstallerRepository <Client> protocolInstallerRepository = new ProtocolInstallerRepository <Client>(installers, ModifierProtocolInstaller.allClientInstallers);

                return(new HandshakeClientInitializer(applicationProtocolRepository, modifierProtocolRepository, protocolInstallerRepository, _pipelineBuilder, _handshakeTimeout, _debugLogProvider, _userLogProvider));
            };