Tabnine Logo
Stream.aggregate
Code IndexAdd Tabnine to your IDE (free)

How to use
aggregate
method
in
storm.trident.Stream

Best Java code snippets using storm.trident.Stream.aggregate (Showing top 20 results out of 315)

origin: alibaba/jstorm

public Stream aggregate(CombinerAggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}
origin: alibaba/jstorm

public Stream aggregate(ReducerAggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}
origin: alibaba/jstorm

public Stream aggregate(Aggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}
origin: alibaba/jstorm

public static StormTopology buildTopology(LocalDRPC drpc) {
  TridentTopology topology = new TridentTopology();
  TridentState urlToTweeters = topology.newStaticState(new StaticSingleKeyMapState.Factory(TWEETERS_DB));
  TridentState tweetersToFollowers = topology.newStaticState(new StaticSingleKeyMapState.Factory(FOLLOWERS_DB));
  
  topology.newDRPCStream("reach", drpc)
      .stateQuery(urlToTweeters, new Fields("args"), new MapGet(), new Fields("tweeters"))
      .each(new Fields("tweeters"), new ExpandList(), new Fields("tweeter")).shuffle()
      .stateQuery(tweetersToFollowers, new Fields("tweeter"), new MapGet(), new Fields("followers"))
      .each(new Fields("followers"), new ExpandList(), new Fields("follower")).groupBy(new Fields("follower"))
      .aggregate(new One(), new Fields("one")).aggregate(new Fields("one"), new Sum(), new Fields("reach"));
  return topology.build();
}

origin: alibaba/jstorm

public static StormTopology buildTopology(LocalDRPC drpc) {
  FixedBatchSpout spout = new FixedBatchSpout(new Fields("word"), 3, new Values("the cow jumped over the moon"),
      new Values("the man went to the store and bought some candy"),
      new Values("four score and seven years ago"), new Values("how many apples can you eat"),
      new Values("to be or not to be the person"));
  spout.setCycle(true);
  
  TridentTopology topology = new TridentTopology();
  TridentState wordCounts = topology.newStream("spout1", spout).parallelismHint(16).flatMap(split).map(toUpper)
      .filter(theFilter).peek(new Consumer() {
        @Override
        public void accept(TridentTuple input) {
          System.out.println(input.getString(0));
        }
      }).groupBy(new Fields("word"))
      .persistentAggregate(new MemoryMapState.Factory(), new Count(), new Fields("count"))
      .parallelismHint(16);
      
  topology.newDRPCStream("words", drpc).flatMap(split).groupBy(new Fields("args"))
      .stateQuery(wordCounts, new Fields("args"), new MapGet(), new Fields("count")).filter(new FilterNull())
      .aggregate(new Fields("count"), new Sum(), new Fields("sum"));
  return topology.build();
}

origin: alibaba/jstorm

public static StormTopology buildTopology(LocalDRPC drpc) {
  FixedBatchSpout spout = new FixedBatchSpout(new Fields("sentence"), 3,
      new Values("the cow jumped over the moon"),
      new Values("the man went to the store and bought some candy"),
      new Values("four score and seven years ago"), new Values("how many apples can you eat"),
      new Values("to be or not to be the person"));
  spout.setCycle(true);
  
  TridentTopology topology = new TridentTopology();
  TridentState wordCounts = topology.newStream("spout1", spout).parallelismHint(16)
      .each(new Fields("sentence"), new Split(), new Fields("word")).groupBy(new Fields("word"))
      .persistentAggregate(new MemoryMapState.Factory(), new Count(), new Fields("count"))
      .parallelismHint(16);
      
  topology.newDRPCStream("words", drpc).each(new Fields("args"), new Split(), new Fields("word"))
      .groupBy(new Fields("word"))
      .stateQuery(wordCounts, new Fields("word"), new MapGet(), new Fields("count"))
      .each(new Fields("count"), new FilterNull())
      .aggregate(new Fields("count"), new Sum(), new Fields("sum"));
  return topology.build();
}

origin: com.alibaba.jstorm/jstorm-core

public Stream aggregate(ReducerAggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}
origin: com.n3twork.storm/storm-core

public Stream aggregate(ReducerAggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}
origin: com.alibaba.jstorm/jstorm-core

public Stream aggregate(CombinerAggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}
origin: com.n3twork.storm/storm-core

public Stream aggregate(Aggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}

origin: com.n3twork.storm/storm-core

public Stream aggregate(CombinerAggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}
origin: com.alibaba.jstorm/jstorm-core

public Stream aggregate(Aggregator agg, Fields functionFields) {
  return aggregate(null, agg, functionFields);
}
origin: pereferrera/trident-hackaton

