Repository: impala
Updated Branches:
  refs/heads/master c6ce735d1 -> 5c541b960


IMPALA-7421. Static methods use wrong JNI call function

Various places throughout the code were using the JNI CallObjectMethod
function when in fact they should have been using
CallStaticObjectMethod. It appears that this doesn't cause crashes in
release builds, but if running with -Xcheck:jni, it causes an assertion
failure:

   guarantee(method->size_of_parameters() == size_of_parameters())
      failed: wrong no. of arguments pushed

This patch cleans up JniUtil a bit to add a "fluent" style utility for
calling JNI functions. This calling style should make the above mistake
more obvious because it forces the caller to write 'on_class(...)' for
static methods and 'on_instance(...)' for instance methods.

Change-Id: If7cde6ca91613b63afe5307f4d819fb24cb17fd6
Reviewed-on: http://gerrit.cloudera.org:8080/11181
Reviewed-by: Bharath Vissapragada <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


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

Branch: refs/heads/master
Commit: 547423007b82c8181be277842f092bfd86f5b720
Parents: c6ce735
Author: Todd Lipcon <[email protected]>
Authored: Thu Aug 9 21:48:53 2018 -0700
Committer: Todd Lipcon <[email protected]>
Committed: Tue Aug 28 23:40:52 2018 +0000

----------------------------------------------------------------------
 be/src/common/init.cc            |   1 +
 be/src/common/status.h           |   2 +-
 be/src/service/fe-support.h      |   2 -
 be/src/service/frontend.cc       |  20 +--
 be/src/util/backend-gflag-util.h |   3 +-
 be/src/util/jni-util.cc          |  18 ++-
 be/src/util/jni-util.h           | 255 ++++++++++++++++++++++++++--------
 be/src/util/logging-support.cc   |  14 +-
 be/src/util/logging-support.h    |   1 -
 be/src/util/zip-util.cc          |   3 +-
 be/src/util/zip-util.h           |   3 +-
 11 files changed, 223 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/common/init.cc
----------------------------------------------------------------------
diff --git a/be/src/common/init.cc b/be/src/common/init.cc
index bc1065b..ed61fe4 100644
--- a/be/src/common/init.cc
+++ b/be/src/common/init.cc
@@ -41,6 +41,7 @@
 #include "util/debug-util.h"
 #include "util/decimal-util.h"
 #include "util/disk-info.h"
