| 48 | } |
| 49 | |
| 50 | void HBaseTable::Close(RuntimeState* state) { |
| 51 | // If this has already been closed then return out early. |
| 52 | if (table_ == NULL) return; |
| 53 | |
| 54 | JNIEnv* env = JniUtil::GetJNIEnv(); |
| 55 | if (env == NULL) { |
| 56 | state->LogError(ErrorMsg( |
| 57 | TErrorCode::GENERAL, "HBaseTable::Close(): Error creating JNIEnv")); |
| 58 | } else { |
| 59 | env->CallObjectMethod(table_, table_close_id_); |
| 60 | Status s = JniUtil::GetJniExceptionMsg(env, true, "HBaseTable::Close(): "); |
| 61 | if (!s.ok()) state->LogError(s.msg()); |
| 62 | env->DeleteGlobalRef(table_); |
| 63 | } |
| 64 | |
| 65 | table_ = NULL; |
| 66 | } |
| 67 | |
| 68 | Status HBaseTable::Init() { |
| 69 | JNIEnv* env = JniUtil::GetJNIEnv(); |