Skip to content

Commit a70e568

Browse files
committed
Merge pull request #56 from childsb/master
create mapred system directory if not exists + some code cleanup
2 parents 2dc0697 + 1487714 commit a70e568

File tree

4 files changed

+17
-28
lines changed

4 files changed

+17
-28
lines changed

src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFileSystem.java

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,15 @@
4343
public class GlusterFileSystem extends FilterFileSystem{
4444

4545
protected static final Logger log=LoggerFactory.getLogger(GlusterFileSystem.class);
46-
FileSystem rfs;
47-
String swapScheme;
48-
49-
public FileSystem getRaw(){
50-
return rfs;
51-
}
52-
53-
public void initialize(URI name,Configuration conf) throws IOException{
54-
if(fs.getConf()==null){
55-
fs.initialize(name, conf);
56-
}
57-
String scheme=name.getScheme();
58-
if(!scheme.equals(fs.getUri().getScheme())){
59-
swapScheme=scheme;
60-
}
61-
}
62-
46+
6347
public GlusterFileSystem(){
64-
this(new GlusterVolume());
48+
super(new GlusterVolume());
6549
Version v=new Version();
6650
log.info("Initializing GlusterFS, CRC disabled.");
6751
log.info("GIT INFO="+v);
6852
log.info("GIT_TAG="+v.getTag());
6953
}
7054

71-
public GlusterFileSystem(FileSystem rawLocalFileSystem){
72-
super(rawLocalFileSystem);
73-
rfs=rawLocalFileSystem;
74-
}
75-
7655
/** Convert a path to a File. */
7756
public File pathToFile(Path path){
7857
return ((GlusterVolume) fs).pathToFile(path);

src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ public void setConf(Configuration conf){
6666
}else{
6767
attr = new GlusterFSXattr();
6868
}
69+
String jtSysDir = conf.get("mapreduce.jobtracker.system.dir", null);
70+
Path mapredSysDirectory = null;
71+
72+
if(jtSysDir!=null)
73+
mapredSysDirectory = new Path(jtSysDir);
74+
else{
75+
mapredSysDirectory = new Path(conf.get("mapred.system.dir", "glusterfs:///mapred/system"));
76+
}
77+
78+
if(!exists(mapredSysDirectory)){
79+
mkdirs(mapredSysDirectory);
80+
}
6981

7082
//volName=conf.get("fs.glusterfs.volname", null);
7183
//remoteGFSServer=conf.get("fs.glusterfs.server", null);

src/main/java/org/apache/hadoop/fs/local/GlusterVol.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
import org.slf4j.LoggerFactory;
1515

1616
public class GlusterVol extends RawLocalFsG{
17-
18-
protected String glusterMount = null;
17+
1918
protected static final Logger log = LoggerFactory.getLogger(GlusterFileSystemCRC.class);
2019

21-
2220
GlusterVol(final Configuration conf) throws IOException, URISyntaxException {
2321
this(GlusterVolume.NAME, conf);
2422

src/main/java/org/apache/hadoop/fs/local/RawLocalFsG.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public class RawLocalFsG extends DelegateToFileSystem{
2323
*
2424
*/
2525

26-
RawLocalFsG(final URI theUri, final FileSystem fs, final Configuration conf,boolean myMamaFat) throws IOException, URISyntaxException{
27-
super(theUri, fs, conf, theUri.getScheme(), myMamaFat);
26+
RawLocalFsG(final URI theUri, final FileSystem fs, final Configuration conf,boolean authorityRequired) throws IOException, URISyntaxException{
27+
super(theUri, fs, conf, theUri.getScheme(), authorityRequired);
2828
}
2929

3030

0 commit comments

Comments
 (0)