+#include "util/jni-util.h"
 #include "util/logging-support.h"
 #include "util/mem-info.h"
 #include "util/memory-metrics.h"

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/common/status.h
----------------------------------------------------------------------
diff --git a/be/src/common/status.h b/be/src/common/status.h
index b211376..3c0a7e5 100644
--- a/be/src/common/status.h
+++ b/be/src/common/status.h
@@ -105,7 +105,7 @@ class NODISCARD Status {
 
   /// Move constructor that moves the error message (if any) and resets 
'other' to the
   /// default OK Status.
-  ALWAYS_INLINE Status(Status&& other) : msg_(other.msg_) { other.msg_ = NULL; 
}
+  ALWAYS_INLINE Status(Status&& other) noexcept : msg_(other.msg_) { 
other.msg_ = NULL; }
 
   /// Status using only the error code as a parameter. This can be used for 
error messages
   /// that don't take format parameters.

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/service/fe-support.h
----------------------------------------------------------------------
diff --git a/be/src/service/fe-support.h b/be/src/service/fe-support.h
index 11ad18b..2e17196 100644
--- a/be/src/service/fe-support.h
+++ b/be/src/service/fe-support.h
@@ -18,8 +18,6 @@
 #ifndef IMPALA_SERVICE_FE_SUPPORT_H
 #define IMPALA_SERVICE_FE_SUPPORT_H
 
-#include "util/jni-util.h"
-
 namespace impala {
 
 /// InitFeSupport registers native functions with JNI. When the java

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/service/frontend.cc
----------------------------------------------------------------------
diff --git a/be/src/service/frontend.cc b/be/src/service/frontend.cc
index aec92f7..af45d96 100644
--- a/be/src/service/frontend.cc
+++ b/be/src/service/frontend.cc
@@ -224,23 +224,9 @@ Status Frontend::GetExplainPlan(
 Status Frontend::ValidateSettings() {
   // Use FE to check Hadoop config setting
   // TODO: check OS setting
-  stringstream ss;
-  JNIEnv* jni_env = getJNIEnv();
-  JniLocalFrame jni_frame;
-  RETURN_IF_ERROR(jni_frame.push(jni_env));
-  jstring error_string =
-      static_cast<jstring>(jni_env->CallObjectMethod(fe_, check_config_id_));
-  RETURN_ERROR_IF_EXC(jni_env);
-  jboolean is_copy;
-  const char *str = jni_env->GetStringUTFChars(error_string, &is_copy);
-  RETURN_ERROR_IF_EXC(jni_env);
-  ss << str;
-  jni_env->ReleaseStringUTFChars(error_string, str);
-  RETURN_ERROR_IF_EXC(jni_env);
-
-  if (ss.str().size() > 0) {
-    return Status(ss.str());
-  }
+  string err;
+  RETURN_IF_ERROR(JniCall::instance_method(fe_, check_config_id_).Call(&err));
+  if (!err.empty()) return Status(err);
   return Status::OK();
 }
 

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/util/backend-gflag-util.h
----------------------------------------------------------------------
diff --git a/be/src/util/backend-gflag-util.h b/be/src/util/backend-gflag-util.h
index 796a2d5..d68ed2f 100644
--- a/be/src/util/backend-gflag-util.h
+++ b/be/src/util/backend-gflag-util.h
@@ -18,8 +18,9 @@
 #ifndef UTIL_BACKEND_CONFIG_H_
 #define UTIL_BACKEND_CONFIG_H_
 
+#include <jni.h>
+
 #include "common/status.h"
-#include "util/jni-util.h"
 
 namespace impala {
 

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/util/jni-util.cc
----------------------------------------------------------------------
diff --git a/be/src/util/jni-util.cc b/be/src/util/jni-util.cc
index 19e4e10..3e5beac 100644
--- a/be/src/util/jni-util.cc
+++ b/be/src/util/jni-util.cc
@@ -220,13 +220,9 @@ Status JniUtil::InitJvmPauseMonitor() {
   JniMethodDescriptor init_jvm_pm_desc = {
       "initPauseMonitor", "(J)V", &init_jvm_pm_method};
   RETURN_IF_ERROR(JniUtil::LoadStaticJniMethod(env, jni_util_cl_, 
&init_jvm_pm_desc));
-  JNIEnv* jni_env = getJNIEnv();
-  JniLocalFrame jni_frame;
-  RETURN_IF_ERROR(jni_frame.push(jni_env));
-  jni_env->CallObjectMethod(
-      jni_util_cl_, init_jvm_pm_method, 
FLAGS_jvm_deadlock_detector_interval_s);
-  RETURN_ERROR_IF_EXC(jni_env);
-  return Status::OK();
+  return JniCall::static_method(jni_util_cl_, init_jvm_pm_method)
+      .with_primitive_arg(FLAGS_jvm_deadlock_detector_interval_s)
+      .Call();
 }
 
 Status JniUtil::GetJniExceptionMsg(JNIEnv* env, bool log_stack, const string& 
prefix) {
@@ -266,16 +262,18 @@ Status JniUtil::GetJniExceptionMsg(JNIEnv* env, bool 
log_stack, const string& pr
 
 Status JniUtil::GetJvmMemoryMetrics(const TGetJvmMemoryMetricsRequest& request,
     TGetJvmMemoryMetricsResponse* result) {
-  return JniUtil::CallJniMethod(jni_util_class(), get_jvm_metrics_id_, 
request, result);
+  return JniCall::static_method(jni_util_class(), get_jvm_metrics_id_)
+      .with_thrift_arg(request).Call(result);
 }
 
 Status JniUtil::GetJvmThreadsInfo(const TGetJvmThreadsInfoRequest& request,
     TGetJvmThreadsInfoResponse* result) {
-  return JniUtil::CallJniMethod(jni_util_class(), get_jvm_threads_id_, 
request, result);
+  return JniCall::static_method(jni_util_class(), get_jvm_threads_id_)
+      .with_thrift_arg(request).Call(result);
 }
 
 Status JniUtil::GetJMXJson(TGetJMXJsonResponse* result) {
-  return JniUtil::CallJniMethod(jni_util_class(), get_jmx_json_, result);
+  return JniCall::static_method(jni_util_class(), get_jmx_json_).Call(result);
 }
 
 Status JniUtil::LoadJniMethod(JNIEnv* env, const jclass& jni_class,

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/util/jni-util.h
----------------------------------------------------------------------
diff --git a/be/src/util/jni-util.h b/be/src/util/jni-util.h
index fd87839..c4030a4 100644
--- a/be/src/util/jni-util.h
+++ b/be/src/util/jni-util.h
@@ -25,6 +25,7 @@
 
 #include "common/status.h"
 #include "gen-cpp/Frontend_types.h"
+#include "gutil/macros.h"
 
 #define THROW_IF_ERROR_WITH_LOGGING(stmt, env, adaptor) \
   do { \
@@ -120,6 +121,11 @@ class JniLocalFrame {
   JniLocalFrame(): env_(NULL) {}
   ~JniLocalFrame() { if (env_ != NULL) env_->PopLocalFrame(NULL); }
 
+  JniLocalFrame(JniLocalFrame&& other) noexcept
+    : env_(other.env_) {
+    other.env_ = nullptr;
+  }
+
   /// Pushes a new JNI local frame. The frame can support max_local_ref local 
references.
   /// The number of local references created inside the frame might exceed 
max_local_ref,
   /// but there is no guarantee that memory will be available.
@@ -127,6 +133,8 @@ class JniLocalFrame {
   Status push(JNIEnv* env, int max_local_ref = 10) WARN_UNUSED_RESULT;
 
  private:
+  DISALLOW_COPY_AND_ASSIGN(JniLocalFrame);
+
   JNIEnv* env_;
 };
 
@@ -197,6 +205,86 @@ class JniScopedArrayCritical {
   DISALLOW_COPY_AND_ASSIGN(JniScopedArrayCritical);
 };
 
+/// Utility class for making JNI calls, with various types of argument
+/// or response.
+///
+/// Example usages:
+///
+/// 1) Static call taking a Thrift struct and returning a string:
+///
+///   string s;
+///   RETURN_IF_ERROR(JniCall::static_method(my_jclass, my_method)
+///       .with_thrift_arg(foo).Call(&s));
+///
+/// 2) Non-static call taking no arguments and returning a Thrift struct:
+///
+///   TMyObject result;
+///   RETURN_IF_ERROR(JniCall::instance_method(my_jobject, 
my_method).Call(&result);
+class JniCall {
+ public:
+   JniCall(JniCall&& other) noexcept = default;
+
+   static JniCall static_method(jclass clazz, jmethodID method) 
WARN_UNUSED_RESULT {
+     return JniCall(method, clazz);
+   }
+
+   static JniCall instance_method(jobject obj, jmethodID method) 
WARN_UNUSED_RESULT {
+     return JniCall(method, obj);
+   }
+
+  /// Pass a Thrift-encoded argument. The JNI method should take a byte[] for 
the
+  /// Thrift-serialized data. Multiple arguments may be passed by repeated 
calls.
+  template<class T>
+  JniCall& with_thrift_arg(const T& arg) WARN_UNUSED_RESULT;
+
+  /// Pass a primitive arg (eg an integer).
+  /// Multiple arguments may be passed by repeated calls.
+  template<class T>
+  JniCall& with_primitive_arg(T arg) WARN_UNUSED_RESULT;
+
+  /// Call the method expecting no result.
+  Status Call() WARN_UNUSED_RESULT {
+    return Call(static_cast<void*>(nullptr));
+  }
+
+  /// Call the method and return a result (either std::string or a Thrift 
struct).
+  template<class T>
+  Status Call(T* result) WARN_UNUSED_RESULT;
+
+ private:
+  explicit JniCall(jmethodID method)
+    : method_(method),
+      env_(getJNIEnv()) {
+    status_ = frame_.push(env_);
+  }
+
+  explicit JniCall(jmethodID method, jclass cls) : JniCall(method) {
+    class_ = DCHECK_NOTNULL(cls);
+  }
+
+  explicit JniCall(jmethodID method, jobject instance) : JniCall(method) {
+    instance_ = DCHECK_NOTNULL(instance);
+  }
+
+  template<class T>
+  Status ObjectToResult(jobject obj, T* result) WARN_UNUSED_RESULT;
+
+  Status ObjectToResult(jobject obj, void* no_result) WARN_UNUSED_RESULT;
+
+  Status ObjectToResult(jobject obj, std::string* result) WARN_UNUSED_RESULT;
+
+  const jmethodID method_;
+  JNIEnv* const env_;
+  JniLocalFrame frame_;
+
+  jclass class_ = nullptr;
+  jobject instance_ = nullptr;
+  std::vector<jvalue> args_;
+  Status status_;
+
+  DISALLOW_COPY_AND_ASSIGN(JniCall);
+};
+
 
 /// Utility class for JNI-related functionality.
 /// Init() should be called as soon as the native library is loaded.
@@ -306,74 +394,28 @@ class JniUtil {
       JniMethodDescriptor* descriptor) WARN_UNUSED_RESULT;
 
   /// Utility methods to avoid repeating lots of the JNI call boilerplate.
+  /// New code should prefer using JniCall() directly for better clarity.
   static Status CallJniMethod(
       const jobject& obj, const jmethodID& method) WARN_UNUSED_RESULT {
-    JNIEnv* jni_env = getJNIEnv();
-    JniLocalFrame jni_frame;
-    RETURN_IF_ERROR(jni_frame.push(jni_env));
-    jni_env->CallObjectMethod(obj, method);
-    RETURN_ERROR_IF_EXC(jni_env);
-    return Status::OK();
+    return JniCall::instance_method(obj, method).Call();
   }
 
-  template <typename T>
-  static Status CallJniMethod(const jobject& obj, const jmethodID& method, 
const T& arg) {
-    JNIEnv* jni_env = getJNIEnv();
-    jbyteArray request_bytes;
-    JniLocalFrame jni_frame;
-    RETURN_IF_ERROR(jni_frame.push(jni_env));
-    RETURN_IF_ERROR(SerializeThriftMsg(jni_env, &arg, &request_bytes));
-    jni_env->CallObjectMethod(obj, method, request_bytes);
-    RETURN_ERROR_IF_EXC(jni_env);
-    return Status::OK();
+  static Status CallStaticJniMethod(
+      const jclass& cls, const jmethodID& method) WARN_UNUSED_RESULT {
+    return JniCall::static_method(cls, method).Call();
   }
 
-  template <typename R>
-  static Status CallJniMethod(const jobject& obj, const jmethodID& method, R* 
response) {
-    JNIEnv* jni_env = getJNIEnv();
-    JniLocalFrame jni_frame;
-    RETURN_IF_ERROR(jni_frame.push(jni_env));
-    jbyteArray result_bytes = static_cast<jbyteArray>(
-        jni_env->CallObjectMethod(obj, method));
-    RETURN_ERROR_IF_EXC(jni_env);
-    RETURN_IF_ERROR(DeserializeThriftMsg(jni_env, result_bytes, response));
-    return Status::OK();
-  }
+  template <typename T>
+  static Status CallJniMethod(const jobject& obj, const jmethodID& method,
+      const T& arg) WARN_UNUSED_RESULT;
 
   template <typename T, typename R>
   static Status CallJniMethod(const jobject& obj, const jmethodID& method,
-      const T& arg, R* response) {
-    JNIEnv* jni_env = getJNIEnv();
-    jbyteArray request_bytes;
-    JniLocalFrame jni_frame;
-    RETURN_IF_ERROR(jni_frame.push(jni_env));
-    RETURN_IF_ERROR(SerializeThriftMsg(jni_env, &arg, &request_bytes));
-    jbyteArray result_bytes = static_cast<jbyteArray>(
-        jni_env->CallObjectMethod(obj, method, request_bytes));
-    RETURN_ERROR_IF_EXC(jni_env);
-    RETURN_IF_ERROR(DeserializeThriftMsg(jni_env, result_bytes, response));
-    return Status::OK();
-  }
+      const T& arg, R* response) WARN_UNUSED_RESULT;
 
-  template <typename T>
+  template <typename R>
   static Status CallJniMethod(const jobject& obj, const jmethodID& method,
-      const T& arg, std::string* response) {
-    JNIEnv* jni_env = getJNIEnv();
-    jbyteArray request_bytes;
-    JniLocalFrame jni_frame;
-    RETURN_IF_ERROR(jni_frame.push(jni_env));
-    RETURN_IF_ERROR(SerializeThriftMsg(jni_env, &arg, &request_bytes));
-    jstring java_response_string = static_cast<jstring>(
-        jni_env->CallObjectMethod(obj, method, request_bytes));
-    RETURN_ERROR_IF_EXC(jni_env);
-    jboolean is_copy;
-    const char *str = jni_env->GetStringUTFChars(java_response_string, 
&is_copy);
-    RETURN_ERROR_IF_EXC(jni_env);
-    *response = str;
-    jni_env->ReleaseStringUTFChars(java_response_string, str);
-    RETURN_ERROR_IF_EXC(jni_env);
-    return Status::OK();
-  }
+      R* response) WARN_UNUSED_RESULT;
 
  private:
   // Set in Init() once the JVM is initialized.
@@ -387,6 +429,105 @@ class JniUtil {
   static jmethodID get_jmx_json_;
 };
 
+/// Convert a C++ primitive to a JNI 'jvalue' union.
+/// See 
https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/types.html
+/// for reference on the union members.
+template<typename T>
+jvalue PrimitiveToValue(T cpp_val);
+
+#define SPECIALIZE_PRIMITIVE_TO_VALUE(cpp_type, union_field)    \
+  template<> inline jvalue PrimitiveToValue(cpp_type cpp_val) { \
+    jvalue v;                                                   \
+    memset(&v, 0, sizeof(v));                                    \
+    v.union_field = cpp_val;                                    \
+    return v;                                                   \
+  }
+SPECIALIZE_PRIMITIVE_TO_VALUE(bool, z);
+SPECIALIZE_PRIMITIVE_TO_VALUE(int8_t, b);
+SPECIALIZE_PRIMITIVE_TO_VALUE(char, c);
+SPECIALIZE_PRIMITIVE_TO_VALUE(int16_t, s);
+SPECIALIZE_PRIMITIVE_TO_VALUE(int32_t, i);
+SPECIALIZE_PRIMITIVE_TO_VALUE(int64_t, j);
+SPECIALIZE_PRIMITIVE_TO_VALUE(float, f);
+SPECIALIZE_PRIMITIVE_TO_VALUE(double, d);
+#undef SPECIALIZE_PRIMITIVE_TO_VALUE
+
+template <typename T>
+inline Status JniUtil::CallJniMethod(const jobject& obj, const jmethodID& 
method,
+    const T& arg) {
+  return JniCall::instance_method(obj, method).with_thrift_arg(arg).Call();
+}
+
+template <typename T, typename R>
+inline Status JniUtil::CallJniMethod(const jobject& obj, const jmethodID& 
method,
+    const T& arg, R* response) {
+  return JniCall::instance_method(obj, 
method).with_thrift_arg(arg).Call(response);
+}
+
+template <typename R>
+inline Status JniUtil::CallJniMethod(const jobject& obj, const jmethodID& 
method,
+    R* response) {
+  return JniCall::instance_method(obj, method).Call(response);
+}
+
+template<class T>
+inline JniCall& JniCall::with_thrift_arg(const T& arg) {
+  if (!status_.ok()) return *this;
+  jbyteArray bytes;
+  status_ = SerializeThriftMsg(env_, &arg, &bytes);
+  if (status_.ok()) {
+    jvalue arg;
+    memset(&arg, 0, sizeof(arg));
+    arg.l = bytes;
+    args_.emplace_back(arg);
+  }
+  return *this;
+}
+template<class T>
+inline JniCall& JniCall::with_primitive_arg(T arg) {
+  if (!status_.ok()) return *this;
+  args_.emplace_back(PrimitiveToValue(arg));
+  return *this;
+}
+
+template<class T>
+inline Status JniCall::Call(T* result) {
+  RETURN_IF_ERROR(status_);
+  DCHECK((instance_ != nullptr) ^ (class_ != nullptr));
+
+  // Even if the function takes no arguments, it's OK to pass an array here.
+  // The JNI API doesn't take a length and just assumes that you've passed
+  // an appropriate number of elements.
+  jobject ret;
+  if (class_) {
+    ret = env_->CallStaticObjectMethodA(class_, method_, args_.data());
+  } else {
+    ret = env_->CallObjectMethodA(instance_, method_, args_.data());
+  }
+  RETURN_ERROR_IF_EXC(env_);
+  RETURN_IF_ERROR(ObjectToResult(ret, result));
+  return Status::OK();
+}
+
+template<class T>
+inline Status JniCall::ObjectToResult(jobject obj, T* result) {
+  DCHECK(obj) << "Call returned unexpected null Thrift object";
+  RETURN_IF_ERROR(DeserializeThriftMsg(env_, static_cast<jbyteArray>(obj), 
result));
+  return Status::OK();
+}
+
+inline Status JniCall::ObjectToResult(jobject obj, void* no_result) {
+  return Status::OK();
+}
+
+inline Status JniCall::ObjectToResult(jobject obj, std::string* result) {
+  DCHECK(obj) << "Call returned unexpected null String instance";
+  JniUtfCharGuard utf;
+  RETURN_IF_ERROR(JniUtfCharGuard::create(env_, static_cast<jstring>(obj), 
&utf));
+  *result = utf.get();;
+  return Status::OK();
+}
+
 }
 
 #endif

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/util/logging-support.cc
----------------------------------------------------------------------
diff --git a/be/src/util/logging-support.cc b/be/src/util/logging-support.cc
index c037eb7..457c8f9 100644
--- a/be/src/util/logging-support.cc
+++ b/be/src/util/logging-support.cc
@@ -24,6 +24,7 @@
 
 #include "common/logging.h"
 #include "rpc/jni-thrift-util.h"
+#include "util/jni-util.h"
 #include "util/webserver.h"
 
 #include "common/names.h"
@@ -134,15 +135,12 @@ void InitDynamicLoggingSupport() {
 // Helper method to get the log level of given Java class. It is a JNI wrapper 
around
 // GlogAppender.getLogLevel().
 Status GetJavaLogLevel(const TGetJavaLogLevelParams& params, string* result) {
-  RETURN_IF_ERROR(
-      JniUtil::CallJniMethod(log4j_logger_class_, get_log_level_method, 
params, result));
-  return Status::OK();
+  return JniCall::static_method(log4j_logger_class_, get_log_level_method)
+      .with_thrift_arg(params).Call(result);
 }
 
 Status ResetJavaLogLevels() {
-  RETURN_IF_ERROR(
-      JniUtil::CallJniMethod(log4j_logger_class_, reset_log_levels_method));
-  return Status::OK();
+  return JniCall::static_method(log4j_logger_class_, 
reset_log_levels_method).Call();
 }
 
 // Callback handler for /get_java_loglevel.
@@ -181,8 +179,8 @@ void SetJavaLogLevelCallback(const Webserver::ArgumentMap& 
args, Document* docum
   string result;
   params.__set_class_name(classname->second);
   params.__set_log_level(level->second);
-  Status status =
-      JniUtil::CallJniMethod(log4j_logger_class_, set_log_level_method, 
params, &result);
+  Status status = JniCall::static_method(log4j_logger_class_, 
set_log_level_method)
+    .with_thrift_arg(params).Call(&result);
   if (!status.ok()) {
     AddDocumentMember(status.GetDetail(), "error", document);
     return;

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/util/logging-support.h
----------------------------------------------------------------------
diff --git a/be/src/util/logging-support.h b/be/src/util/logging-support.h
index 87579af..2e7b73c 100644
--- a/be/src/util/logging-support.h
+++ b/be/src/util/logging-support.h
@@ -18,7 +18,6 @@
 #ifndef IMPALA_UTIL_LOGGING_SUPPORT_H
 #define IMPALA_UTIL_LOGGING_SUPPORT_H
 
-#include "util/jni-util.h"
 #include "gen-cpp/Logging_types.h"
 
 namespace impala {

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/util/zip-util.cc
----------------------------------------------------------------------
diff --git a/be/src/util/zip-util.cc b/be/src/util/zip-util.cc
index b8777fa..f6e1f15 100644
--- a/be/src/util/zip-util.cc
+++ b/be/src/util/zip-util.cc
@@ -42,7 +42,8 @@ Status ZipUtil::ExtractFiles(const string& archive_file, 
const string& destinati
   TExtractFromZipParams params;
   params.archive_file = archive_file;
   params.destination_dir = destination_dir;
-  return JniUtil::CallJniMethod(zip_util_class_, extract_files_method, params);
+  return JniCall::static_method(zip_util_class_, extract_files_method)
+      .with_thrift_arg(params).Call();
 }
 
 }

http://git-wip-us.apache.org/repos/asf/impala/blob/54742300/be/src/util/zip-util.h
----------------------------------------------------------------------
diff --git a/be/src/util/zip-util.h b/be/src/util/zip-util.h
index 3674ba9..959753b 100644
--- a/be/src/util/zip-util.h
+++ b/be/src/util/zip-util.h
@@ -20,7 +20,8 @@
 
 #include <string>
 
-#include "util/jni-util.h"
+#include <jni.h>
+
 #include "common/status.h"
 
 namespace impala {

Reply via email to