Examples of OutgoingMessageEnvelope


Examples of org.apache.samza.system.OutgoingMessageEnvelope

    iter.close();
    if(count == expectedKeys + 1) {
      out.println("Epoch " + currentEpoch + " is complete.");
      int nextEpoch = Integer.parseInt(currentEpoch) + 1;
      for(int i = 0; i < numPartitions; i++)
        collector.send(new OutgoingMessageEnvelope(new SystemStream("kafka", "epoch"), i, Integer.toString(nextEpoch)));
    } else if(count > expectedKeys + 1) {
      throw new IllegalStateException("Got " + count + " keys, which is more than the expected " + (expectedKeys + 1));
    } else {
      out.println("Only found " + count + " valid keys, try again later.");
    }
View Full Code Here

Examples of org.apache.samza.system.OutgoingMessageEnvelope

      resetEpoch();
      return;
    }
    int counter = getInt(COUNT);
    if(counter < max) {
      OutgoingMessageEnvelope envelope = new OutgoingMessageEnvelope(new SystemStream("kafka", "emitted"), Integer.toString(counter), epoch + "-" + taskName);
      collector.send(envelope);
      this.state.put(COUNT, Integer.toString(getInt(COUNT) + 1));
    } else {
      trySleep(100);
    }
View Full Code Here

Examples of org.apache.samza.system.OutgoingMessageEnvelope

      partitions.partitions.clear();
      partitions.partitions.add(partition);
    } else {
      partitions.partitions.add(partition);
      if(partitions.partitions.size() == expected)
        collector.send(new OutgoingMessageEnvelope(new SystemStream("kafka", "completed-keys"), key, Integer.toString(epoch)));
    }
    this.store.put(key, partitions.toString());
  }
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.