diff --git a/pom.xml b/pom.xml index 758fbeba..146f00c6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,12 @@ 4.0.0 - org.apache.hadoop.fs.glusterfs + org.gluster glusterfs-hadoop jar - 2.3.3 + 2.3.8 glusterfs-hadoop http://maven.apache.org diff --git a/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java b/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java index 51ce5fee..135227e0 100644 --- a/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java +++ b/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java @@ -114,8 +114,7 @@ public void setConf(Configuration conf){ String vol = conf.get("fs.glusterfs.volume.fuse." + v[i] , null); if(vol==null){ - log.error("Could not find property: fs.glusterfs.fuse." + v[i]); - throw new RuntimeException("Could not find mount point for volume: "+ v[i]); + throw new RuntimeException("Could not find property: fs.glusterfs.volume.fuse." + v[i] + "(mount point)"); } volumes.put(v[i],vol); log.info("Gluster volume: " + v[i] + " at : " + volumes.get(v[i])); @@ -126,6 +125,7 @@ public void setConf(Configuration conf){ }else{ attr = new GlusterFSXattr(); } + String jtSysDir = conf.get("mapreduce.jobtracker.system.dir", null); Path mapredSysDirectory = null; @@ -134,7 +134,7 @@ public void setConf(Configuration conf){ else{ mapredSysDirectory = new Path(conf.get("mapred.system.dir", "glusterfs:///mapred/system")); } - + log.info("Attempting to setup mapred sys directory: " + mapredSysDirectory); if(sameVolume(mapredSysDirectory) && !exists(mapredSysDirectory) ){ mkdirs(mapredSysDirectory); } @@ -198,8 +198,12 @@ public File pathToFile(Path path) { }else if(volume==null){ volume = default_volume; } - - return new File(this.volumes.get(volume) + "/" + path.toUri().getPath()); + String volPath = this.volumes.get(volume); + if(volPath==null){ + throw new RuntimeException("Error undefined volume:" + volume + " in path: " + path); + } + + return new File(volPath + "/" + path.toUri().getPath()); } protected Path getInitialWorkingDirectory() { @@ -222,6 +226,10 @@ public Path fileToPath(File path) { root = nextPath; } } + + if(volume==null){ + throw new RuntimeException("No volume matching path: " + path); + } if(default_volume.equalsIgnoreCase(volume)) volume = ""; @@ -281,6 +289,10 @@ public FileStatus[] listStatus(Path f) throws IOException { return new FileStatus[] { new GlusterFileStatus(localf, getDefaultBlockSize(), this) }; } + + if(localf.isDirectory() && !localf.canRead()){ + throw new IOException("Access denied : " + localf.getPath()); + } File[] names = localf.listFiles(); if (names == null) { diff --git a/src/main/java/org/apache/hadoop/fs/glusterfs/Version.java b/src/main/java/org/apache/hadoop/fs/glusterfs/Version.java index 2c5a5aba..90fe9f0e 100644 --- a/src/main/java/org/apache/hadoop/fs/glusterfs/Version.java +++ b/src/main/java/org/apache/hadoop/fs/glusterfs/Version.java @@ -4,23 +4,33 @@ import java.util.Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Versioning stuff for the shim. This class is not tested since there is no * deterministic behaviour (i.e. it might not work if not building from binary), * and the effects are pure side effects. */ public class Version extends Properties{ + static final Logger LOG = LoggerFactory.getLogger(Version.class); public Version() { super(); try{ load(this.getClass().getClassLoader().getResourceAsStream("git.properties")); } catch(Throwable t){ - throw new RuntimeException("Couldn't find git properties for version info " + t.getMessage()); + LOG.warn("Couldn't find GIT properties for version info " + + t +". This jar may have been built OUTSIDE a GIT repo."); } } public String getTag(){ - return this.getProperty("git.commit.id.describe").split("-")[0]; + String commit = this.getProperty("git.commit.id.describe"); + final String tag = commit != null ? + commit.split("-")[0]: + "no version info available. check log warnings."; + + return tag; } /**