From 978682e55fa4d16d55704d9a3f94a297b778019b Mon Sep 17 00:00:00 2001 From: jayunit100 Date: Mon, 12 Aug 2013 11:07:07 -0400 Subject: [PATCH] wrap the scheme/authority debuginfo into logs in checkPath method, which validates scheme/authority. This is a tricky exception to chase down in runtime. This helps to debug the cryptic 'glusterfs://:9000/myfile.txt' but expected 'glusterfs:/// ' error which occurs at runtime when configuration is not correctly set. --- .../hadoop/fs/glusterfs/GlusterFileSystem.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) mode change 100644 => 100755 src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFileSystem.java diff --git a/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFileSystem.java b/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFileSystem.java old mode 100644 new mode 100755 index 8107f862..fb1a0de3 --- a/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFileSystem.java +++ b/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFileSystem.java @@ -50,6 +50,18 @@ public FileSystem getRaw(){ return rfs; } + /** Check that a Path belongs to this FileSystem. */ + @Override + protected void checkPath(Path path) { + String thisScheme = this.getUri().getScheme(); + String thatScheme = path.toUri().getScheme(); + String thisAuthority = this.getUri().getAuthority(); + String thatAuthority = path.toUri().getAuthority(); + log.info("checking path: scheme=" + thisScheme+" auth="+thisAuthority + " vs scheme=" + thatScheme +" auth=" + thatAuthority); + //now the exception will be traceable in the logs above . + super.checkPath(path); + } + public void initialize(URI name,Configuration conf) throws IOException{ if(fs.getConf()==null){ fs.initialize(name, conf);