• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RollingCountBolt类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中storm.starter.bolt.RollingCountBolt的典型用法代码示例。如果您正苦于以下问题:Java RollingCountBolt类的具体用法?Java RollingCountBolt怎么用?Java RollingCountBolt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

RollingCountBolt类属于storm.starter.bolt包,在下文中一共展示了RollingCountBolt类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: wireTopology

点赞 3

import storm.starter.bolt.RollingCountBolt; //导入依赖的package包/类
private void wireTopology() {
	
	String fileName = "data/Earthquakes-Spain-2013.ttl";
	String spoutId = "rdfStreamSpout";
	String triple2graph = "triple2graph";
	String graphCounter = "graphCounter";
	String finalCounter = "finalCounter";
	
	// TODO: Get the triple pattern from the configuration/context 
	SimpleSelector startingPattern = new SimpleSelector(null, 
			ResourceFactory.createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
			ResourceFactory.createResource("http://purl.oclc.org/NET/ssnx/ssn#FeatureOfInterest"));
	
	builder.setSpout(spoutId, new RDFStreamSpout(fileName));
	builder.setBolt(triple2graph, new Triple2GraphBolt(STARTING_PATTERN_ID)).shuffleGrouping(spoutId);
	builder.setBolt(graphCounter, new RollingCountBolt(15, 3)).fieldsGrouping(triple2graph, new Fields("name"));
	builder.setBolt(finalCounter, new AckerPrinterBolt()).globalGrouping(graphCounter);
}
 

开发者ID:allaves,
项目名称:storm-query-operators,
代码行数:19,
代码来源:GraphCounterTopology.java

示例2: wireTopology

点赞 2

import storm.starter.bolt.RollingCountBolt; //导入依赖的package包/类
private void wireTopology() throws InterruptedException {
  String spoutId = "wordGenerator";
  String counterId = "counter";
  String intermediateRankerId = "intermediateRanker";
  String totalRankerId = "finalRanker";
  builder.setSpout(spoutId, new TestWordSpout(), 5);
  builder.setBolt(counterId, new RollingCountBolt(9, 3), 4).fieldsGrouping(spoutId, new Fields("word"));
  builder.setBolt(intermediateRankerId, new IntermediateRankingsBolt(TOP_N), 4).fieldsGrouping(counterId, new Fields(
      "obj"));
  builder.setBolt(totalRankerId, new TotalRankingsBolt(TOP_N)).globalGrouping(intermediateRankerId);
}
 

开发者ID:luozhaoyu,
项目名称:big-data-system,
代码行数:12,
代码来源:RollingTopWords.java

示例3: wireTopology

点赞 2

import storm.starter.bolt.RollingCountBolt; //导入依赖的package包/类
private void wireTopology() throws InterruptedException {
    String spoutId = "wordGenerator";
    String counterId = "counter";
    String intermediateRankerId = "intermediateRanker";
    String totalRankerId = "finalRanker";
    builder.setSpout(spoutId, new TestWordSpout(), 5);
    builder.setBolt(counterId, new RollingCountBolt(9, 3), 4).fieldsGrouping(spoutId, new Fields("word"));
    builder.setBolt(intermediateRankerId, new IntermediateRankingsBolt(TOP_N), 4).fieldsGrouping(counterId,
        new Fields("obj"));
    builder.setBolt(totalRankerId, new TotalRankingsBolt(TOP_N)).globalGrouping(intermediateRankerId);
}
 

开发者ID:adarshms,
项目名称:sentweet,
代码行数:12,
代码来源:RollingTopWords.java

示例4: wireTopology

点赞 2

import storm.starter.bolt.RollingCountBolt; //导入依赖的package包/类
private void wireTopology() throws InterruptedException {
    builder.setSpout("twitterSpout", new TwitterSampleSpout());
    builder.setBolt("extractHashTags", new ExtractHashTagsBolt(), 8).setNumTasks(32).shuffleGrouping("twitterSpout");
    builder.setBolt("counter", new RollingCountBolt(300, 5), 8).setNumTasks(32).fieldsGrouping("extractHashTags", new Fields("hashtag"));
    builder.setBolt("intermediateRanker", new IntermediateRankingsBolt(TOP_N), 2).setNumTasks(8).fieldsGrouping("counter", new Fields("obj"));
    builder.setBolt("finalRanker", new TotalRankingsBolt(TOP_N, 5)).globalGrouping("intermediateRanker");
    builder.setBolt("rankPoster", new PostRankingsBolt()).shuffleGrouping("finalRanker");
}
 

开发者ID:adarshms,
项目名称:sentweet,
代码行数:9,
代码来源:SentweetTopology.java

示例5: wireTopology

点赞 2

import storm.starter.bolt.RollingCountBolt; //导入依赖的package包/类
private void wireTopology() throws InterruptedException {
    builder.setSpout("twitterSpout", new TwitterSampleSpout());
    builder.setBolt("extractHashTags", new ExtractHashTagsBolt(), 2).shuffleGrouping("twitterSpout");
    builder.setBolt("counter", new RollingCountBolt(300, 5), 4).fieldsGrouping("extractHashTags", new Fields("hashtag"));
    builder.setBolt("intermediateRanker", new IntermediateRankingsBolt(TOP_N), 4).fieldsGrouping("counter", new Fields("obj"));
    builder.setBolt("finalRanker", new TotalRankingsBolt(TOP_N, 5)).globalGrouping("intermediateRanker");
    builder.setBolt("rankPoster", new PostRankingsBolt()).shuffleGrouping("finalRanker");
}
 

开发者ID:adarshms,
项目名称:sentweet,
代码行数:9,
代码来源:SentweetLocal.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)