public static StormTopology buildTopology(LocalDRPC drpc) throws IOException {
  FakeTweetsBatchSpout spout = new FakeTweetsBatchSpout(100);
  TridentTopology topology = new TridentTopology();
  topology.newStream("spout", spout)
    .aggregate(new Fields("location"), new LocationAggregator(), new Fields("location_counts"))
    .each(new Fields("location_counts"), new Utils.PrintFilter());
  
  return topology.build();
}
origin: lmco/streamflow

      combinerAggregator, new Fields(outputFields));
} else {
  stream = stream.aggregate(
      combinerAggregator, new Fields(outputFields));
      new Fields(inputFields), combinerAggregator, new Fields(outputFields));
} else {
  stream = stream.aggregate(
      new Fields(inputFields), combinerAggregator, new Fields(outputFields));
      reducerAggregator, new Fields(outputFields));
} else {
  stream = stream.aggregate(
      reducerAggregator, new Fields(outputFields));
      new Fields(inputFields), reducerAggregator, new Fields(outputFields));
} else {
  stream = stream.aggregate(
      new Fields(inputFields), reducerAggregator, new Fields(outputFields));
      aggregator, new Fields(outputFields));
} else {
  stream = stream.aggregate(
      aggregator, new Fields(outputFields));
      new Fields(inputFields), aggregator, new Fields(outputFields));
} else {
  stream = stream.aggregate(
      new Fields(inputFields), aggregator, new Fields(outputFields));
origin: wurstmeister/storm-kafka-0.8-plus-test

public StormTopology buildTopology(LocalDRPC drpc) {
  TridentKafkaConfig kafkaConfig = new TridentKafkaConfig(brokerHosts, "storm-sentence", "storm");
  kafkaConfig.scheme = new SchemeAsMultiScheme(new StringScheme());
  TransactionalTridentKafkaSpout kafkaSpout = new TransactionalTridentKafkaSpout(kafkaConfig);
  TridentTopology topology = new TridentTopology();
  TridentState wordCounts = topology.newStream("kafka", kafkaSpout).shuffle().
      each(new Fields("str"), new WordSplit(), new Fields("word")).
      groupBy(new Fields("word")).
      persistentAggregate(new HazelCastStateFactory(), new Count(), new Fields("aggregates_words")).parallelismHint(2);
  topology.newDRPCStream("words", drpc)
      .each(new Fields("args"), new Split(), new Fields("word"))
      .groupBy(new Fields("word"))
      .stateQuery(wordCounts, new Fields("word"), new MapGet(), new Fields("count"))
      .each(new Fields("count"), new FilterNull())
      .aggregate(new Fields("count"), new Sum(), new Fields("sum"));
  return topology.build();
}
origin: eshioji/trident-tutorial

public static StormTopology buildTopology(TransactionalTridentKafkaSpout spout) throws IOException {
  TridentTopology topology = new TridentTopology();
  TridentState count =
  topology
      .newStream("tweets", spout)
      .each(new Fields("str"), new ParseTweet(), new Fields("text", "content", "user"))
      .project(new Fields("content", "user"))
      .each(new Fields("content"), new OnlyHashtags())
      .each(new Fields("user"), new OnlyEnglish())
      .each(new Fields("content", "user"), new ExtractFollowerClassAndContentName(), new Fields("followerClass", "contentName"))
      .groupBy(new Fields("followerClass", "contentName"))
      .persistentAggregate(new MemoryMapState.Factory(), new Count(), new Fields("count"))
  ;
  topology
      .newDRPCStream("top_hashtags")
      .stateQuery(count, new TupleCollectionGet(), new Fields("followerClass", "contentName"))
      .stateQuery(count, new Fields("followerClass", "contentName"), new MapGet(), new Fields("count"))
      .aggregate(new Fields("contentName", "count"), new FirstN.FirstNSortedAgg(5,"count", true), new Fields("contentName", "count"))
  ;
  return topology.build();
}
origin: eshioji/trident-tutorial

.stateQuery(countState, new Fields("actor"), new MapGet(), new Fields("individual_count"))
.each(new Fields("individual_count"), new FilterNull())
.aggregate(new Fields("individual_count"), new Sum(), new Fields("count"));
origin: kstyrc/trident-redis

public static StormTopology buildTopology(LocalDRPC drpc, StateFactory state) {
  FixedBatchSpout spout = new FixedBatchSpout(new Fields("sentence"), 3,
      new Values("the cow jumped over the moon"), 
      new Values("the man went to the store and bought some candy"),
      new Values("four score and seven years ago"), 
      new Values("how many apples can you eat"), 
      new Values("to be or not to be the person"));
  spout.setCycle(true);
  TridentTopology topology = new TridentTopology();
  TridentState wordCounts = topology.newStream("spout1", spout)
      .each(new Fields("sentence"), new Split(), new Fields("word"))
      .groupBy(new Fields("word"))
      .persistentAggregate(state, new Count(), new Fields("count"))
      .parallelismHint(6);
  topology.newDRPCStream("words", drpc)
      .each(new Fields("args"), new Split(), new Fields("word"))
      .groupBy(new Fields("word"))
      .stateQuery(wordCounts, new Fields("word"), new MapGet(),
          new Fields("count"))
      .each(new Fields("count"), new FilterNull())
      .aggregate(new Fields("count"), new Sum(), new Fields("sum"));
  return topology.build();
}
origin: eshioji/trident-tutorial

.aggregate(new Fields("location"), new StringCounter(), new Fields("aggregated_result"))
.parallelismHint(3)
origin: pereferrera/trident-hackaton

.aggregate(new Fields("location"), new LocationAggregator(), new Fields("aggregated_result"))
.parallelismHint(5).each(new Fields("aggregated_result"), new Utils.PrintFilter());
storm.tridentStreamaggregate

Popular methods of Stream

  • each
  • groupBy
    ## Grouping Operation
  • project
    Filters out fields from a stream, resulting in a Stream containing only the fields specified by `kee
  • partitionBy
    ## Repartitioning Operation
  • shuffle
    ## Repartitioning Operation Use random round robin algorithm to evenly redistribute tuples across al
  • stateQuery
  • parallelismHint
    Applies a parallelism hint to a stream.
  • partitionAggregate
  • partitionPersist
  • global
    ## Repartitioning Operation All tuples are sent to the same partition. The same partition is chosen
  • batchGlobal
    ## Repartitioning Operation All tuples in the batch are sent to the same partition. Different batche
  • chainedAgg
  • batchGlobal,
  • chainedAgg,
  • <init>,
  • broadcast,
  • getOutputFields,
  • name,
  • partition,
  • persistentAggregate,
  • projectionValidation

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JTextField (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now