Examples of KeyValues


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

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

      @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

Examples of kilim.http.KeyValues

                        PrintWriter pw = new PrintWriter(resp.getOutputStream());
                        // Note that resp.getOutputStream() does not write to the socket; it merely buffers the entire
                        // output.
                        pw.append("<html><body>path = ");
                        pw.append(req.uriPath).append("<p>");
                        KeyValues kvs = req.getQueryComponents();
                        for (int i = 0; i < kvs.count; i++) {
                            pw.append(kvs.keys[i]).append(" = ").append(kvs.values[i]).append("<br>");
                        }
                        pw.append("</body></html>");
                        pw.flush();
View Full Code Here

Examples of webit.script.lang.KeyValues

        if (this.inits != null) {
            final Out out = new DiscardOut();
            final GlobalManager myGlobalManager = this.globalManager;
            final Bag globalBag = myGlobalManager.getGlobalBag();
            final Bag constBag = myGlobalManager.getGlobalBag();
            final KeyValues params = KeyValuesUtil.wrap(
                    new String[]{"GLOBAL", "CONST"},
                    new Object[]{globalBag, constBag}
            );
            for (String templateName : StringUtil.toArray(this.inits)) {
                if (this.logger.isInfoEnabled()) {
View Full Code Here

Examples of webit.script.lang.KeyValues

    @SuppressWarnings("unchecked")
    protected Map<String, Object> mergeTemplate(final Context context, boolean export) {
        final Object templateName;
        if ((templateName = templateNameExpr.execute(context)) != null) {
            final KeyValues params;
            final Object paramsObject;
            if (paramsExpr != null
                    && (paramsObject = paramsExpr.execute(context)) != null) {
                if (paramsObject instanceof Map) {
                    params = KeyValuesUtil.wrap((Map) paramsObject);
                } else {
                    throw new ScriptRuntimeException("Template param must be a Map.", paramsExpr);
                }
            } else {
                params = KeyValuesUtil.EMPTY_KEY_VALUES;
            }
            final Template preTemplate = context.template;
            final KeyValues preRootParams = context.rootParams;
            final Object[] preVars = context.vars;
            final VariantIndexer[] preIndexers = context.indexers;
            final int preIndexer = context.indexer;
            try {
                Template template = engine.getTemplate(myTemplateName, String.valueOf(templateName));
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.