Examples of BatchId


Examples of com.alibaba.jstorm.batch.BatchId

  }

  @Override
  public void execute(Tuple input, BasicOutputCollector collector) {
    BatchId id = (BatchId) input.getValue(0);
    Long value = input.getLong(1);

    AtomicLong counter = counters.get(id);
    if (counter == null) {
      counter = new AtomicLong(0);
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

  @Override
  public void revert(BatchId id, byte[] commitResult) {
    LOG.info("Receive BatchId " + id);
   
    BatchId failedId = (BatchId)Utils.deserialize(commitResult);
   
    if (failedId.equals(id) == false) {
      LOG.info("Deserialized error  " + id);
    }
  }
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

  private int batchSize = 100;
  @Override
  public void execute(Tuple input, BasicOutputCollector collector) {
   
    BatchId batchId = (BatchId)input.getValue(0);
   
    for (int i = 0; i < batchSize; i++) {
      long value = rand.nextInt(10);
      collector.emit(new Values(batchId, value));
    }
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

  }

  public void handlePrepareCommit(Tuple tuple) {
    basicCollector.setContext(tuple);
    try {
      BatchId id = (BatchId) tuple.getValue(0);
      ((IPrepareCommit) delegate).prepareCommit(id, basicCollector);
      collector.ack(tuple);
    } catch (FailedException e) {
      if (e instanceof ReportedFailedException) {
        collector.reportError(e);
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

  public void handlePostCommit(Tuple tuple) {

    basicCollector.setContext(tuple);
    try {
      BatchId id = (BatchId) tuple.getValue(0);
      ((IPostCommit) delegate).postCommit(id, basicCollector);
     
    } catch (Exception e) {
      LOG.info("Failed to do postCommit,", e);
    }
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

    this.batchId = batchId;
    this.batchStatus = batchStatus;
  }
 
  public static BatchSpoutMsgId mkInstance() {
    BatchId batchId = BatchId.mkInstance();
    BatchStatus batchStatus = BatchStatus.COMPUTING;
   
    return new BatchSpoutMsgId(batchId, batchStatus);
  }
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

  }

  @Override
  public void execute(Tuple input, BasicOutputCollector collector) {
    BatchId id = (BatchId) input.getValue(0);

    AtomicLong counter = counters.get(id);
    if (counter == null) {
      counter = new AtomicLong(0);
      counters.put(id, counter);
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

    LOG.info("Successfully do prepare");
  }

  @Override
  public void execute(Tuple input, BasicOutputCollector collector) {
    BatchId id = (BatchId) input.getValue(0);

    long value = rand.nextInt(100);

    collector.emit(new Values(id, value));
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

  }

  @Override
  public void execute(Tuple input, BasicOutputCollector collector) {
    BatchId batchId = (BatchId) input.getValue(0);

    if (input.getSourceComponent().equals(CountBolt.COUNT_BOLT_NAME)) {
      AtomicLong counter = counters.get(batchId);
      if (counter == null) {
        counter = new AtomicLong(0);
View Full Code Here

Examples of com.alibaba.jstorm.batch.BatchId

        metaClient.rebalanceMqList();
      } catch (Exception e) {
        LOG.warn("Failed to do rebalance operation", e);
      }
    }else {
      BatchId batchId = (BatchId) input.getValue(0);

      emitBatch(batchId, collector);
    }
   
  }
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.