Package backtype.storm.generated

Examples of backtype.storm.generated.Bolt


        Map<String, Bolt> boltSpecs = new HashMap<String, Bolt>();
        Map<String, SpoutSpec> spoutSpecs = new HashMap<String, SpoutSpec>();
        for(String boltId: _bolts.keySet()) {
            IRichBolt bolt = _bolts.get(boltId);
            ComponentCommon common = getComponentCommon(boltId, bolt);
            boltSpecs.put(boltId, new Bolt(ComponentObject.serialized_java(Utils.serialize(bolt)), common));
        }
        for(String spoutId: _spouts.keySet()) {
            IRichSpout spout = _spouts.get(spoutId);
            ComponentCommon common = getComponentCommon(spoutId, spout);
            spoutSpecs.put(spoutId, new SpoutSpec(ComponentObject.serialized_java(Utils.serialize(spout)), common));
View Full Code Here


  public static Bolt mkAckerBolt(Map<GlobalStreamId, Grouping> inputs,
      IBolt bolt, HashMap<String, StreamInfo> output, Integer p) {
    ComponentCommon common = mkAckerComponentcommon(inputs, output, p);
    byte[] boltSer = Utils.serialize(bolt);
    ComponentObject component = ComponentObject.serialized_java(boltSer);
    return new Bolt(component, common);
  }
View Full Code Here

                            + " is not a valid component id");
                }
            }
        }
        if (obj instanceof Bolt) {
            Bolt spec = (Bolt) obj;
            for (String id : spec.get_common().get_streams().keySet()) {
                if (system_id(id)) {
                    throw new InvalidTopologyException(id
                            + " is not a valid component id");
                }
            }
View Full Code Here

      outputs.put(ACKER_ACK_STREAM_ID, Thrift.directOutputFields(fields));
      outputs.put(ACKER_FAIL_STREAM_ID, Thrift.directOutputFields(fields));
 
      IBolt ackerbolt= new Acker();
      Map<GlobalStreamId, Grouping> inputs=acker_inputs(ret);
      Bolt acker_bolt = Thrift.mkAckerBolt(inputs, ackerbolt, outputs, num_tasks);
      for (Entry<String, Bolt> e : ret.get_bolts().entrySet()) {
          Bolt bolt = e.getValue();
          ComponentCommon common = bolt.get_common();
          List<String> ackList = StormUtils.mk_list("id", "ack-val");
          common.put_to_streams(ACKER_ACK_STREAM_ID,Thrift.outputFields(ackList));
         
          List<String> failList = StormUtils.mk_list("id");
          common.put_to_streams(ACKER_FAIL_STREAM_ID,Thrift.outputFields(failList));
          bolt.set_common(common);
      }
 
      for (Entry<String, SpoutSpec> kv : ret.get_spouts().entrySet()) {
          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());
View Full Code Here

          SpoutSpec spec = (SpoutSpec) obj;
          common=spec.get_common();
      }
     
      if (obj instanceof Bolt) {
          Bolt spec = (Bolt) obj;
          common=spec.get_common();
      }
     
      if(common!=null)
      {
          StreamInfo sinfo=Thrift.outputFields(sysEventFields);
View Full Code Here

        Map<String, Bolt> boltSpecs = new HashMap<String, Bolt>();
        Map<String, SpoutSpec> spoutSpecs = new HashMap<String, SpoutSpec>();
        for(String boltId: _bolts.keySet()) {
            IRichBolt bolt = _bolts.get(boltId);
            ComponentCommon common = getComponentCommon(boltId, bolt);
            boltSpecs.put(boltId, new Bolt(ComponentObject.serialized_java(Utils.serialize(bolt)), common));
        }
        for(String spoutId: _spouts.keySet()) {
            IRichSpout spout = _spouts.get(spoutId);
            ComponentCommon common = getComponentCommon(spoutId, spout);
            spoutSpecs.put(spoutId, new SpoutSpec(ComponentObject.serialized_java(Utils.serialize(spout)), common));
View Full Code Here

  public static Bolt mkAckerBolt(Map<GlobalStreamId, Grouping> inputs,
      IBolt bolt, HashMap<String, StreamInfo> output, Integer p) {
    ComponentCommon common = mkAckerComponentcommon(inputs, output, p);
    byte[] boltSer = Utils.serialize(bolt);
    ComponentObject component = ComponentObject.serialized_java(boltSer);
    return new Bolt(component, common);
  }
View Full Code Here

    for (String boltId : _bolts.keySet()) {
      IRichBolt bolt = _bolts.get(boltId);
      ComponentCommon common = getComponentCommon(boltId, bolt);
      boltSpecs.put(
          boltId,
          new Bolt(ComponentObject.serialized_java(Utils
              .serialize(bolt)), common));
    }
    for (String spoutId : _spouts.keySet()) {
      IRichSpout spout = _spouts.get(spoutId);
      ComponentCommon common = getComponentCommon(spoutId, spout);
View Full Code Here

          throw new InvalidTopologyException(id
              + " is not a valid component id");
        }
      }
    } else if (obj instanceof Bolt) {
      Bolt spec = (Bolt) obj;
      for (String id : spec.get_common().get_streams().keySet()) {
        if (system_id(id)) {
          throw new InvalidTopologyException(id
              + " is not a valid component id");
        }
      }
View Full Code Here

    // generate inputs
    Map<GlobalStreamId, Grouping> inputs = acker_inputs(ret);

    // generate acker which will be stored in topology
    Bolt acker_bolt = Thrift.mkAckerBolt(inputs, ackerbolt, outputs,
        ackerNum);

    // add every bolt two output stream
    // ACKER_ACK_STREAM_ID/ACKER_FAIL_STREAM_ID
    for (Entry<String, Bolt> e : ret.get_bolts().entrySet()) {

      Bolt bolt = e.getValue();

      ComponentCommon common = bolt.get_common();

      List<String> ackList = JStormUtils.mk_list("id", "ack-val");

      common.put_to_streams(ACKER_ACK_STREAM_ID,
          Thrift.outputFields(ackList));

      List<String> failList = JStormUtils.mk_list("id");
      common.put_to_streams(ACKER_FAIL_STREAM_ID,
          Thrift.outputFields(failList));

      bolt.set_common(common);
    }

    // add every spout output stream ACKER_INIT_STREAM_ID
    // add every spout two intput source
    // ((ACKER_COMPONENT_ID, ACKER_ACK_STREAM_ID), directGrouping)
    // ((ACKER_COMPONENT_ID, ACKER_FAIL_STREAM_ID), directGrouping)
    for (Entry<String, SpoutSpec> kv : ret.get_spouts().entrySet()) {
      SpoutSpec bolt = kv.getValue();
      ComponentCommon common = bolt.get_common();
      List<String> initList = JStormUtils.mk_list("id", "init-val",
          "spout-task");
      common.put_to_streams(ACKER_INIT_STREAM_ID,
          Thrift.outputFields(initList));
View Full Code Here

TOP

Related Classes of backtype.storm.generated.Bolt

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.