Examples of GlobalStreamId


Examples of backtype.storm.generated.GlobalStreamId

        public BoltDeclarer directGrouping(String componentId, String streamId) {
            return grouping(componentId, streamId, Grouping.direct(new NullStruct()));
        }

        private BoltDeclarer grouping(String componentId, String streamId, Grouping grouping) {
            _commons.get(_boltId).put_to_inputs(new GlobalStreamId(componentId, streamId), grouping);
            return this;
        }
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

                //  TimeWindow takes one of the following: ":all-time", "600" (10mins), "10800" (3h), "86400" (1d)             
                            
                Map<GlobalStreamId, Long> executedMapAllTime = getNumTuplesBolt(execSummary);
                //let's sum up all the executed tuples during the entire execution for all the streams separately
                for (Map.Entry<GlobalStreamId, Long> entry : executedMapAllTime.entrySet()) {
                  GlobalStreamId streamId = entry.getKey();
                  long executedTuples = entry.getValue();
                  double execLatency = getBoltLatency(execSummary).get(streamId);

                  //adding to the collection
                  TuplesInfo ti = new TuplesInfo(executedTuples, execLatency);
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

  }

  @Override
  public void execute(Tuple tuple) {
    List<Object> id = tuple.select(_idFields);
    GlobalStreamId streamId = new GlobalStreamId(tuple.getSourceComponent(), tuple.getSourceStreamId());
    if (!_pending.containsKey(id)) {
      _pending.put(id, new HashMap<GlobalStreamId, Tuple>());
    }
    Map<GlobalStreamId, Tuple> parts = _pending.get(id);
    if (parts.containsKey(streamId))
      throw new RuntimeException("Received same side of single join twice");
    parts.put(streamId, tuple);
    if (parts.size() == _numSources) {
      _pending.remove(id);
      List<Object> joinResult = new ArrayList<Object>();
      for (String outField : _outFields) {
        GlobalStreamId loc = _fieldLocations.get(outField);
        joinResult.add(parts.get(loc).getValueByField(outField));
      }
      _collector.emit(new ArrayList<Tuple>(parts.values()), joinResult);

      for (Tuple part : parts.values()) {
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

   
    /**
     * Returns the global stream id (component + stream) of this tuple.
     */
    public GlobalStreamId getSourceGlobalStreamid() {
        return new GlobalStreamId(getSourceComponent(), streamId);
    }
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

        stream, stats_rate(stats) * amt);
  }

  public static void bolt_acked_tuple(BoltTaskStatsRolling stats,
      String component, String stream, Long latency_ms) {
    GlobalStreamId key = new GlobalStreamId(component, stream);
    update_task_stat(stats, StormUtils.mk_arr("acked"), key,
        stats_rate(stats));
    update_task_stat(stats, StormUtils.mk_arr("process_latencies"), key,
        latency_ms);
  }
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

        latency_ms);
  }

  public static void bolt_failed_tuple(BoltTaskStatsRolling stats,
      String component, String stream, Long latency_ms) {
    GlobalStreamId key = new GlobalStreamId(component, stream);
    update_task_stat(stats, StormUtils.mk_arr("failed"), key,
        stats_rate(stats));
  }
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

      Map<String, SpoutSpec> spout_ids = topology.get_spouts();
 
      Map<GlobalStreamId, Grouping> spout_inputs = new HashMap<GlobalStreamId, Grouping>();
      for (Entry<String, SpoutSpec> spout : spout_ids.entrySet()) {
          String id = spout.getKey();
          GlobalStreamId stream = new GlobalStreamId(id, ACKER_INIT_STREAM_ID);
          Grouping group = Thrift.mkFieldsGrouping(StormUtils.mk_list("id"));
          spout_inputs.put(stream, group);
      }
 
      Map<GlobalStreamId, Grouping> bolt_inputs = new HashMap<GlobalStreamId, Grouping>();
      for (Entry<String, Bolt> bolt : bolt_ids.entrySet()) {
          String id = bolt.getKey();
 
          GlobalStreamId streamAck = new GlobalStreamId(id,
                  ACKER_ACK_STREAM_ID);
          Grouping groupAck = Thrift.mkFieldsGrouping(StormUtils
                  .mk_list("id"));
 
          GlobalStreamId streamFail = new GlobalStreamId(id,
                  ACKER_FAIL_STREAM_ID);
          Grouping groupFail = Thrift.mkFieldsGrouping(StormUtils
                  .mk_list("id"));
 
          bolt_inputs.put(streamAck, groupAck);
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

          SpoutSpec bolt = kv.getValue();
          ComponentCommon common = bolt.get_common();
          List<String> initList = StormUtils.mk_list("id", "init-val", "spout-task");
          common.put_to_streams(ACKER_INIT_STREAM_ID,Thrift.outputFields(initList));
         
          GlobalStreamId ack_ack=new GlobalStreamId(ACKER_COMPONENT_ID, ACKER_ACK_STREAM_ID);
          common.put_to_inputs(ack_ack, Thrift.mkDirectGrouping());
         
          GlobalStreamId ack_fail=new GlobalStreamId(ACKER_COMPONENT_ID,ACKER_FAIL_STREAM_ID);
          common.put_to_inputs(ack_fail,Thrift.mkDirectGrouping());
      }
 
      ret.put_to_bolts("__acker", acker_bolt);
  }
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

        public static IdStreamSpec makeDetectSpec(String component, String stream) {
            return new IdStreamSpec(component, stream);
        }       
       
        protected IdStreamSpec(String component, String stream) {
            _id = new GlobalStreamId(component, stream);
        }
View Full Code Here

Examples of backtype.storm.generated.GlobalStreamId

  }

  @Override
  public void execute(Tuple tuple) {
    List<Object> id = tuple.select(_idFields);
    GlobalStreamId streamId = new GlobalStreamId(tuple.getSourceComponent(), tuple.getSourceStreamId());
    if (!_pending.containsKey(id)) {
      _pending.put(id, new HashMap<GlobalStreamId, Tuple>());
    }
    Map<GlobalStreamId, Tuple> parts = _pending.get(id);
    if (parts.containsKey(streamId))
      throw new RuntimeException("Received same side of single join twice");
    parts.put(streamId, tuple);
    if (parts.size() == _numSources) {
      _pending.remove(id);
      List<Object> joinResult = new ArrayList<Object>();
      for (String outField : _outFields) {
        GlobalStreamId loc = _fieldLocations.get(outField);
        joinResult.add(parts.get(loc).getValueByField(outField));
      }
      _collector.emit(new ArrayList<Tuple>(parts.values()), joinResult);

      for (Tuple part : parts.values()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.