Class SamplingService

java.lang.Object
org.elasticsearch.ingest.SamplingService
All Implemented Interfaces:
ClusterStateListener

public class SamplingService extends Object implements ClusterStateListener
  • Constructor Details

  • Method Details

    • maybeSample

      public void maybeSample(ProjectMetadata projectMetadata, IndexRequest indexRequest)
      Potentially samples the given indexRequest, depending on the existing sampling configuration.
      Parameters:
      projectMetadata - Used to get the sampling configuration
      indexRequest - The raw request to potentially sample
    • maybeSample

      public void maybeSample(ProjectMetadata projectMetadata, String indexName, Supplier<IndexRequest> indexRequestSupplier, IngestDocument ingestDocument)
      Parameters:
      projectMetadata - Used to get the sampling configuration
      indexRequestSupplier - A supplier for the raw request to potentially sample
      ingestDocument - The IngestDocument used for evaluating any conditionals that are part of the sample configuration
    • atLeastOneSampleConfigured

      public boolean atLeastOneSampleConfigured()
    • clusterChanged

      public void clusterChanged(ClusterChangedEvent event)
      Description copied from interface: ClusterStateListener
      Called when cluster state changes.

      Cluster states are applied one-by-one which means they can be a performance bottleneck. Implementations of this method should therefore be fast, so please consider forking work into the background rather than doing everything inline.

      Specified by:
      clusterChanged in interface ClusterStateListener