Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.hadoop.fs.glusterfs</groupId>
<groupId>org.gluster</groupId>
<artifactId>glusterfs-hadoop</artifactId>
<packaging>jar</packaging>
<!-- from now, we will update version manually and ignore maven snapshot
features -->
<version>2.3.3</version>
<version>2.3.8</version>
<name>glusterfs-hadoop</name>
<url>http://maven.apache.org</url>

Expand Down
22 changes: 17 additions & 5 deletions src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
Expand All @@ -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;

Expand All @@ -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);
}
Expand Down Expand Up @@ -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() {
Expand All @@ -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 = "";
Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/apache/hadoop/fs/glusterfs/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down