Package com.google.appengine.api.files.FileServicePb

Examples of com.google.appengine.api.files.FileServicePb.KeyValues


            }
          });
    }

    @Override public KeyValue<K, ReducerInput<V>> next() {
      KeyValues proto = readProto();
      if (proto == null) {
        throw new NoSuchElementException();
      }
      K key;
      try {
        key = keyMarshaller.fromBytes(proto.getKey().asReadOnlyByteBuffer());
      } catch (IOException e) {
        // TODO(ohler): abort mapreduce
        throw new RuntimeException(
            this + ": " + keyMarshaller + " failed to parse key from " + proto, e);
      }
      return KeyValue.of(key,
          ReducerInputs.fromIterator(
              Iterators.concat(makeIterator(proto),
                  proto.getPartial()
                  ? Iterators.concat(new IteratorIterator(proto.getKey()))
                  : Iterators.<V>emptyIterator())));
    }
View Full Code Here


      @Override protected Iterator<V> computeNext() {
        if (!previousWasPartial) {
          return endOfData();
        }
        KeyValues proto = readProto();
        Preconditions.checkState(proto != null,
            "%s: Unexpected EOF, previous KeyValues was partial; key=%s", this, expectedKey);
        Preconditions.checkState(expectedKey.equals(proto.getKey()),
            "%s: Expected key %s, got %s", this, expectedKey, proto.getKey());
        previousWasPartial = proto.getPartial();
        return makeIterator(proto);
      }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.files.FileServicePb.KeyValues

Copyright © 2018 www.massapicom. 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.