Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit a21be25

Browse files
committed
Merge pull request #202 from aaudiber/get-correct-filesystem
Get FileSystems with appropriate paths
2 parents 56119ab + bc656f7 commit a21be25

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/autogen/src/main/java/HiBench/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public boolean accept(final Path path) {
151151

152152
private static final void shareMapFile(String symbol, int slots, Path mfile, JobConf job) throws IOException, URISyntaxException {
153153

154-
FileSystem fs = FileSystem.get(job);
154+
FileSystem fs = FileSystem.get(mfile.toUri(), job);
155155
if (fs.exists(mfile) && fs.getFileStatus(mfile).isDir()) {
156156

157157
DistributedCache.createSymlink(job);

src/autogen/src/main/java/org/apache/hadoop/fs/dfsioe/TestDFSIOEnh.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ else if (unit.equalsIgnoreCase("g"))
571571
fsConfig.setInt("test.io.file.buffer.size", bufferSize);
572572
fsConfig.setInt("test.io.sampling.interval",tputSampleInterval);
573573

574-
FileSystem fs = FileSystem.get(fsConfig);
574+
FileSystem fs = FileSystem.get(new Path(TEST_ROOT_DIR).toUri(), fsConfig);
575575

576576
//get the configuration of max number of concurrent maps
577577
JobConf dummyConf = new JobConf(fsConfig, TestDFSIOEnh.class);

src/autogen/src/main/java/org/apache/mahout/clustering/kmeans/GenKMeansDataset.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ public int run(String[] args) throws Exception {
600600
jobConf.set("mapred.output.compression.type", compressType);
601601
jobConf.set("mapred.output.compression.codec", compressCodec);
602602
LOG.info("mapred.output.compression.codec=" + jobConf.get("mapred.output.compression.codec"));
603-
FileSystem fs = FileSystem.get(jobConf);
603+
FileSystem fs = FileSystem.get(new Path(sampleDir).toUri(), jobConf);
604604

605605
sp.setFileSystem(fs, jobConf);
606606

src/pegasus/src/main/java/pegasus/pagerank/PagerankNaive.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ public int run (final String[] args) throws Exception
380380
if( cur_iteration == 1 )
381381
gen_initial_vector(number_nodes, vector_path);
382382

383-
final FileSystem fs = FileSystem.get(getConf());
383+
final FileSystem fs = FileSystem.get(vector_path.toUri(), getConf());
384384

385385
// Run pagerank until converges.
386386
for (i = cur_iteration; i <= niteration; i++) {
@@ -456,8 +456,9 @@ public void gen_initial_vector(int number_nodes, Path vector_path) throws IOExce
456456
System.out.println("");
457457

458458
// copy it to curbm_path, and delete temporary local file.
459-
final FileSystem fs = FileSystem.get(getConf());
460-
fs.copyFromLocalFile( true, new Path("./" + file_name), new Path (vector_path.toString()+ "/" + file_name) );
459+
Path destination = new Path(vector_path.toString()+ "/" + file_name);
460+
final FileSystem fs = FileSystem.get(destination.toUri(), getConf());
461+
fs.copyFromLocalFile( true, new Path("./" + file_name), destination);
461462
}
462463

463464
// read neighborhood number after each iteration.

0 commit comments

Comments
 (0)