@Test public void newStatusWithNewIngestSingleBuilder() { Status orig = StatusUtil.fileCreated(100); Status status = StatusUtil.replicatedAndIngested(builder, 10, 20); Status ret = combiner.typedReduce(key, Arrays.asList(orig, status).iterator()); assertEquals(10L, ret.getBegin()); assertEquals(20L, ret.getEnd()); assertEquals(100L, ret.getCreatedTime()); assertFalse(ret.getClosed()); }
@Override public Status typedReduce(Key key, Iterator<Status> iter) { Builder combined = null; while (iter.hasNext()) { Status status = iter.next(); if (combined == null) { if (iter.hasNext()) { combined = Status.newBuilder(); } else { if (log.isTraceEnabled()) { log.trace("Returned single value: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(status)); } return status; } } combine(combined, status); } if (log.isTraceEnabled()) { log.trace("Combined: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(combined.build())); } return combined.build(); }
StatusCombiner extends TypedValueCombiner<Status> { @Override public Status typedReduce(Key key, Iterator<Status> iter) { Builder combined = null; while (iter.hasNext()) { Status status = iter.next(); if (combined == null) { if (iter.hasNext()) { combined = Status.newBuilder(); } else { if (log.isTraceEnabled()) { log.trace("Returned single value: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(status)); } return status; } } combine(combined, status); } if (log.isTraceEnabled()) { log.trace("Combined: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(combined.build())); } return combined.build(); } }
StatusCombiner extends TypedValueCombiner<Status> { @Override public Status typedReduce(Key key, Iterator<Status> iter) { Builder combined = null; while (iter.hasNext()) { Status status = iter.next(); if (combined == null) { if (iter.hasNext()) { combined = Status.newBuilder(); } else { if (log.isTraceEnabled()) { log.trace("Returned single value: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(status)); } return status; } } combine(combined, status); } if (log.isTraceEnabled()) { log.trace("Combined: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(combined.build())); } return combined.build(); }  }
StatusCombiner extends TypedValueCombiner<Status> { @Override public Status typedReduce(Key key, Iterator<Status> iter) { Builder combined = null; while (iter.hasNext()) { Status status = iter.next(); if (combined == null) { if (iter.hasNext()) { combined = Status.newBuilder(); } else { if (log.isTraceEnabled()) { log.trace("Returned single value: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(status)); } return status; } } combine(combined, status); } if (log.isTraceEnabled()) { log.trace("Combined: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(combined.build())); } return combined.build(); }  @Override IteratorOptions describeOptions(); @Override boolean validateOptions(Map<String,String> options); @Override void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options,
      IteratorEnvironment env); @Override Status typedReduce(Key key, Iterator<Status> iter); void combine(Builder combined, Status status); }
StatusCombiner extends TypedValueCombiner<Status> { @Override public Status typedReduce(Key key, Iterator<Status> iter) { Builder combined = null; while (iter.hasNext()) { Status status = iter.next(); if (combined == null) { if (iter.hasNext()) { combined = Status.newBuilder(); } else { if (log.isTraceEnabled()) { log.trace("Returned single value: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(status)); } return status; } } combine(combined, status); } if (log.isTraceEnabled()) { log.trace("Combined: {} {}", key.toStringNoTruncate(), ProtobufUtil.toString(combined.build())); } return combined.build(); }  @Override IteratorOptions describeOptions(); @Override boolean validateOptions(Map<String,String> options); @Override void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options,
      IteratorEnvironment env); @Override Status typedReduce(Key key, Iterator<Status> iter); void combine(Builder combined, Status status);  }