trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [1/4] trafodion git commit: [TRAFODION-2917] Refactor Trafodion implementation of hdfs scan for text formatted hive tables
Date Thu, 10 May 2018 21:08:20 GMT
Repository: trafodion
Updated Branches:
  refs/heads/master d009f2fd7 -> 5fa28f37b


[TRAFODION-2917] Refactor Trafodion implementation of hdfs scan for text formatted hive tables

Fix for compGeneral/TEST045
When a hive scan was prepared and executed many times, incorrect array containing runtime
ranges
were deallocated leading to memory corruption. Also, fixed a memory leak in the JNI layer.


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

Branch: refs/heads/master
Commit: f216cdb31b89cb6a8b80717c113a6dcdfd3a24e1
Parents: fe62cce
Author: selvaganesang <selva.govindarajan@esgyn.com>
Authored: Wed May 9 00:13:42 2018 +0000
Committer: selvaganesang <selva.govindarajan@esgyn.com>
Committed: Wed May 9 00:13:42 2018 +0000

----------------------------------------------------------------------
 core/sql/executor/ExHdfsScan.cpp     |  1 -
 core/sql/executor/HdfsClient_JNI.cpp | 12 +++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/f216cdb3/core/sql/executor/ExHdfsScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.cpp b/core/sql/executor/ExHdfsScan.cpp
index dcf0d07..97697f3 100644
--- a/core/sql/executor/ExHdfsScan.cpp
+++ b/core/sql/executor/ExHdfsScan.cpp
@@ -2093,7 +2093,6 @@ short ExHdfsScanTcb::moveRowToUpQueue(const char * row, Lng32 len,
 	*rc = WORK_POOL_BLOCKED;
       return -1;
     }
-  
   char * dp = p.getDataPointer();
   if (isVarchar)
     {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/f216cdb3/core/sql/executor/HdfsClient_JNI.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/HdfsClient_JNI.cpp b/core/sql/executor/HdfsClient_JNI.cpp
index 72a898b..0622b50 100644
--- a/core/sql/executor/HdfsClient_JNI.cpp
+++ b/core/sql/executor/HdfsClient_JNI.cpp
@@ -982,16 +982,22 @@ HDFS_Client_RetCode HdfsClient::setHdfsFileInfo(JNIEnv *jenv, jint numFiles,
jin
    hdfsFileInfo->mLastAccess = accessTime;
    jint tempLen = jenv->GetStringUTFLength(filename);
    hdfsFileInfo->mName = new (getHeap()) char[tempLen+1];   
-   strncpy(hdfsFileInfo->mName, jenv->GetStringUTFChars(filename, NULL), tempLen);
+   const char *temp = jenv->GetStringUTFChars(filename, NULL); 
+   strncpy(hdfsFileInfo->mName, temp, tempLen);
    hdfsFileInfo->mName[tempLen] = '\0';
+   jenv_->ReleaseStringUTFChars(filename, temp); 
    tempLen = jenv->GetStringUTFLength(owner);
    hdfsFileInfo->mOwner = new (getHeap()) char[tempLen+1];   
-   strncpy(hdfsFileInfo->mOwner, jenv->GetStringUTFChars(owner, NULL), tempLen);
+   temp = jenv->GetStringUTFChars(owner, NULL);
+   strncpy(hdfsFileInfo->mOwner, temp, tempLen);
    hdfsFileInfo->mOwner[tempLen] = '\0';
+   jenv_->ReleaseStringUTFChars(owner, temp); 
    tempLen = jenv->GetStringUTFLength(group);
    hdfsFileInfo->mGroup = new (getHeap()) char[tempLen+1];   
-   strncpy(hdfsFileInfo->mGroup, jenv->GetStringUTFChars(group, NULL), tempLen);
+   temp = jenv->GetStringUTFChars(group, NULL); 
+   strncpy(hdfsFileInfo->mGroup, temp, tempLen);
    hdfsFileInfo->mGroup[tempLen] = '\0';
+   jenv_->ReleaseStringUTFChars(group, temp); 
    return HDFS_CLIENT_OK;
 }
 


Mime
View raw message