Package org.apache.crunch.types

Examples of org.apache.crunch.types.Converter


    return this;
  }

  @Override
  public void configureForMapReduce(Job job, PType<?> ptype, Path outputPath, String name) {
    Converter converter = ptype.getConverter();
    Class keyClass = converter.getKeyClass();
    Class valueClass = converter.getValueClass();
    configureForMapReduce(job, keyClass, valueClass, formatBundle, outputPath, name);
  }
View Full Code Here


  }
 
  private void writeSequenceFileFromPCollection(final FileSystem fs, final Path path,
      final PCollection collection) throws IOException {
    final PType pType = collection.getPType();
    final Converter converter = pType.getConverter();
    final Class valueClass = converter.getValueClass();

    final SequenceFile.Writer writer = new SequenceFile.Writer(fs, fs.getConf(), path,
        NullWritable.class, valueClass);

    for (final Object o : collection.materialize()) {
View Full Code Here

    this.fileNamingScheme = fileNamingScheme;
  }

  @Override
  public void configureForMapReduce(Job job, PType<?> ptype, Path outputPath, String name) {
    Converter converter = ptype.getConverter();
    Class keyClass = converter.getKeyClass();
    Class valueClass = converter.getValueClass();
    configureForMapReduce(job, keyClass, valueClass, outputFormatClass, outputPath, name);
  }
View Full Code Here

    return "Text(" + path + ")";
  }

  @Override
  public void configureForMapReduce(Job job, PType<?> ptype, Path outputPath, String name) {
    Converter converter = ptype.getConverter();
    Class keyClass = converter.getKeyClass();
    Class valueClass = converter.getValueClass();
    configureForMapReduce(job, keyClass, valueClass, getOutputFormat(ptype), outputPath, name);
  }
View Full Code Here

    this.fileNamingScheme = fileNamingScheme;
  }

  @Override
  public void configureForMapReduce(Job job, PType<?> ptype, Path outputPath, String name) {
    Converter converter = ptype.getConverter();
    Class keyClass = converter.getKeyClass();
    Class valueClass = converter.getValueClass();
    configureForMapReduce(job, keyClass, valueClass, outputFormatClass, outputPath, name);
  }
View Full Code Here

    return "Text(" + path + ")";
  }

  @Override
  public void configureForMapReduce(Job job, PType<?> ptype, Path outputPath, String name) {
    Converter converter = ptype.getConverter();
    Class keyClass = converter.getKeyClass();
    Class valueClass = converter.getValueClass();
    configureForMapReduce(job, keyClass, valueClass, getOutputFormat(ptype), outputPath, name);
  }
View Full Code Here

    DoFn<?, ?> fn = ptype.getOutputMapFn();
    return new DoNode(fn, name, ptype, NO_CHILDREN, ptype.getGroupingConverter(), null);
  }

  public static <S> DoNode createOutputNode(String name, PType<S> ptype) {
    Converter outputConverter = ptype.getConverter();
    DoFn<?, ?> fn = ptype.getOutputMapFn();
    return new DoNode(fn, name, ptype, NO_CHILDREN, outputConverter, null);
  }
View Full Code Here

    fn.configure(conf);
    for (DoNode child : children) {
      childRTNodes.add(child.toRTNode(false, conf, nodeContext));
    }

    Converter inputConverter = null;
    if (inputNode) {
      if (nodeContext == NodeContext.MAP) {
        inputConverter = ptype.getConverter();
      } else {
        inputConverter = ((PGroupedTableType<?, ?>) ptype).getGroupingConverter();
View Full Code Here

  @SuppressWarnings("unchecked")
  public void configureForMapReduce(Job job, PType<?> ptype, Path outputPath, String name) {

    Preconditions.checkNotNull(name, "Output name should not be null"); // see CRUNCH-82

    Converter converter = getConverter(ptype);
    Class<?> keyClass = converter.getKeyClass();
    Class<?> valueClass = Void.class;

    CrunchOutputs.addNamedOutput(job, name, formatBundle, keyClass, valueClass);
    job.setOutputFormatClass(formatBundle.getFormatClass());
    formatBundle.configure(job.getConfiguration());
View Full Code Here

    DoFn<?, ?> fn = ptype.getOutputMapFn();
    return new DoNode(fn, name, ptype, NO_CHILDREN, ptype.getGroupingConverter(), null);
  }

  public static <S> DoNode createOutputNode(String name, PType<S> ptype) {
    Converter outputConverter = ptype.getConverter();
    DoFn<?, ?> fn = ptype.getOutputMapFn();
    return new DoNode(fn, name, ptype, NO_CHILDREN, outputConverter, null);
  }
View Full Code Here

TOP

Related Classes of org.apache.crunch.types.Converter

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.