You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2016/04/05 20:17:35 UTC

[3/4] hive git commit: HIVE-12990 : LLAP: ORC cache NPE without FileID support (Sergey Shelukhin, reviewed by Prasanth Jayachandran)

HIVE-12990 : LLAP: ORC cache NPE without FileID support (Sergey Shelukhin, reviewed by Prasanth Jayachandran)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/263799eb
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/263799eb
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/263799eb

Branch: refs/heads/branch-2.0
Commit: 263799eb2698a24152cf937a87aa994593cbce1d
Parents: 6cd4a42
Author: Sergey Shelukhin <se...@apache.org>
Authored: Fri Feb 5 16:09:58 2016 -0800
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue Apr 5 11:11:44 2016 -0700

----------------------------------------------------------------------
 .../hive/llap/io/encoded/OrcEncodedDataReader.java       | 11 ++++-------
 .../hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java |  2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/263799eb/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java b/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
index 1f1aac7..b36cf64 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
@@ -394,8 +394,8 @@ public class OrcEncodedDataReader extends CallableWithNdc<Void>
             counters.incrCounter(Counter.METADATA_CACHE_MISS);
             ensureMetadataReader();
             long startTimeHdfs = counters.startTimeCounter();
-            stripeMetadata = new OrcStripeMetadata(
-                stripeKey, metadataReader, stripe, stripeIncludes, sargColumns);
+            stripeMetadata = new OrcStripeMetadata(new OrcBatchKey(fileId, stripeIx, 0),
+                metadataReader, stripe, stripeIncludes, sargColumns);
             counters.incrTimeCounter(Counter.HDFS_TIME_US, startTimeHdfs);
             if (hasFileId && metadataCache != null) {
               stripeMetadata = metadataCache.putStripeMetadata(stripeMetadata);
@@ -403,9 +403,7 @@ public class OrcEncodedDataReader extends CallableWithNdc<Void>
                 LlapIoImpl.LOG.info("Caching stripe " + stripeKey.stripeIx
                     + " metadata with includes: " + DebugUtils.toString(stripeIncludes));
               }
-              stripeKey = new OrcBatchKey(fileId, -1, 0);
             }
-
           }
           consumer.setStripeMetadata(stripeMetadata);
         }
@@ -658,7 +656,8 @@ public class OrcEncodedDataReader extends CallableWithNdc<Void>
         StripeInformation si = fileMetadata.getStripes().get(stripeIx);
         if (value == null) {
           long startTime = counters.startTimeCounter();
-          value = new OrcStripeMetadata(stripeKey, metadataReader, si, globalInc, sargColumns);
+          value = new OrcStripeMetadata(new OrcBatchKey(fileId, stripeIx, 0),
+              metadataReader, si, globalInc, sargColumns);
           counters.incrTimeCounter(Counter.HDFS_TIME_US, startTime);
           if (hasFileId && metadataCache != null) {
             value = metadataCache.putStripeMetadata(value);
@@ -666,8 +665,6 @@ public class OrcEncodedDataReader extends CallableWithNdc<Void>
               LlapIoImpl.LOG.info("Caching stripe " + stripeKey.stripeIx
                   + " metadata with includes: " + DebugUtils.toString(globalInc));
             }
-            // Create new key object to reuse for gets; we've used the old one to put in cache.
-            stripeKey = new OrcBatchKey(fileId, 0, 0);
           }
         }
         // We might have got an old value from cache; recheck it has indexes.

http://git-wip-us.apache.org/repos/asf/hive/blob/263799eb/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java
index fed6de0..6cec80e 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java
@@ -106,7 +106,7 @@ class EncodedReaderImpl implements EncodedReader {
   private ByteBufferAllocatorPool pool;
   private boolean isDebugTracingEnabled;
 
-  public EncodedReaderImpl(long fileId, List<OrcProto.Type> types, CompressionCodec codec,
+  public EncodedReaderImpl(Long fileId, List<OrcProto.Type> types, CompressionCodec codec,
       int bufferSize, long strideRate, DataCache cache, DataReader dataReader, PoolFactory pf)
           throws IOException {
     this.fileId = fileId;