trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [2/3] incubator-trafodion git commit: [TRAFODION-2821] Trafodion core code base needs to be thread safe
Date Wed, 29 Nov 2017 05:29:02 GMT
[TRAFODION-2821] Trafodion core code base needs to be thread safe

Changes as per review


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

Branch: refs/heads/master
Commit: 46fa80faa10b5aadeffe1bef7a3bd0d4d5d2ac73
Parents: 31041e0
Author: selvaganesang <selva.govindarajan@esgyn.com>
Authored: Tue Nov 28 21:16:38 2017 +0000
Committer: selvaganesang <selva.govindarajan@esgyn.com>
Committed: Tue Nov 28 21:16:38 2017 +0000

----------------------------------------------------------------------
 core/sql/executor/OrcFileReader.cpp      |  6 +--
 core/sql/executor/SequenceFileReader.cpp | 78 ---------------------------
 2 files changed, 3 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/46fa80fa/core/sql/executor/OrcFileReader.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/OrcFileReader.cpp b/core/sql/executor/OrcFileReader.cpp
index d63052d..ddaa27a 100644
--- a/core/sql/executor/OrcFileReader.cpp
+++ b/core/sql/executor/OrcFileReader.cpp
@@ -285,9 +285,10 @@ OFR_RetCode OrcFileReader::isEOF(bool& isEOF)
 //OFR_RetCode OrcFileReader::fetchNextRow(Int64 stopOffset, char* buffer)
 OFR_RetCode OrcFileReader::fetchNextRow(char * buffer, long& array_length, long&
rowNumber, int& num_columns)
 {
-/*
+
   if (initJNIEnv() != JOI_OK)
      return OFR_ERROR_FETCHROW_EXCEPTION;
+/*
   // java.lang.String fetchNextRow(long stopOffset);
   jstring jresult = (jstring)jenv_->CallObjectMethod(javaObj_, JavaMethods_[JM_FETCHROW2].methodID,
stopOffset);
   if (jresult==NULL && getLastError()) 
@@ -376,7 +377,6 @@ OFR_RetCode OrcFileReader::fetchNextRow(char * buffer, long& array_length,
long&
         }
 
 	jenv_->GetByteArrayRegion(jrow, 0, row_length, (jbyte*)buffer);
- 	jenv_->DeleteLocalRef(jrow);  
 
   jenv_->PopLocalFrame(NULL);
   return (OFR_OK);
@@ -494,5 +494,5 @@ Removed until implemented
   QRLogger::log(CAT_SQL_HDFS_ORC_FILE_READER, LL_DEBUG, "  =>Returning %d, read %ld bytes
in %d rows.", retCode, bytesRead, rowsRead);
   return retCode;
 */
-  return OFR_OK;
+  return (OFR_NOMORE);
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/46fa80fa/core/sql/executor/SequenceFileReader.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/SequenceFileReader.cpp b/core/sql/executor/SequenceFileReader.cpp
index a67db87..a12673d 100644
--- a/core/sql/executor/SequenceFileReader.cpp
+++ b/core/sql/executor/SequenceFileReader.cpp
@@ -187,8 +187,6 @@ SFR_RetCode SequenceFileReader::open(const char* path)
   tsRecentJMFromJNI = JavaMethods_[JM_OPEN].jm_full_name;
   jstring jresult = (jstring)jenv_->CallObjectMethod(javaObj_, JavaMethods_[JM_OPEN].methodID,
js_path);
 
-  jenv_->DeleteLocalRef(js_path);  
-
   if (jresult != NULL)
   {
     logError(CAT_SQL_HDFS_SEQ_FILE_READER, "SequenceFileReader::open()", jresult);
@@ -271,29 +269,6 @@ SFR_RetCode SequenceFileReader::isEOF(bool& isEOF)
 //////////////////////////////////////////////////////////////////////////////
 // 
 //////////////////////////////////////////////////////////////////////////////
-//char** SequenceFileReader::fetchArrayOfColumns()
-//{
-//  // java.lang.String[] fetchArrayOfColumns();
-//  jobjectArray jresult = (jobjectArray)jenv_->CallObjectMethod(javaObj_, JavaMethods_[JM_FETCHCOLS].methodID);
-//  if (jenv_->ExceptionCheck()) 
-//  {
-//    jenv_->ExceptionDescribe();
-//    jenv_->ExceptionClear();
-//    jenv_->DeleteLocalRef(jresult);
-//    return NULL;
-//  }
-//
-//  if (jresult == NULL)
-//  {
-//    return NULL;
-//  }
-//	
-//  return SequenceFileReader::JStringArray2CharsArray(jresult);
-//}
-
-//////////////////////////////////////////////////////////////////////////////
-// 
-//////////////////////////////////////////////////////////////////////////////
 SFR_RetCode SequenceFileReader::fetchNextRow(Int64 stopOffset, char* buffer)
 {
   if (initJNIEnv() != JOI_OK)
@@ -361,57 +336,6 @@ jstring SequenceFileReader::getLastError()
 //////////////////////////////////////////////////////////////////////////////
 // 
 //////////////////////////////////////////////////////////////////////////////
-//char** SequenceFileReader::JStringArray2CharsArray(jobjectArray jarray)
-//{
-//  char **chars_array;
-//  int len;
-//  int i;
-//  const char *ret_val;
-//  jstring jst_ret;
-//
-//  len = jenv_->GetArrayLength(jarray);
-//
-//  chars_array = (char **)malloc(sizeof(char*) * (len + 1));
-//  if (chars_array == NULL) 
-//  {
-//    //TRACE(stderr, "<%s:%d> malloc() failed\n", __FILE__, __LINE__);
-//    return NULL;
-//  }
-//
-//  for (i = 0; i < len; i++) 
-//  {
-//    ret_val = "";
-//
-//    jst_ret = (jstring)jenv_->GetObjectArrayElement(jarray, i);
-//    if (jst_ret != NULL) 
-//    {
-//      ret_val = jenv_->GetStringUTFChars(jst_ret, 0);
-//    }
-//
-//    //TRACE(stderr, "<%s:%d> %d) => %s\n", __FILE__, __LINE__, i, ret_val);
-//
-//    chars_array[i] = strdup(ret_val);
-//    if (chars_array[i] == NULL) 
-//    {
-//      // TODO: Add error handling
-//      return NULL;
-//    }
-//
-//    if (jst_ret != NULL) 
-//    {
-//      jenv_->ReleaseStringUTFChars(jst_ret, ret_val);
-//      jenv_->DeleteLocalRef(jst_ret);  
-//    }
-//  }
-//  chars_array[i] = NULL;
-//  jenv_->DeleteLocalRef(jarray);  
-//
-//  return chars_array;
-//}
-
-//////////////////////////////////////////////////////////////////////////////
-// 
-//////////////////////////////////////////////////////////////////////////////
 SFR_RetCode SequenceFileReader::fetchRowsIntoBuffer(Int64   stopOffset, 
                                                     char*   buffer, 
                                                     Int64   buffSize, 
@@ -599,8 +523,6 @@ SFW_RetCode SequenceFileWriter::write(const char* data)
   tsRecentJMFromJNI = JavaMethods_[JM_WRITE].jm_full_name;
   jstring jresult = (jstring)jenv_->CallObjectMethod(javaObj_, JavaMethods_[JM_WRITE].methodID,
js_data);
 
-  jenv_->DeleteLocalRef(js_data);  
-
   if (jresult != NULL)
   {
     logError(CAT_SQL_HDFS_SEQ_FILE_WRITER, "SequenceFileWriter::write()", jresult);


Mime
View raw message