Navigation Menu

Skip to content

Commit

Permalink
Added modifications so that output to S3 works. Also some cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
agentsguha committed Apr 21, 2015
1 parent 15e501f commit 698bef1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/godhuli/rhipe/FileUtils.java
Expand Up @@ -149,15 +149,15 @@ public void copyToLocal(final FileSystem srcFS, final Path src, final File dst)

public void makeFolderToDelete(final String s) throws IOException {
final Path p = new Path(s);
final FileSystem fs = FileSystem.get(cfg);
final FileSystem fs = p.getFileSystem(getConf());
fs.mkdirs(p);
fs.deleteOnExit(p);
}

public void copyMain(final String src, final String dest) throws IOException {
final File dst = new File(dest);
final Path srcpath = new Path(src);
final FileSystem srcFS = FileSystem.get(cfg);
final FileSystem srcFS = srcpath.getFileSystem(getConf());
final FileStatus[] srcs = srcFS.globStatus(srcpath);
final boolean dstIsDir = dst.isDirectory();
if (srcs.length > 1 && !dstIsDir) {
Expand All @@ -184,7 +184,7 @@ private void ls__(final String path, final ArrayList<String> lsco, final boolean
final FileSystem srcFS = spath.getFileSystem(getConf());
FileStatus[] srcs;

final URI fsUri = new URI(cfg.get("fs.default.name"));
final URI fsUri = new URI(getConf().get("fs.default.name"));
final String fsUriScheme = fsUri.getScheme();

srcs = srcFS.globStatus(spath);
Expand Down Expand Up @@ -270,7 +270,7 @@ public REXP readInfo(final String file) throws IOException {
}

public REXP mapRedOpts() {
final Iterator<Map.Entry<String, String>> iter = cfg.iterator();
final Iterator<Map.Entry<String, String>> iter = getConf().iterator();
final List<REXP> ent = new ArrayList<REXP>();
final List<String> str = new ArrayList<String>();
while (iter.hasNext()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/godhuli/rhipe/RHMR.java
Expand Up @@ -296,7 +296,7 @@ public void setJob() throws ClassNotFoundException, IOException, URISyntaxExcept

if (!output_folder[0].equals("")) {
final Path ofp = new Path(output_folder[0]);
final FileSystem srcFs = FileSystem.get(job_.getConfiguration());
final FileSystem srcFs = path.getFileSystem(job_.getConfiguration());
srcFs.delete(ofp, true);
if (rhoptions_.get("rhipe_outputformat_class").equals("org.apache.hadoop.mapreduce.lib.output.NullOutputFormat")) {
srcFs.mkdirs(ofp);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/godhuli/rhipe/SequenceFileIterator.java
Expand Up @@ -44,7 +44,6 @@ public void init(final String[] filenames, final int chunksize, final int maxn,
notcomplete = true;
mnum = maxn;
sqr = new SequenceFile.Reader(cfg, SequenceFile.Reader.file(new Path(files[current])));
// sqr = new SequenceFile.Reader(fs, new Path(files[current]), cfg);
k = new RHBytesWritable();
v = new RHBytesWritable();
kt = new Text();
Expand Down

0 comments on commit 698bef1

Please sign in to comment.