impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-5881: Use native allocation while building catalog updates
Date Thu, 07 Sep 2017 16:10:29 GMT
Alex Behm has posted comments on this change.

Change subject: IMPALA-5881: Use native allocation while building catalog updates
......................................................................


Patch Set 8:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/7955/8/be/src/catalog/catalog.cc
File be/src/catalog/catalog.cc:

Line 116:   DCHECK(len < std::numeric_limits<uint32_t>::max());
DCHECK_LE


#include <limit>


Line 170:     LOG(ERROR) << "Failed to free buffers. Potential memory leak of: "
Failed to free native buffer through JNI. Leaked N bytes.

(We definitely leaked at this point).

Also include the status error message.


http://gerrit.cloudera.org:8080/#/c/7955/8/fe/src/main/java/org/apache/impala/service/JniCatalog.java
File fe/src/main/java/org/apache/impala/service/JniCatalog.java:

Line 295:       TException {
Does this really throw TException?


http://gerrit.cloudera.org:8080/#/c/7955/8/fe/src/main/java/org/apache/impala/thrift/NativeByteArrayOutputStream.java
File fe/src/main/java/org/apache/impala/thrift/NativeByteArrayOutputStream.java:

Line 94:   private void tryAllocate(long len, boolean reAllocate) {
Can we simplify this to just always use reallocateMemory()? Realloc from a 0 ptr should be
ok I think.


Line 95:     try {
Preconditions.checkState(bufferPtr_ >= 0);

for clarity why the free in L114 is always ok


Line 113:     } catch (Exception e) {
catch Throwable for extra paranoia


Line 139:         if (newBufferSize >= BUFFER_MAX_SIZE_LIMIT) {
|| newBufferSize < 0 (overflow)


Line 155:   public synchronized void reset() {}
What's this for? Is it an @Override?


-- 
To view, visit http://gerrit.cloudera.org:8080/7955
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I383684effa9524734ce3c6c0fb7ed37de0e15782
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Bharath Vissapragada <bharathv@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bharathv@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Gerrit-Reviewer: Mostafa Mokhtar <mmokhtar@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message