Package backtype.storm.spout

Examples of backtype.storm.spout.SpoutOutputCollector


                throw new UnsupportedOperationException("Default operation");
            }
        }, statusPath.toFile(), new File(homeDir.toFile(), "topic-1"), Pattern.compile("[0-9a-f]*"));

        final List<List<Object>> tuples = Lists.newArrayList();
        SpoutOutputCollector collector = new SpoutOutputCollector(null) {
            @Override
            public List<Integer> emit(List<Object> tuple) {
                tuples.add(tuple);
                return null;
            }
View Full Code Here


  // ����collector,ʵ�����ǵ���send_spout_msg
  this.output_collector = new SpoutCollector(task_id,spout,task_stats,sendTargets,storm_conf,_transfer_fn,pending,topology_context,event_queue);

  LOG.info("Opening spout " + component_id + ":" + task_id);
  this.spout.open(storm_conf, user_context, new SpoutOutputCollector(output_collector));
  LOG.info("Opend spout " + component_id + ":" + task_id);
 
  this.isRecvRun=new AtomicBoolean();
    }
View Full Code Here

        _trackId = trackId;
    }

    public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
        _tracker = new SpoutTrackOutputCollector(collector);
        _delegate.open(conf, context, new SpoutOutputCollector(_tracker));
    }
View Full Code Here

        _coordStream = TridentBoltExecutor.COORD_STREAM(batchGroup);
    }
   
    @Override
    public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
        _delegate.open(conf, context, new SpoutOutputCollector(new StreamOverrideCollector(collector)));
        _outputTasks = new ArrayList<Integer>();
        for(String component: Utils.get(context.getThisTargets(),
                                        _coordStream,
                                        new HashMap<String, Grouping>()).keySet()) {
            _outputTasks.addAll(context.getComponentTasks(component));
View Full Code Here

    @Ignore("This test never finishes.")
    public void testConnectionSpout() throws Exception {
        MockOutputCollector outputCollector = new MockOutputCollector();
        ConnectionSpout spout = new ConnectionSpout();

        spout.open(null, null, new SpoutOutputCollector(outputCollector));

        long connectionCount = spout.getQueue().size();
        boolean complete = false;
        int calls = 0;
View Full Code Here

    public void testEventSpoutWithDate() throws Exception {
        MockOutputCollector outputCollector = new MockOutputCollector();
        final Date lastEventDate = new Date(System.currentTimeMillis() - 10000); // 10s ago
        EventSpout spout = new EventSpout(lastEventDate);

        spout.open(null, null, new SpoutOutputCollector(outputCollector));

        Assert.assertEquals(0,
                            Collections2.filter(spout.getQueue(), new Predicate<BasicDBObject>() {
            @Override
            public boolean apply(BasicDBObject basicDBObject) {
View Full Code Here

//        List<Event> allEvents = new ArrayList<Event>();
        MockOutputCollector outputCollector = new MockOutputCollector();
        EventSpout spout = new EventSpout();
        List<BasicDBObject> allRawEvents = new ArrayList<>();

        spout.open(null, null, new SpoutOutputCollector(outputCollector));

        // Add all events
        allRawEvents.addAll(spout.getQueue());

        // Filter out any events in the raw events after the last event date in the
View Full Code Here

        _coordStream = TridentBoltExecutor.COORD_STREAM(batchGroup);
    }
   
    @Override
    public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
        _delegate.open(conf, context, new SpoutOutputCollector(new StreamOverrideCollector(collector)));
        _outputTasks = new ArrayList<Integer>();
        for(String component: Utils.get(context.getThisTargets(),
                                        _coordStream,
                                        new HashMap<String, Grouping>()).keySet()) {
            _outputTasks.addAll(context.getComponentTasks(component));
View Full Code Here

                fail(txid);
            }
           
            _collector.reset(collector);
            if(!prepared) {
                _spout.open(_conf, _context, new SpoutOutputCollector(_collector));
                prepared = true;
            }
            for(int i=0; i<_maxBatchSize; i++) {
                _spout.nextTuple();
                if(_collector.numEmitted < i) {
View Full Code Here

        _trackId = trackId;
    }

    public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
        _tracker = new SpoutTrackOutputCollector(collector);
        _delegate.open(conf, context, new SpoutOutputCollector(_tracker));
    }
View Full Code Here

TOP

Related Classes of backtype.storm.spout.SpoutOutputCollector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.