hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heyongqi...@apache.org
Subject svn commit: r1195580 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndexResult.java
Date Mon, 31 Oct 2011 17:33:40 GMT
Author: heyongqiang
Date: Mon Oct 31 17:33:40 2011
New Revision: 1195580

URL: http://svn.apache.org/viewvc?rev=1195580&view=rev
Log:
HIVE-2534: HiveIndexResult creation fails due to file system issue (Kevin Wilfong via He Yongqiang)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndexResult.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndexResult.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndexResult.java?rev=1195580&r1=1195579&r2=1195580&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndexResult.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndexResult.java Mon Oct 31
17:33:40 2011
@@ -52,7 +52,7 @@ public class HiveIndexResult {
   // IndexBucket
   static class IBucket {
     private String name = null;
-    private SortedSet<Long> offsets = new TreeSet<Long>();
+    private final SortedSet<Long> offsets = new TreeSet<Long>();
 
     public IBucket(String n) {
       name = n;
@@ -70,6 +70,7 @@ public class HiveIndexResult {
       return offsets;
     }
 
+    @Override
     public boolean equals(Object obj) {
       if (obj.getClass() != this.getClass()) {
         return false;
@@ -91,10 +92,10 @@ public class HiveIndexResult {
     ignoreHdfsLoc = HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_INDEX_IGNORE_HDFS_LOC);
 
     if (indexFiles != null && indexFiles.size() > 0) {
-      FileSystem fs = FileSystem.get(conf);
       List<Path> paths = new ArrayList<Path>();
       for (String indexFile : indexFiles) {
         Path indexFilePath = new Path(indexFile);
+        FileSystem fs = indexFilePath.getFileSystem(conf);
         FileStatus indexStat = fs.getFileStatus(indexFilePath);
         if (indexStat.isDir()) {
           FileStatus[] fss = fs.listStatus(indexFilePath);
@@ -113,6 +114,7 @@ public class HiveIndexResult {
 
       long lineCounter = 0;
       for (Path indexFinalPath : paths) {
+        FileSystem fs = indexFinalPath.getFileSystem(conf);
         FSDataInputStream ifile = fs.open(indexFinalPath);
         LineReader lr = new LineReader(ifile, conf);
         try {



Mime
View raw message