Beispiel #1
0
 public LogToElasticsearch(IElasticLowLevelClient es) : base(async(logBatch) =>
 {
     var multiJson = logBatch.ToEsMultiJson();
     //let _ = Write(multiJson)
     var bulkRequest           = PostData.String(multiJson);
     var bulkRequestParameters = new BulkRequestParameters
     {
         // todo
     };
     var bulkResponse = await es.BulkAsync <StringResponse>(bulkRequest, bulkRequestParameters);
     return(bulkResponse);
 })
 {
 }
Beispiel #2
0
 public StoreToElasticsearch(IElasticLowLevelClient es, string indexName = "terraform") : base(async(request) =>
 {
     var logBatch  = JObject.FromObject(request.Data, AlteredJson.DefaultJsonSerializer);
     var multiJson = logBatch.ToEsMultiJson(indexName);
     //let _ = Write(multiJson)
     var bulkRequest           = PostData.String(multiJson);
     var bulkRequestParameters = new BulkRequestParameters
     {
         // todo
     };
     var bulkResponse = await es.BulkAsync <StringResponse>(bulkRequest, bulkRequestParameters);
     return(bulkResponse);
 })
 {
 }
Beispiel #3
0
 public TaskMetaProcessor(ILog logger,
                          RtqElasticsearchIndexerSettings settings,
                          IRtqElasticsearchClient elasticClient,
                          RemoteTaskQueue remoteTaskQueue,
                          RtqMonitoringPerfGraphiteReporter perfGraphiteReporter)
 {
     this.logger              = logger.ForContext(nameof(TaskMetaProcessor));
     this.settings            = settings;
     handleTasksMetaStorage   = remoteTaskQueue.HandleTasksMetaStorage;
     taskDataRegistry         = remoteTaskQueue.TaskDataRegistry;
     taskDataStorage          = remoteTaskQueue.TaskDataStorage;
     taskExceptionInfoStorage = remoteTaskQueue.TaskExceptionInfoStorage;
     serializer = remoteTaskQueue.Serializer;
     this.perfGraphiteReporter = perfGraphiteReporter;
     this.elasticClient        = elasticClient;
     bulkRequestTimeout        = new BulkRequestParameters
     {
         Timeout = this.settings.BulkIndexRequestTimeout,
         RequestConfiguration = new RequestConfiguration {
             RequestTimeout = this.settings.BulkIndexRequestTimeout
         }
     };
 }
Beispiel #4
0
 ///<summary>Default list of fields to extract and return from the _source field, can be overridden on each sub-request</summary>
 internal static BulkRequestParameters _SourceInclude <T>(this BulkRequestParameters qs, IEnumerable <Expression <Func <T, object> > > source_include) where T : class =>
 qs.AddQueryString("_source_include", source_include.Select(e => (Field)e));
Beispiel #5
0
 ///<summary>Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request</summary>
 internal static BulkRequestParameters _Fields <T>(this BulkRequestParameters qs, IEnumerable <Expression <Func <T, object> > > fields) where T : class =>
 qs.AddQueryString("fields", fields.Select(e => (Field)e));