/** * Creates a {@code Target} at the given path name that writes data to * SequenceFiles. * * @param pathName The name of the path to write the data to on the filesystem * @return A new {@code Target} instance */ public static Target sequenceFile(String pathName) { return sequenceFile(new Path(pathName)); }
/** * Creates a {@code Target} at the given path name that writes data to * text files. * * @param pathName The name of the path to write the data to on the filesystem * @return A new {@code Target} instance */ public static Target textFile(String pathName) { return textFile(new Path(pathName)); }
/** * Creates a {@code Target} at the given path name that writes data to * Avro files. The {@code PType} for the written data must be for Avro records. * * @param pathName The name of the path to write the data to on the filesystem * @return A new {@code Target} instance */ public static Target avroFile(String pathName) { return avroFile(new Path(pathName)); }
/** * Creates a {@code Target} at the given path name that writes data to * a custom {@code FileOutputFormat}. * * @param pathName The name of the path to write the data to on the filesystem * @param formatClass The {@code FileOutputFormat<K, V>} to write the data to * @return A new {@code Target} instance */ public static <K extends Writable, V extends Writable> Target formattedFile( String pathName, Class<? extends FileOutputFormat<K, V>> formatClass) { return formattedFile(new Path(pathName), formatClass); }
/** * Creates a {@code Target} at the given path name that writes data to * a custom {@code FileOutputFormat}. * * @param pathName The name of the path to write the data to on the filesystem * @param formatClass The {@code FileOutputFormat<K, V>} to write the data to * @return A new {@code Target} instance */ public static <K extends Writable, V extends Writable> Target formattedFile( String pathName, Class<? extends FileOutputFormat<K, V>> formatClass) { return formattedFile(new Path(pathName), formatClass); }
/** * Creates a {@code Target} at the given path name that writes data to * text files. * * @param pathName The name of the path to write the data to on the filesystem * @return A new {@code Target} instance */ public static Target textFile(String pathName) { return textFile(new Path(pathName)); }
/** * Creates a {@code Target} at the given path name that writes data to * SequenceFiles. * * @param pathName The name of the path to write the data to on the filesystem * @return A new {@code Target} instance */ public static Target sequenceFile(String pathName) { return sequenceFile(new Path(pathName)); }
public static Target formattedFile(String pathName, Class<? extends FileOutputFormat> formatClass) { return formattedFile(new Path(pathName), formatClass); }
/** * Creates a {@code Target} at the given path name that writes data to * Avro files. The {@code PType} for the written data must be for Avro records. * * @param pathName The name of the path to write the data to on the filesystem * @return A new {@code Target} instance */ public static Target avroFile(String pathName) { return avroFile(new Path(pathName)); }
public static Target textFile(String pathName) { return textFile(new Path(pathName)); }
public static Target sequenceFile(String pathName) { return sequenceFile(new Path(pathName)); }
public static Target avroFile(String pathName) { return avroFile(new Path(pathName)); }
@Override public <T> void writeTextFile(PCollection<T> pcollection, String pathName) { pcollection.parallelDo("asText", new StringifyFn<T>(), Writables.strings()) .write(To.textFile(pathName)); }
result.write(To.sequenceFile(cmdLine.getOptionValue("output")));
@Override public <T> void writeTextFile(PCollection<T> pcollection, String pathName) { pcollection.parallelDo("asText", new StringifyFn<T>(), Writables.strings()) .write(To.textFile(pathName)); }
emitter.emit(sb.toString()); }, Writables.strings()).write(To.textFile(args[1]));