Beispiel #1
0
 public CheckPointerImpl(TransactionIdStore transactionIdStore, CheckPointThreshold threshold, StorageEngine storageEngine, LogPruning logPruning, TransactionAppender appender, DatabaseHealth databaseHealth, LogProvider logProvider, CheckPointTracer tracer, IOLimiter ioLimiter, StoreCopyCheckPointMutex mutex)
 {
     this._appender           = appender;
     this._transactionIdStore = transactionIdStore;
     this._threshold          = threshold;
     this._storageEngine      = storageEngine;
     this._logPruning         = logPruning;
     this._databaseHealth     = databaseHealth;
     this._ioLimiter          = ioLimiter;
     this._msgLog             = logProvider.GetLog(typeof(CheckPointerImpl));
     this._tracer             = tracer;
     this._mutex = mutex;
 }
Beispiel #2
0
        /// <summary>
        /// Create a Tracers subsystem with the desired implementation, if it can be found and created.
        ///
        /// Otherwise the default implementation is used, and a warning is logged to the given StringLogger. </summary>
        /// <param name="desiredImplementationName"> The name of the desired {@link org.neo4j.kernel.monitoring.tracing
        /// .TracerFactory} implementation, as given by its <seealso cref="TracerFactory.getImplementationName()"/> method. </param>
        /// <param name="msgLog"> A <seealso cref="Log"/> for logging when the desired implementation cannot be created. </param>
        /// <param name="monitors"> the monitoring manager </param>
        /// <param name="jobScheduler"> a scheduler for async jobs </param>
        public Tracers(string desiredImplementationName, Log msgLog, Monitors monitors, JobScheduler jobScheduler, SystemNanoClock clock)
        {
            if ("null".Equals(desiredImplementationName, StringComparison.OrdinalIgnoreCase))
            {
                PageCursorTracerSupplier = DefaultPageCursorTracerSupplier.NULL;
                PageCacheTracer          = PageCacheTracer.NULL;
                TransactionTracer        = Org.Neo4j.Kernel.impl.transaction.tracing.TransactionTracer_Fields.Null;
                CheckPointTracer         = Org.Neo4j.Kernel.impl.transaction.tracing.CheckPointTracer_Fields.Null;
                LockTracer = LockTracer.NONE;
            }
            else
            {
                TracerFactory foundFactory = new DefaultTracerFactory();
                bool          found        = string.ReferenceEquals(desiredImplementationName, null);
                foreach (TracerFactory factory in Service.load(typeof(TracerFactory)))
                {
                    try
                    {
                        if (factory.ImplementationName.Equals(desiredImplementationName, StringComparison.OrdinalIgnoreCase))
                        {
                            foundFactory = factory;
                            found        = true;
                            break;
                        }
                    }
                    catch (Exception e)
                    {
                        msgLog.Warn("Failed to instantiate desired tracer implementations '" + desiredImplementationName + "'", e);
                    }
                }

                if (!found)
                {
                    msgLog.Warn("Using default tracer implementations instead of '%s'", desiredImplementationName);
                }

                PageCursorTracerSupplier = foundFactory.CreatePageCursorTracerSupplier(monitors, jobScheduler);
                PageCacheTracer          = foundFactory.CreatePageCacheTracer(monitors, jobScheduler, clock, msgLog);
                TransactionTracer        = foundFactory.CreateTransactionTracer(monitors, jobScheduler);
                CheckPointTracer         = foundFactory.CreateCheckPointTracer(monitors, jobScheduler);
                LockTracer = foundFactory.CreateLockTracer(monitors, jobScheduler);
            }
        }