if (r instanceof RecordEnvelope) { RecordEnvelope<D> recordEnvelope = (RecordEnvelope<D>) r; return new RecordWithForkMap<>(recordEnvelope, forkOperator.forkDataRecord(workUnitState, recordEnvelope.getRecord())); } else if (r instanceof ControlMessage) { return new RecordWithForkMap<D>((ControlMessage<D>) r, branches); } else { throw new IllegalStateException("Expected RecordEnvelope or ControlMessage.");
public RecordWithForkMap(RecordEnvelope<D> record, List<Boolean> forkMap) { this.record = record; this.forkMap = Lists.newArrayList(forkMap); this.mustCopy = mustCopy(forkMap); this.copiesLeft = this.forkMap.stream().filter(x -> x).count(); this.cloner = buildForkCloner(); }
if (r instanceof RecordEnvelope) { RecordEnvelope<D> recordEnvelope = (RecordEnvelope<D>) r; return new RecordWithForkMap<>(recordEnvelope, forkOperator.forkDataRecord(workUnitState, recordEnvelope.getRecord())); } else if (r instanceof ControlMessage) { return new RecordWithForkMap<D>((ControlMessage<D>) r, branches); } else { throw new IllegalStateException("Expected RecordEnvelope or ControlMessage.");
public RecordWithForkMap(ControlMessage<D> record, int activeBranchesForRecord) { this.record = record; this.forkMap = null; this.copiesLeft = activeBranchesForRecord; this.mustCopy = this.copiesLeft > 1; this.cloner = buildForkCloner(); }
public RecordWithForkMap(RecordEnvelope<D> record, List<Boolean> forkMap) { this.record = record; this.forkMap = Lists.newArrayList(forkMap); this.mustCopy = mustCopy(forkMap); this.copiesLeft = this.forkMap.stream().filter(x -> x).count(); this.cloner = buildForkCloner(); }
@Override public boolean test(RecordWithForkMap<D> dRecordWithForkMap) { return dRecordWithForkMap.sendToBranch(this.forkIdx); } }
@Override public boolean test(RecordWithForkMap<D> dRecordWithForkMap) { return dRecordWithForkMap.sendToBranch(this.forkIdx); } }
public RecordWithForkMap(ControlMessage<D> record, int activeBranchesForRecord) { this.record = record; this.forkMap = null; this.copiesLeft = activeBranchesForRecord; this.mustCopy = this.copiesLeft > 1; this.cloner = buildForkCloner(); }