/** * @return the output file location */ public Path getOutputPath() { return new Path(SequenceFileUtility.convertToURI(output).toString()); }
private void validate(boolean initial) { if (replace && initial) { try { final URI outuri = SequenceFileUtility.convertToURI(output); final FileSystem fs = SequenceFileUtility.getFileSystem(outuri, new Configuration()); fs.delete(new Path(outuri.toString()), true); } catch (final IOException e) { } } }
/** * @return the output path */ public Path getOutputPath() { return new Path(SequenceFileUtility.convertToURI(this.getOutput()).toString()); } }
public SequenceFileUtility(String uriOrPath, CompressionType compressionType, Map<String, String> metadata) throws IOException { this.compressionType = compressionType; setup(convertToURI(uriOrPath), false); }
/** * Delete a file * @param f the file to delete * @throws IOException */ public static void removeFile(String f) throws IOException { URI outuri = SequenceFileUtility.convertToURI(f); FileSystem fs = getFileSystem(outuri); Path p = new Path(outuri.toString()); fs.delete(p, true); }
/** * @return the output path */ public Path getOutputPath() { return new Path(SequenceFileUtility.convertToURI(this.getOutput()).toString()); } }
public static InputStream getClusterInputStream(String uriStr) throws IOException { final URI uri = SequenceFileUtility.convertToURI(uriStr); final FileSystem fs = getFileSystem(uri); final Path p = new Path(uri.toString()); return fs.open(p); }
protected void validate() { if(replace && beforeMaps) { try { URI outuri = SequenceFileUtility.convertToURI(output); FileSystem fs = getFileSystem(outuri); fs.delete(new Path(outuri.toString()), true); } catch (IOException e) { } } }
private static boolean fileExists(String path) throws IOException{ URI outuri = SequenceFileUtility.convertToURI(path); FileSystem fs = getFileSystem(outuri); Path p = new Path(outuri.toString()); return fs.exists(p); }
public SequenceFileUtility(String uriOrPath, CompressionType compressionType, Map<String, String> metadata) throws IOException { this.compressionType = compressionType; setup(convertToURI(uriOrPath), false); }
private static boolean fileExists(String path) throws IOException{ URI outuri = SequenceFileUtility.convertToURI(path); FileSystem fs = getFileSystem(outuri); Path p = new Path(outuri.toString()); return fs.exists(p); }
/** * Delete a file * @param f the file to delete * @throws IOException */ public static void removeFile(String f) throws IOException { URI outuri = SequenceFileUtility.convertToURI(f); FileSystem fs = getFileSystem(outuri); Path p = new Path(outuri.toString()); fs.delete(p, true); }
/** * Use hadoop filesystem to check if the given path exists * @param path the path to the file * @return true if file exists; false otherwise * @throws IOException */ public static boolean fileExists(String path) throws IOException{ URI outuri = SequenceFileUtility.convertToURI(path); FileSystem fs = getFileSystem(outuri); Path p = new Path(outuri.toString()); return fs.exists(p); } /**
@Override public void start() throws IOException{ if(force) { URI outuri = SequenceFileUtility.convertToURI(sequenceFile); FileSystem fs = getFileSystem(outuri); fs.delete(new Path(outuri.toString()), true); } utility = new TextBytesSequenceFileUtility(sequenceFile, false); }
private void validate() { if (replace && beforeMap) { try { final URI outuri = SequenceFileUtility.convertToURI(this.getOutput()); final FileSystem fs = getFileSystem(outuri); fs.delete(new Path(outuri.toString()), true); } catch (final IOException e) { } } }
public static ZipOutputStream openZipOutputStream(String uriOrPath) throws IOException { final URI uri = convertToURI(uriOrPath); final FileSystem fs = getFileSystem(uri, new Configuration()); final Path path = new Path(uri.toString()); final ZipOutputStream zos = new ZipOutputStream(fs.create(path)); zos.setLevel(Deflater.BEST_COMPRESSION); return zos; }
public static ZipOutputStream openZipOutputStream(String uriOrPath) throws IOException { final URI uri = convertToURI(uriOrPath); final FileSystem fs = getFileSystem(uri, new Configuration()); final Path path = new Path(uri.toString()); final ZipOutputStream zos = new ZipOutputStream(fs.create(path)); zos.setLevel(Deflater.BEST_COMPRESSION); return zos; }
private void validate() { if(replace){ try { URI outuri = SequenceFileUtility.convertToURI(this.getOutputString()); FileSystem fs = getFileSystem(outuri); fs.delete(new Path(outuri.toString()), true); } catch (IOException e) { } } }
private void validate() { if (replace && beforeMap) { try { final URI outuri = SequenceFileUtility.convertToURI(this.getOutput()); final FileSystem fs = getFileSystem(outuri); fs.delete(new Path(outuri.toString()), true); } catch (final IOException e) { } } }
private void validate() { if(replace && beforeMap){ try { URI outuri = SequenceFileUtility.convertToURI(this.getOutputString()); FileSystem fs = getFileSystem(outuri); fs.delete(new Path(outuri.toString()), true); } catch (IOException e) { } } } public static FileSystem getFileSystem(URI uri) throws IOException {