| 174 | // TODO: Understand what's happening, remove, and use JniUtil::CallJniMethod |
| 175 | template <typename T, typename R> |
| 176 | Status CallJniMethod(const jobject& obj, const jmethodID& method, const T& arg, |
| 177 | R* response) { |
| 178 | JNIEnv* jni_env = JniUtil::GetJNIEnv(); |
| 179 | jbyteArray request_bytes; |
| 180 | JniLocalFrame jni_frame; |
| 181 | RETURN_IF_ERROR(jni_frame.push(jni_env)); |
| 182 | RETURN_IF_ERROR(SerializeThriftMsg(jni_env, &arg, &request_bytes)); |
| 183 | jbyteArray result_bytes = static_cast<jbyteArray>( |
| 184 | jni_env->CallObjectMethod(obj, method, request_bytes)); |
| 185 | RETURN_ERROR_IF_EXC(jni_env); |
| 186 | RETURN_IF_ERROR(DeserializeThriftMsg(jni_env, result_bytes, response)); |
| 187 | return Status::OK(); |
| 188 | } |
| 189 | |
| 190 | Status ExternalDataSourceExecutor::Open(const TOpenParams& params, TOpenResult* result) { |
| 191 | DCHECK(is_initialized_); |
no test coverage detected