コード例 #1
0
ファイル: ParseErrorStage.cs プロジェクト: Vanlightly/Logari
 public ParseErrorStage(IErrorParser errorParser,
     IEventDiscarder eventDiscarder,
     IPipelineStage nextStage)
 {
     _errorParser = errorParser;
     _eventDiscarder = eventDiscarder;
     _nextStage = nextStage;
 }
コード例 #2
0
ファイル: PersisterDaemon.cs プロジェクト: Vanlightly/Logari
 public PersisterDaemon(IStreamIngestorConfiguration configuration,
     IEventPersister eventPersister,
     IEventDiscarder eventDiscarder)
 {
     _configuration = configuration;
     _eventPersister = eventPersister;
     _eventDiscarder = eventDiscarder;
     
     _persistQueue = new ConcurrentQueue<ErrorInstanceEntity>();
     _errorDefinitions = new ConcurrentDictionary<string, ErrorDefinitionEntity>();
     _lastPersisted = DateTime.UtcNow;
     _stringCache = new Dictionary<int, string>();
     _fingerprintCache = new Dictionary<int, Fingerprint>();
     _serverCache = new Dictionary<int, string>();
 }
コード例 #3
0
ファイル: BatchLogIngestor.cs プロジェクト: Vanlightly/Logari
        public BatchLogIngestor(IEventFilterFactory eventFilterFactory = null,
            IErrorParser errorParser = null,
            IContentFilterFactory contentFilterFactory = null,
            IEventDiscarder eventDiscarder = null,
            IEventPersister eventPersister = null,
            IEventRejecter eventRejecter = null)
        {
            _eventPersister = eventPersister;
            _eventFilterFactory = eventFilterFactory;
            _eventDiscarder = eventDiscarder;
            _errorParser = errorParser;
            _contentFilterFactory = contentFilterFactory;
            _eventRejecter = eventRejecter;

            _firstPipelineStage = BuildPipeline();
        }
コード例 #4
0
        public StreamLogIngestor(IEventFilterFactory eventFilterFactory,
            IErrorParser errorParser,
            IContentFilterFactory contentFilterFactory,
            IEventDiscarder eventDiscarder,
            IPersisterDaemon persisterDaemon,
            IEventRejecter eventRejecter)
        {
            _eventFilterFactory = eventFilterFactory;
            _eventDiscarder = eventDiscarder;
            _errorParser = errorParser;
            _contentFilterFactory = contentFilterFactory;
            _persisterDaemon = persisterDaemon;
            _eventRejecter = eventRejecter;

            _firstPipelineStage = BuildPipeline();

            _cancellationTokenSource = new CancellationTokenSource();
            _persisterDaemon.Start(_cancellationTokenSource.Token);
        }
コード例 #5
0
 public IBatchIngestorFactoryDescriptor WithDiscarder(IEventDiscarder eventDiscarder)
 {
     _eventDiscarder = eventDiscarder;
     return this;
 }
コード例 #6
0
 public IBatchIngestorFactoryDescriptor WithNullDiscarder()
 {
     _eventDiscarder = new NullEventDiscarder();
     return this;
 }
コード例 #7
0
        public IBatchLogIngestor Build()
        {
            if(_errorParser == null)
                _errorParser = new CustomErrorParser(new CustomParserConfiguration());
            
            if(_contentFilterFactory == null)
                _contentFilterFactory = new ContentFilterFactory();
            
            if(_eventDiscarder == null)
                _eventDiscarder = new NullEventDiscarder();

            if(_eventFilterFactory == null)
                _eventFilterFactory = new EventFilterFactory();

            if(_eventPersister == null)
                _eventPersister = BuildDefaultEventPersister();

            if(_eventRejecter == null)
                _eventRejecter = new NullEventRejecter();

            return new BatchLogIngestor(_eventFilterFactory,
                _errorParser,
                _contentFilterFactory,
                _eventDiscarder,
                _eventPersister,
                _eventRejecter);
        }
コード例 #8
0
 public IStreamIngestorFactoryDescriptor WithDiscarder(Discarders.IEventDiscarder eventDiscarder)
 {
     _eventDiscarder = eventDiscarder;
     return this;
 }
コード例 #9
0
        public IPersisterDaemon BuildDefaultPersisterDaemon(IStreamIngestorConfiguration streamIngestorConfiguration = null, 
            IPersistenceConfiguration persistenceConfiguration = null)
        {
            if(streamIngestorConfiguration == null)
                streamIngestorConfiguration = new StreamIngestorConfiguration();

            if(persistenceConfiguration == null)
                persistenceConfiguration = new PersistenceConfiguration();

            var eventPersister = new EventPersister(persistenceConfiguration,
                new DataExtractor(persistenceConfiguration,
                    new FingerprintReader(persistenceConfiguration),
                    new ServerReader(persistenceConfiguration),
                    new ServerWriter(persistenceConfiguration)),
                new ErrorDefinitionWriter(persistenceConfiguration),
                new TimelineWriter(persistenceConfiguration));

            if (_eventDiscarder == null)
                _eventDiscarder = new NullEventDiscarder();

            return new PersisterDaemon(streamIngestorConfiguration, eventPersister, _eventDiscarder);
        }