Review Board 1.7.22


Remove the Windows specific “=” related swizzle path changes from Proxy FileSystems

Review Request #7836 - Created Nov. 2, 2012 and updated

Kanna Karanam
hive
HIVE-3661
Reviewers
hive
ashutoshc, carl
hive
Because of this special conversion, Some other unit tests are failing on Windows. After some other investigation, We noticed that “=” is a valid character that can be included in the Windows paths. So I am reverting back “=” related changes from the swizzle path.

 
trunk/shims/src/common/java/org/apache/hadoop/fs/ProxyFileSystem.java
Revision 1405070 New Change
[20] 44 lines
[+20] [+] public class ProxyFileSystem extends FilterFileSystem {
45

    
   
45

   
46

    
   
46

   
47

    
   
47

   
48
  private Path swizzleParamPath(Path p) {
48
  private Path swizzleParamPath(Path p) {
49
    String pathUriString = p.toUri().toString();
49
    String pathUriString = p.toUri().toString();
50
    if (Shell.WINDOWS) {

   
51
      // Some of the file paths (Files with partition option) in HDFS '='

   
52
      // but Windows file path doesn't support '=' so replace it with special string.

   
53
      pathUriString = pathUriString.replaceAll("=", "------");

   
54
    }

   
55
    URI newPathUri = URI.create(pathUriString);
50
    URI newPathUri = URI.create(pathUriString);
56
    return new Path (realScheme, realAuthority, newPathUri.getPath());
51
    return new Path (realScheme, realAuthority, newPathUri.getPath());
57
  }
52
  }
58

    
   
53

   
59
  private Path swizzleReturnPath(Path p) {
54
  private Path swizzleReturnPath(Path p) {
60
    String pathUriString = p.toUri().toString();
55
    String pathUriString = p.toUri().toString();
61
    if (Shell.WINDOWS) {

   
62
      // Revert back the special string '------' with '=' when we do the reverse conversion

   
63
      // from Windows path to HDFS

   
64
      pathUriString = pathUriString.replaceAll("------", "=");

   
65
    }

   
66
    URI newPathUri = URI.create(pathUriString);
56
    URI newPathUri = URI.create(pathUriString);
67
    return new Path (myScheme, myAuthority, newPathUri.getPath());
57
    return new Path (myScheme, myAuthority, newPathUri.getPath());
68
  }
58
  }
69

    
   
59

   
70
  private FileStatus swizzleFileStatus(FileStatus orig, boolean isParam) {
60
  private FileStatus swizzleFileStatus(FileStatus orig, boolean isParam) {
[+20] [20] 218 lines
trunk/shims/src/common/java/org/apache/hadoop/fs/ProxyLocalFileSystem.java
Revision 1405070 New Change
 
  1. trunk/shims/src/common/java/org/apache/hadoop/fs/ProxyFileSystem.java: Loading...
  2. trunk/shims/src/common/java/org/apache/hadoop/fs/ProxyLocalFileSystem.java: Loading...