Package backtype.storm.coordination

Examples of backtype.storm.coordination.CoordinatedBolt$FinishedCallback


        }
        declarer.addConfiguration(Config.TOPOLOGY_TRANSACTIONAL_ID, _id);

        BoltDeclarer emitterDeclarer =
                builder.setBolt(_spoutId,
                        new CoordinatedBolt(new TransactionalSpoutBatchExecutor(_spout),
                                             null,
                                             null),
                        _spoutParallelism)
                .allGrouping(coordinator, TransactionalSpoutCoordinator.TRANSACTION_BATCH_STREAM_ID)
                .addConfiguration(Config.TOPOLOGY_TRANSACTIONAL_ID, _id);
        if(_spout instanceof ICommitterTransactionalSpout) {
            emitterDeclarer.allGrouping(coordinator, TransactionalSpoutCoordinator.TRANSACTION_COMMIT_STREAM_ID);
        }
        for(String id: _bolts.keySet()) {
            Component component = _bolts.get(id);
            Map<String, SourceArgs> coordinatedArgs = new HashMap<String, SourceArgs>();
            for(String c: componentBoltSubscriptions(component)) {
                coordinatedArgs.put(c, SourceArgs.all());
            }
           
            IdStreamSpec idSpec = null;
            if(component.committer) {
                idSpec = IdStreamSpec.makeDetectSpec(coordinator, TransactionalSpoutCoordinator.TRANSACTION_COMMIT_STREAM_ID);         
            }
            BoltDeclarer input = builder.setBolt(id,
                                                  new CoordinatedBolt(component.bolt,
                                                                      coordinatedArgs,
                                                                      idSpec),
                                                  component.parallelism);
            for(Map conf: component.componentConfs) {
                input.addConfigurations(conf);
View Full Code Here


            if(i==_components.size()-1 && component.bolt instanceof FinishedCallback) {
                idSpec = IdStreamSpec.makeDetectSpec(PREPARE_ID, PrepareRequest.ID_STREAM);
            }
            BoltDeclarer declarer = builder.setBolt(
                    boltId(i),
                    new CoordinatedBolt(component.bolt, source, idSpec),
                    component.parallelism);
           
            for(Map conf: component.componentConfs) {
                declarer.addConfigurations(conf);
            }
View Full Code Here

            if(i==_components.size()-1 && component.bolt instanceof FinishedCallback) {
                idSpec = IdStreamSpec.makeDetectSpec(PREPARE_ID, PrepareRequest.ID_STREAM);
            }
            BoltDeclarer declarer = builder.setBolt(
                    boltId(i),
                    new CoordinatedBolt(component.bolt, source, idSpec),
                    component.parallelism);
           
            for(Map conf: component.componentConfs) {
                declarer.addConfigurations(conf);
            }
View Full Code Here

        }
        declarer.addConfiguration(Config.TOPOLOGY_TRANSACTIONAL_ID, _id);

        BoltDeclarer emitterDeclarer =
                builder.setBolt(_spoutId,
                        new CoordinatedBolt(new TransactionalSpoutBatchExecutor(_spout),
                                             null,
                                             null),
                        _spoutParallelism)
                .allGrouping(coordinator, TransactionalSpoutCoordinator.TRANSACTION_BATCH_STREAM_ID)
                .addConfiguration(Config.TOPOLOGY_TRANSACTIONAL_ID, _id);
        if(_spout instanceof ICommitterTransactionalSpout) {
            emitterDeclarer.allGrouping(coordinator, TransactionalSpoutCoordinator.TRANSACTION_COMMIT_STREAM_ID);
        }
        for(String id: _bolts.keySet()) {
            Component component = _bolts.get(id);
            Map<String, SourceArgs> coordinatedArgs = new HashMap<String, SourceArgs>();
            for(String c: componentBoltSubscriptions(component)) {
                coordinatedArgs.put(c, SourceArgs.all());
            }
           
            IdStreamSpec idSpec = null;
            if(component.committer) {
                idSpec = IdStreamSpec.makeDetectSpec(coordinator, TransactionalSpoutCoordinator.TRANSACTION_COMMIT_STREAM_ID);         
            }
            BoltDeclarer input = builder.setBolt(id,
                                                  new CoordinatedBolt(component.bolt,
                                                                      coordinatedArgs,
                                                                      idSpec),
                                                  component.parallelism);
            for(Map conf: component.componentConfs) {
                input.addConfigurations(conf);
View Full Code Here

    declarer.addConfiguration(Config.TOPOLOGY_TRANSACTIONAL_ID, _id);

    BoltDeclarer emitterDeclarer = builder
        .setBolt(
            _spoutId,
            new CoordinatedBolt(
                new TransactionalSpoutBatchExecutor(_spout),
                null, null), _spoutParallelism)
        .allGrouping(
            coordinator,
            TransactionalSpoutCoordinator.TRANSACTION_BATCH_STREAM_ID)
        .addConfiguration(Config.TOPOLOGY_TRANSACTIONAL_ID, _id);
    if (_spout instanceof ICommitterTransactionalSpout) {
      emitterDeclarer.allGrouping(coordinator,
          TransactionalSpoutCoordinator.TRANSACTION_COMMIT_STREAM_ID);
    }
    for (String id : _bolts.keySet()) {
      Component component = _bolts.get(id);
      Map<String, SourceArgs> coordinatedArgs = new HashMap<String, SourceArgs>();
      // get all source component
      for (String c : componentBoltSubscriptions(component)) {
        coordinatedArgs.put(c, SourceArgs.all());
      }

      IdStreamSpec idSpec = null;
      if (component.committer) {
        idSpec = IdStreamSpec
            .makeDetectSpec(
                coordinator,
                TransactionalSpoutCoordinator.TRANSACTION_COMMIT_STREAM_ID);
      }
      BoltDeclarer input = builder.setBolt(id, new CoordinatedBolt(
          component.bolt, coordinatedArgs, idSpec),
          component.parallelism);
      for (Map conf : component.componentConfs) {
        input.addConfigurations(conf);
      }
View Full Code Here

          && component.bolt instanceof FinishedCallback) {
        idSpec = IdStreamSpec.makeDetectSpec(PREPARE_ID,
            PrepareRequest.ID_STREAM);
      }
      BoltDeclarer declarer = builder.setBolt(boltId(i),
          new CoordinatedBolt(component.bolt, source, idSpec),
          component.parallelism);

      for (Map conf : component.componentConfs) {
        declarer.addConfigurations(conf);
      }
View Full Code Here

TOP

Related Classes of backtype.storm.coordination.CoordinatedBolt$FinishedCallback

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.