Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Beyond Hadoop - Checking other options

Avatar for Marcin Cylke Marcin Cylke
November 29, 2012

Beyond Hadoop - Checking other options

Avatar for Marcin Cylke

Marcin Cylke

November 29, 2012
Tweet

Other Decks in Technology

Transcript

  1. Tap sourceTap = new Hfs(inputScheme, inputPath); Tap sinkTap = new

    Hfs(outputScheme, outputPath); Pipe wcPipe = new Each("wordcount", new Fields("line"), new RegexSplitGenerator(new Fields("word"), "s+"), new Fields("word")); wcPipe = new GroupBy(wcPipe, new Fields("word")); wcPipe = new Every(wcPipe, new Count(), new Fields("count", "word"));
  2. Tap sourceTap = new Hfs(inputScheme, inputPath); Tap sinkTap = new

    Hfs(outputScheme, outputPath); Pipe wcPipe = new Each("wordcount", new Fields("line"), new RegexSplitGenerator(new Fields("word"), "s+"), new Fields("word")); wcPipe = new GroupBy(wcPipe, new Fields("word")); wcPipe = new Every(wcPipe, new Count(), new Fields("count", "word"));
  3. private boolean isSource() { return (getVertexId().get() == getContext().getConfiguration().getLong(SOURCE_ID, SOURCE_ID_DEFAULT)); }

    @Override public void compute(Iterator<DoubleWritable> msgIterator) { if (getSuperstep() == 0) { setVertexValue( new DoubleWritable( Double.MAX_VALUE)); } double minDist = isSource() ? 0d : Double.MAX_VALUE; while (msgIterator.hasNext()) { minDist = Math.min(minDist, msgIterator.next().get()); } if (LOG.isDebugEnabled()) { LOG.debug( "Vertex " + getVertexId() + " got minDist = " + minDist + " vertex value = " + getVertexValue()); } if (minDist < getVertexValue().get()) { setVertexValue( new DoubleWritable(minDist)); for (Edge<LongWritable, FloatWritable> edge : getOutEdgeMap().values()) { LOG.debug( "Vertex " + getVertexId() + " sent to " + edge.getDestVertexId() + " = " + (minDist + edge.getEdgeValue().get())); sendMsg(edge.getDestVertexId(), new DoubleWritable(minDist + edge.getEdgeValue().get())); } } voteToHalt();
  4. Rynny, rygle • storm-kafka • storm-hbase • storm-rdbms • storm-jms

    • storm-cassandra • storm-state - write your own hbase! • storm-ml
  5. public interface ISpout { void open(Map map, TopologyContext topologyContext, SpoutOutputCollector

    spoutOutputCollector); void close(); void activate(); void deactivate(); void nextTuple(); void ack(Object o); void fail(Object o); }
  6. public class ExclIntegerShortSpout extends BaseRichSpout { public void nextTuple() {

    .... } public void declareOutputFields (OutputFieldsDeclarer declarer) { .... } }
  7. public interface IBolt extends { void prepare(Map map, TopologyContext topologyContext,

    OutputCollector outputCollector); void execute(Tuple tuple); void cleanup(); }
  8. public class ExclamationBolt extends BaseRichBolt { public void prepare(Map map,

    TopologyContext topologyContext, OutputCollector outputCollector) { .... } public void execute(Tuple tuple) { .... } public void declareOutputFields (OutputFieldsDeclarer outputFieldsDeclarer) { .... } }