Exemple #1
0
 internal CausalClusteringBackupStrategy(BackupDelegator backupDelegator, AddressResolver addressResolver, LogProvider logProvider, StoreFiles storeFiles)
 {
     this._backupDelegator = backupDelegator;
     this._addressResolver = addressResolver;
     this._log             = logProvider.GetLog(typeof(CausalClusteringBackupStrategy));
     this._storeFiles      = storeFiles;
 }
Exemple #2
0
 public static LogProvider Provider(LifeSupport life, LogProvider provider)
 {
     if (_enabled)
     {
         if (provider is NullLogProvider)
         {
             return(provider);
         }
         return(new AsyncLogProvider(life.Add(new AsyncLogging(provider.GetLog(typeof(AsyncLogging)))).eventSender(), provider));
     }
     else
     {
         return(provider);
     }
 }
Exemple #3
0
        public DefaultMasterImplSPI(GraphDatabaseAPI graphDb, FileSystemAbstraction fileSystemAbstraction, Monitors monitors, TokenHolders tokenHolders, IdGeneratorFactory idGeneratorFactory, TransactionCommitProcess transactionCommitProcess, CheckPointer checkPointer, TransactionIdStore transactionIdStore, LogicalTransactionStore logicalTransactionStore, NeoStoreDataSource neoStoreDataSource, LogProvider logProvider)
        {
            this._graphDb                  = graphDb;
            this._fileSystem               = fileSystemAbstraction;
            this._tokenHolders             = tokenHolders;
            this._idGeneratorFactory       = idGeneratorFactory;
            this._transactionCommitProcess = transactionCommitProcess;
            this._checkPointer             = checkPointer;
            this._neoStoreDataSource       = neoStoreDataSource;
            this._databaseDirectory        = graphDb.DatabaseLayout().databaseDirectory();
            this._txChecksumLookup         = new TransactionChecksumLookup(transactionIdStore, logicalTransactionStore);
            this._responsePacker           = new ResponsePacker(logicalTransactionStore, transactionIdStore, graphDb.storeId);
            this._monitors                 = monitors;
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            monitors.AddMonitorListener(new LoggingStoreCopyServerMonitor(logProvider.GetLog(typeof(StoreCopyServer))), typeof(StoreCopyServer).FullName);
        }
Exemple #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testMessageReceivedOriginFix() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestMessageReceivedOriginFix()
        {
            LogProvider logProvider = mock(typeof(LogProvider));
            Log         log         = mock(typeof(Log));

            when(logProvider.GetLog(typeof(NetworkReceiver))).thenReturn(log);
            NetworkReceiver networkReceiver = new NetworkReceiver(mock(typeof(NetworkReceiver.Monitor)), mock(typeof(NetworkReceiver.Configuration)), logProvider);

            // This defines where message is coming from
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.net.InetSocketAddress inetSocketAddress = new java.net.InetSocketAddress("localhost", PORT);
            InetSocketAddress inetSocketAddress = new InetSocketAddress("localhost", PORT);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.netty.channel.Channel channel = mock(org.jboss.netty.channel.Channel.class);
            Channel channel = mock(typeof(Channel));

            when(channel.LocalAddress).thenReturn(inetSocketAddress);
            when(channel.RemoteAddress).thenReturn(inetSocketAddress);

            ChannelHandlerContext ctx = mock(typeof(ChannelHandlerContext));

            when(ctx.Channel).thenReturn(channel);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.cluster.com.message.Message message = org.neo4j.cluster.com.message.Message.to(() -> "test", new java.net.URI("cluster://anywhere"));
            Message message = Message.to(() => "test", new URI("cluster://anywhere"));

            MessageEvent messageEvent = mock(typeof(MessageEvent));

            when(messageEvent.RemoteAddress).thenReturn(inetSocketAddress);
            when(messageEvent.Message).thenReturn(message);
            when(messageEvent.Channel).thenReturn(channel);

            // the original HEADER_FROM header should be ignored
            message.setHeader(Message.HEADER_FROM, "cluster://someplace:1234");

            new Org.Neo4j.cluster.com.NetworkReceiver.MessageReceiver(networkReceiver).messageReceived(ctx, messageEvent);

            assertEquals("HEADER_FROM header should have been changed to visible ip address: " + message.getHeader(Message.HEADER_FROM), "cluster://127.0.0.1:1234", message.getHeader(Message.HEADER_FROM));
        }
Exemple #5
0
 private static PageCache CreatePageCache(FileSystemAbstraction fileSystem, Config config, LogProvider log, PageCacheTracer tracer, PageCursorTracerSupplier cursorTracerSupplier, VersionContextSupplier contextSupplier, JobScheduler jobScheduler)
 {
     return((new ConfiguringPageCacheFactory(fileSystem, config, tracer, cursorTracerSupplier, log.GetLog(typeof(BatchingNeoStores)), contextSupplier, jobScheduler)).OrCreatePageCache);
 }
Exemple #6
0
        internal BackupOutputMonitor(OutsideWorld outsideWorld)
        {
            LogProvider stdOutLogProvider = FormattedLogProvider.toOutputStream(outsideWorld.OutStream());

            _log = stdOutLogProvider.GetLog(typeof(BackupOutputMonitor));
        }