You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/07/13 11:39:23 UTC

[GitHub] [hive] szlta commented on a change in pull request #1238: HIVE-23824

szlta commented on a change in pull request #1238:
URL: https://github.com/apache/hive/pull/1238#discussion_r453588505



##########
File path: llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
##########
@@ -575,31 +626,8 @@ private OrcFileMetadata getFileFooterFromCacheOrDisk() throws IOException {
       tailBuffers = metadataCache.getFileMetadata(fileKey);
       if (tailBuffers != null) {
         try {
-          MemoryBuffer tailBuffer = tailBuffers.getSingleBuffer();
-          ByteBuffer bb = null;
-          if (tailBuffer != null) {
-            bb = tailBuffer.getByteBufferDup();
-            // TODO: remove the copy after ORC-158 and ORC-197
-            // if (bb.isDirect()) {
-              ByteBuffer dupBb = tailBuffer.getByteBufferDup(); // Don't mess with the cached object.
-              bb = ByteBuffer.allocate(dupBb.remaining());
-              bb.put(dupBb);
-              bb.flip();
-            // }
-          } else {
-            // TODO: add the ability to extractFileTail to read from multiple buffers?
-            MemoryBuffer[] tailBufferArray = tailBuffers.getMultipleBuffers();
-            int totalSize = 0;
-            for (MemoryBuffer buf : tailBufferArray) {
-              totalSize += buf.getByteBufferRaw().remaining();
-            }
-            bb = ByteBuffer.allocate(totalSize);
-            for (MemoryBuffer buf : tailBufferArray) {
-              bb.put(buf.getByteBufferDup());
-            }
-            bb.flip();
-          }
-          OrcTail orcTail = ReaderImpl.extractFileTail(bb);
+          OrcTail orcTail = getOrcTailFromLlapBuffers(tailBuffers);

Review comment:
       Yes, it won't be evicted as it is locked. The getFileMetadata invocation will incRef it (if it is found of course)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org