/** * Creates a {@code Source<T>} instance from the Avro file(s) at the given path name. * * @param pathName The name of the path to the data on the filesystem * @param ptype The {@code AvroType} for the Avro records * @return A new {@code Source<T>} instance */ public static <T> Source<T> avroFile(String pathName, PType<T> ptype) { return avroFile(new Path(pathName), ptype); }
/** * Creates a {@code Source<GenericData.Record>} by reading the schema of the Avro file * at the given path. If the path is a directory, the schema of a file in the directory * will be used to determine the schema to use. * * @param path The path to the data on the filesystem * @return A new {@code Source<GenericData.Record>} instance */ public static Source<GenericData.Record> avroFile(Path path) { return avroFile(path, new Configuration()); }
/** * Creates a {@code Source<GenericData.Record>} by reading the schema of the Avro file * at the given paths. If the path is a directory, the schema of a file in the directory * will be used to determine the schema to use. * * @param paths A list of paths to the data on the filesystem * @return A new {@code Source<GenericData.Record>} instance */ public static Source<GenericData.Record> avroFile(List<Path> paths) { return avroFile(paths, new Configuration()); }
/** * Creates a {@code Source<T>} instance from the Avro file(s) at the given path name. * * @param pathName The name of the path to the data on the filesystem * @param avroClass The subclass of {@code SpecificRecord} to use for the Avro file * @return A new {@code Source<T>} instance */ public static <T extends SpecificRecord> Source<T> avroFile(String pathName, Class<T> avroClass) { return avroFile(new Path(pathName), avroClass); }
/** * Creates a {@code Source<GenericData.Record>} by reading the schema of the Avro file * at the given path. If the path is a directory, the schema of a file in the directory * will be used to determine the schema to use. * * @param pathName The name of the path to the data on the filesystem * @return A new {@code Source<GenericData.Record>} instance */ public static Source<GenericData.Record> avroFile(String pathName) { return avroFile(new Path(pathName)); }
/** * Creates a {@code Source<T>} instance from the Avro file(s) at the given path name. * * @param pathName The name of the path to the data on the filesystem * @param avroClass The subclass of {@code SpecificRecord} to use for the Avro file * @return A new {@code Source<T>} instance */ public static <T extends SpecificRecord> Source<T> avroFile(String pathName, Class<T> avroClass) { return avroFile(new Path(pathName), avroClass); }
/** * Creates a {@code Source<T>} instance from the Avro file(s) at the given path name. * * @param pathName The name of the path to the data on the filesystem * @param avroType The {@code AvroType} for the Avro records * @return A new {@code Source<T>} instance */ public static <T> Source<T> avroFile(String pathName, AvroType<T> avroType) { return avroFile(new Path(pathName), avroType); }
public static <T> Source<T> avroFile(String pathName, AvroType<T> avroType) { return avroFile(new Path(pathName), avroType); }
/** * Creates a {@code Source<T>} instance from the Avro file(s) at the given {@code Path}. * * @param path The {@code Path} to the data * @param avroClass The subclass of {@code SpecificRecord} to use for the Avro file * @return A new {@code Source<T>} instance */ public static <T extends SpecificRecord> Source<T> avroFile(Path path, Class<T> avroClass) { return avroFile(path, Avros.specifics(avroClass)); }
/** * Creates a {@code Source<T>} instance from the Avro file(s) at the given {@code Path}s. * * @param paths A list of {@code Path}s to the data * @param avroClass The subclass of {@code SpecificRecord} to use for the Avro file * @return A new {@code Source<T>} instance */ public static <T extends SpecificRecord> Source<T> avroFile(List<Path> paths, Class<T> avroClass) { return avroFile(paths, Avros.specifics(avroClass)); }
/** * Creates a {@code Source<T>} instance from the Avro file(s) at the given {@code Path}. * * @param path The {@code Path} to the data * @param avroClass The subclass of {@code SpecificRecord} to use for the Avro file * @return A new {@code Source<T>} instance */ public static <T extends SpecificRecord> Source<T> avroFile(Path path, Class<T> avroClass) { return avroFile(path, Avros.specifics(avroClass)); }
/** * Creates a {@code Source<GenericData.Record>} by reading the schema of the Avro file * at the given paths using the {@code FileSystem} information contained in the given * {@code Configuration} instance. If the first path is a directory, the schema of a file in * the directory will be used to determine the schema to use. * * @param paths The path to the data on the filesystem * @param conf The configuration information * @return A new {@code Source<GenericData.Record>} instance */ public static Source<GenericData.Record> avroFile(List<Path> paths, Configuration conf) { Preconditions.checkArgument(!paths.isEmpty(), "At least one path must be supplied"); return avroFile(paths, Avros.generics(getSchemaFromPath(paths.get(0), conf))); }
/** * Creates a {@code Source<GenericData.Record>} by reading the schema of the Avro file * at the given path using the {@code FileSystem} information contained in the given * {@code Configuration} instance. If the path is a directory, the schema of a file in * the directory will be used to determine the schema to use. * * @param path The path to the data on the filesystem * @param conf The configuration information * @return A new {@code Source<GenericData.Record>} instance */ public static Source<GenericData.Record> avroFile(Path path, Configuration conf) { return avroFile(path, Avros.generics(getSchemaFromPath(path, conf))); }