Beispiel #1
0
 @Override
 public void mergeAccumulator(BoundedHeap<T, ComparatorT> accumulator) {
   for (T value : accumulator.asList()) {
     if (!maybeAddInput(value)) {
       // If this element of accumulator does not make the top N, neither
       // will the rest, which are all smaller.
       break;
     }
   }
 }
Beispiel #2
0
 @Override
 public void registerByteSizeObserver(
     BoundedHeap<T, ComparatorT> value, ElementByteSizeObserver observer, Context context)
     throws Exception {
   listCoder.registerByteSizeObserver(value.asList(), observer, context);
 }
Beispiel #3
0
 @Override
 public boolean isRegisterByteSizeObserverCheap(
     BoundedHeap<T, ComparatorT> value, Context context) {
   return listCoder.isRegisterByteSizeObserverCheap(value.asList(), context);
 }
Beispiel #4
0
 @Override
 public void encode(BoundedHeap<T, ComparatorT> value, OutputStream outStream, Context context)
     throws CoderException, IOException {
   listCoder.encode(value.asList(), outStream, context);
 }