Examples of MapFunction


Examples of com.google.wave.api.Function.MapFunction

    String url = "http://www.test.com/image.png";
    blip.append(new Image(url, 100, 100, "Cool pix."));
    assertEquals(2, blip.getElements().size());

    // Update the image by appending a query param to the URL.
    blip.first(ElementType.IMAGE).updateElement(new MapFunction() {
      @Override
      public Map<String, String> call(BlipContent source) {
        Image matchedImage = (Image) source;
        Map<String, String> properties = new HashMap<String, String>();
        properties.put("url", matchedImage.getUrl() + "?version=newversion");
View Full Code Here

Examples of com.google.wave.api.Function.MapFunction

    String url = "http://www.test.com/image.png";
    blip.append(new Image(url, 100, 100, "Cool pix."));
    assertEquals(2, blip.getElements().size());

    // Update the image by appending a query param to the URL.
    blip.first(ElementType.IMAGE).updateElement(new MapFunction() {
      @Override
      public Map<String, String> call(BlipContent source) {
        Image matchedImage = (Image) source;
        Map<String, String> properties = new HashMap<String, String>();
        properties.put("url", matchedImage.getUrl() + "?version=newversion");
View Full Code Here

Examples of eu.stratosphere.api.java.functions.MapFunction

  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  @Test
  public void testFunctionWithMissingGenerics() {
    MapFunction function = new MapFunction() {
      private static final long serialVersionUID = 1L;

      @Override
      public String map(Object value) throws Exception {
        return null;
View Full Code Here

Examples of org.apache.crunch.impl.spark.fn.MapFunction

          if (t instanceof MapReduceTarget) { //TODO: check this earlier
            Converter c = t.getConverter(ptype);
            JavaPairRDD<?, ?> outRDD;
            if (rdd instanceof JavaRDD) {
              outRDD = ((JavaRDD) rdd)
                  .map(new MapFunction(ptype.getOutputMapFn(), ctxt))
                  .map(new OutputConverterFunction(c));
            } else {
              outRDD = ((JavaPairRDD) rdd)
                  .map(new PairMapFunction(ptype.getOutputMapFn(), ctxt))
                  .map(new OutputConverterFunction(c));
View Full Code Here

Examples of org.apache.crunch.impl.spark.fn.MapFunction

          converter.getValueClass());
      input.rdd().setName(source.toString());
      MapFn mapFn = converter.applyPTypeTransforms() ? source.getType().getInputMapFn() : IdentityFn.getInstance();
      return input
          .map(new InputConverterFunction(source.getConverter()))
          .map(new MapFunction(mapFn, runtime.getRuntimeContext()));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of org.apache.crunch.impl.spark.fn.MapFunction

            Converter c = t.getConverter(ptype);
            IdentityFn ident = IdentityFn.getInstance();
            JavaPairRDD<?, ?> outRDD;
            if (rdd instanceof JavaRDD) {
              outRDD = ((JavaRDD) rdd)
                  .map(new MapFunction(c.applyPTypeTransforms() ? ptype.getOutputMapFn() : ident, ctxt))
                  .mapToPair(new OutputConverterFunction(c));
            } else {
              outRDD = ((JavaPairRDD) rdd)
                  .map(new PairMapFunction(c.applyPTypeTransforms() ? ptype.getOutputMapFn() : ident, ctxt))
                  .mapToPair(new OutputConverterFunction(c));
View Full Code Here

Examples of org.apache.crunch.impl.spark.fn.MapFunction

          if (t instanceof MapReduceTarget) { //TODO: check this earlier
            Converter c = t.getConverter(ptype);
            JavaPairRDD<?, ?> outRDD;
            if (rdd instanceof JavaRDD) {
              outRDD = ((JavaRDD) rdd)
                  .map(new MapFunction(ptype.getOutputMapFn(), ctxt))
                  .map(new OutputConverterFunction(c));
            } else {
              outRDD = ((JavaPairRDD) rdd)
                  .map(new PairMapFunction(ptype.getOutputMapFn(), ctxt))
                  .map(new OutputConverterFunction(c));
View Full Code Here

Examples of org.apache.crunch.impl.spark.fn.MapFunction

          source.getConverter().getKeyClass(),
          source.getConverter().getValueClass());
      input.rdd().setName(source.toString());
      return input
          .map(new InputConverterFunction(source.getConverter()))
          .map(new MapFunction(source.getType().getInputMapFn(), runtime.getRuntimeContext()));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of org.apache.crunch.impl.spark.fn.MapFunction

          if (t instanceof MapReduceTarget) { //TODO: check this earlier
            Converter c = t.getConverter(ptype);
            JavaPairRDD<?, ?> outRDD;
            if (rdd instanceof JavaRDD) {
              outRDD = ((JavaRDD) rdd)
                  .map(new MapFunction(ptype.getOutputMapFn(), ctxt))
                  .map(new OutputConverterFunction(c));
            } else {
              outRDD = ((JavaPairRDD) rdd)
                  .map(new PairMapFunction(ptype.getOutputMapFn(), ctxt))
                  .map(new OutputConverterFunction(c));
View Full Code Here

Examples of org.apache.crunch.impl.spark.fn.MapFunction

          source.getConverter().getKeyClass(),
          source.getConverter().getValueClass());
      input.rdd().setName(source.toString());
      return input
          .map(new InputConverterFunction(source.getConverter()))
          .map(new MapFunction(source.getType().getInputMapFn(), runtime.getRuntimeContext()));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
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.