Ejemplo n.º 1
0
        public MasterClientResolver(LogProvider logProvider, ResponseUnpacker responseUnpacker, InvalidEpochExceptionHandler invalidEpochHandler, int readTimeoutMillis, int lockReadTimeout, int channels, int chunkSize, System.Func <LogEntryReader <ReadableClosablePositionAwareChannel> > logEntryReader)
        {
            this._logEntryReader      = logEntryReader;
            this._log                 = logProvider.getLog(this.GetType());
            this._responseUnpacker    = responseUnpacker;
            this._invalidEpochHandler = invalidEpochHandler;

            _protocolToFactoryMapping = new Dictionary <ProtocolVersion, MasterClientFactory>(3, 1);
            _protocolToFactoryMapping[MasterClient214.PROTOCOL_VERSION] = new F214(this, logProvider, readTimeoutMillis, lockReadTimeout, channels, chunkSize);
            _protocolToFactoryMapping[MasterClient310.PROTOCOL_VERSION] = new F310(this, logProvider, readTimeoutMillis, lockReadTimeout, channels, chunkSize);
            _protocolToFactoryMapping[MasterClient320.PROTOCOL_VERSION] = new F320(this, logProvider, readTimeoutMillis, lockReadTimeout, channels, chunkSize);
        }
Ejemplo n.º 2
0
        private volatile BinaryLatch _shutdownLatch;          // Store under synchronised(this), load in update puller thread

        internal SlaveUpdatePuller(RequestContextFactory requestContextFactory, Master master, LastUpdateTime lastUpdateTime, LogProvider logging, InstanceId instanceId, AvailabilityGuard availabilityGuard, InvalidEpochExceptionHandler invalidEpochHandler, JobScheduler jobScheduler, Monitor monitor)
        {
            this._requestContextFactory = requestContextFactory;
            this._master                   = master;
            this._lastUpdateTime           = lastUpdateTime;
            this._instanceId               = instanceId;
            this._availabilityGuard        = availabilityGuard;
            this._invalidEpochHandler      = invalidEpochHandler;
            this._jobScheduler             = jobScheduler;
            this._monitor                  = monitor;
            this._logger                   = logging.getLog(this.GetType());
            this._invalidEpochCappedLogger = (new CappedLogger(_logger)).setCountLimit(LogCap);
            this._comExceptionCappedLogger = (new CappedLogger(_logger)).setCountLimit(LogCap);
        }