001package org.openimaj.picslurper;
002
003import java.util.Map;
004
005import org.openimaj.twitter.collection.StreamJSONStatusList.ReadableWritableJSON;
006
007import backtype.storm.task.TopologyContext;
008import backtype.storm.topology.BasicOutputCollector;
009import backtype.storm.topology.IBasicBolt;
010import backtype.storm.topology.OutputFieldsDeclarer;
011import backtype.storm.tuple.Tuple;
012
013public class PrintBolt implements IBasicBolt {
014
015        /**
016         *
017         */
018        private static final long serialVersionUID = 6446447769256755247L;
019
020        @Override
021        public void declareOutputFields(OutputFieldsDeclarer declarer) {
022                // TODO Auto-generated method stub
023
024        }
025
026        @Override
027        public Map<String, Object> getComponentConfiguration() {
028                // TODO Auto-generated method stub
029                return null;
030        }
031
032        @SuppressWarnings("rawtypes")
033        @Override
034        public void prepare(Map stormConf, TopologyContext context) {
035                // TODO Auto-generated method stub
036
037        }
038
039        @Override
040        public void execute(Tuple input, BasicOutputCollector collector) {
041                ReadableWritableJSON json = (ReadableWritableJSON) input.getValue(0);
042                System.out.println(json.get("text"));
043
044        }
045
046        @Override
047        public void cleanup() {
048                // TODO Auto-generated method stub
049
050        }
051
052}