java.lang.Object
org.apache.storm.topology.base.BaseComponent
org.apache.storm.topology.base.BaseRichSpout
All Implemented Interfaces:
Serializable, org.apache.storm.spout.ISpout, org.apache.storm.topology.IComponent, org.apache.storm.topology.IRichSpout, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse>
Direct Known Subclasses:
HybridSpout

public class AggregationSpout extends AbstractSpout implements org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse>
Spout which pulls URL from an ES index. Use a single instance unless you use 'es.status.routing' with the StatusUpdaterBolt, in which case you need to have exactly the same number of spout instances as ES shards. Guarantees a good mix of URLs by aggregating them by an arbitrary field e.g. key.
See Also:
  • Field Details

    • currentBuckets

      protected Set<String> currentBuckets
  • Constructor Details

    • AggregationSpout

      public AggregationSpout()
  • Method Details

    • open

      public void open(Map<String,Object> stormConf, org.apache.storm.task.TopologyContext context, org.apache.storm.spout.SpoutOutputCollector collector)
      Specified by:
      open in interface org.apache.storm.spout.ISpout
      Overrides:
      open in class AbstractSpout
    • populateBuffer

      protected void populateBuffer()
      Description copied from class: AbstractSpout
      Builds a query and use it retrieve the results from OS *
      Specified by:
      populateBuffer in class AbstractSpout
    • onFailure

      public void onFailure(Exception arg0)
      Specified by:
      onFailure in interface org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse>
    • onResponse

      public void onResponse(org.opensearch.action.search.SearchResponse response)
      Specified by:
      onResponse in interface org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse>
    • sortValuesForKey

      protected void sortValuesForKey(String key, Object[] sortValues)