/** * Get the input file(s) containing the URLs * * @return the input paths * @throws IOException */ public Path[] getInputPaths() throws IOException { return SequenceFileUtility.getFilePaths(input, "part"); }
/** * @param paths * @return all the file starting with "part" in the paths requested * @throws IOException */ public static Path[] getInputPaths(String[] paths) throws IOException { return SequenceFileUtility.getFilePaths(paths, "part"); }
/** * All the files starting with "part" in the paths which look like: "paths[i]/subdir * @param paths * @param subdir * @return the paths to the part files * @throws IOException */ public static Path[] getInputPaths(String[] paths, String subdir) throws IOException { return SequenceFileUtility.getFilePaths(paths, subdir, "part"); }
/** * All the files starting with "part" in the paths which look like: "paths[i]/subdir * @param paths * @param subdir * @return the paths to the part files * @throws IOException */ public static Path[] getInputPaths(String[] paths, String subdir) throws IOException { return SequenceFileUtility.getFilePaths(paths, subdir, "part"); }
/** * @param paths * @return all the file starting with "part" in the paths requested * @throws IOException */ public static Path[] getInputPaths(String[] paths) throws IOException { return SequenceFileUtility.getFilePaths(paths, "part"); }
/** * Get the input paths from a String. This will resolve the path string * and return either a {@link Path} object representing the string * or, if the path string is a directory, a list of {@link Path}s * representing all the "part" files. * * @param path the path string * @return the paths * @throws IOException */ public static Path[] getInputPaths(String path) throws IOException { return SequenceFileUtility.getFilePaths(path, "part"); }
/** * Get the input paths from a String. This will resolve the path string * and return either a {@link Path} object representing the string * or, if the path string is a directory, a list of {@link Path}s * representing all the "part" files. * * @param path the path string * @return the paths * @throws IOException */ public static Path[] getInputPaths(String path) throws IOException { return SequenceFileUtility.getFilePaths(path, "part"); }
/** * Conveniance function. Finds the input paths using #SequenceFileUtility.getFilePaths * and uses Path(outpath) * @param inpath * @param outpath * @param args the arguments with which to start the job * @throws IOException */ public MultiStagedJob(String inpath, String outpath, String[] args) throws IOException { this(SequenceFileUtility.getFilePaths(inpath, "path"),new Path(outpath),args); }
/** * Conveniance function. Finds the input paths using #SequenceFileUtility.getFilePaths * and uses Path(outpath) * @param inpath * @param outpath * @param args the arguments with which to start the job * @throws IOException */ public MultiStagedJob(String inpath, String outpath, String[] args) throws IOException { this(SequenceFileUtility.getFilePaths(inpath, "path"),new Path(outpath),args); }
/** * Get the input paths from an {@link InOutToolOptions}. This will resolve the input path * and return either a {@link Path} object representing the string * or, if the path string is a directory, a list of {@link Path}s * representing all the "part" files. * @param options the {@link InOutToolOptions}. * @return the input path * @throws IOException */ public static Path[] getInputPaths(InOutToolOptions options) throws IOException { return SequenceFileUtility.getFilePaths(options.getAllInputs(), "part"); }
/** * @return the input paths * @throws IOException */ public Path[] getInputPaths() throws IOException { final Path[] sequenceFiles = SequenceFileUtility.getFilePaths(this.getInput(), "part"); return sequenceFiles; }
/** * Get the input paths from an {@link InOutToolOptions}. This will resolve the input path * and return either a {@link Path} object representing the string * or, if the path string is a directory, a list of {@link Path}s * representing all the "part" files. * @param options the {@link InOutToolOptions}. * @return the input path * @throws IOException */ public static Path[] getInputPaths(InOutToolOptions options) throws IOException { return SequenceFileUtility.getFilePaths(options.getAllInputs(), "part"); }
/** * @return the input paths * @throws IOException */ public Path[] getInputPaths() throws IOException { final Path[] sequenceFiles = SequenceFileUtility.getFilePaths(this.getInput(), "part"); return sequenceFiles; }
/** * @return the list of input files * @throws IOException */ public Path[] getInputPaths() throws IOException { final Path[] sequenceFiles = SequenceFileUtility.getFilePaths(this.getAllInputs(), "part"); return sequenceFiles; }
/** * @return the list of input files * @throws IOException */ public Path[] getInputPaths() throws IOException { final Path[] sequenceFiles = SequenceFileUtility.getFilePaths(this.getAllInputs(), "part"); return sequenceFiles; }
public Path[] getInputPaths() throws IOException { Path[] sequenceFiles = SequenceFileUtility.getFilePaths(this.getInputString(), "part"); return sequenceFiles; }
public Path[] getInputPaths() throws IOException { final Path[] sequenceFiles = SequenceFileUtility.getFilePaths(this.getInputFileString(), "part"); return sequenceFiles; }
public Path[] getInputPaths() throws IOException { Path[] sequenceFiles = SequenceFileUtility.getFilePaths(this.getInputString(), "part"); return sequenceFiles; }
/** * Get a list of all the sequence files (with a given name prefix) in the * set of input paths. If a given uri is not a directory, then it is assumed * that it is a SequenceFile and returned directly. * * @param uriOrPaths * the paths or uris * @param filenamePrefix * the prefix of the file name * @return the list of sequence files * @throws IOException */ public static Path[] getFilePaths(String[] uriOrPaths, String filenamePrefix) throws IOException { final List<Path> pathList = new ArrayList<Path>(); for (final String uriOrPath : uriOrPaths) { final Path[] paths = getFilePaths(uriOrPath, filenamePrefix); for (final Path path : paths) { pathList.add(path); } } return pathList.toArray(new Path[pathList.size()]); }
@Override public void execute() throws IOException { final Path[] sequenceFiles = SequenceFileUtility.getFilePaths(inputPathOrUri, "part"); for (final Path path : sequenceFiles) { System.err.println("Outputting from seqfile: " + path); final SequenceFileUtility<Text, BytesWritable> utility = new TextBytesSequenceFileUtility(path.toUri(), true); if (options == null) { if (printOffsets) { for (final Entry<Text, Long> e : utility.listKeysAndOffsets().entrySet()) System.out.format("%10d %s\n", e.getValue(), e.getKey().toString()); } else { for (final Text t : utility.listKeys()) System.out.println(t.toString()); } } else { utility.extract(ListModeOptions.listOptionsToExtractPolicy(options), System.out, delim); } } } }