| 653 | } |
| 654 | |
| 655 | inline Status HBaseTableScanner::GetValue(JNIEnv* env, jobject cell, |
| 656 | void** data, int* length) { |
| 657 | int offset = env->CallIntMethod(cell, cell_get_value_offset_id_); |
| 658 | RETURN_ERROR_IF_EXC(env); |
| 659 | *length = env->CallIntMethod(cell, cell_get_value_length_id_); |
| 660 | RETURN_ERROR_IF_EXC(env); |
| 661 | jbyteArray jdata = |
| 662 | (jbyteArray) env->CallObjectMethod(cell, cell_get_value_array_); |
| 663 | RETURN_ERROR_IF_EXC(env); |
| 664 | *data = value_pool_->TryAllocate(*length); |
| 665 | if (UNLIKELY(*data == NULL)) { |
| 666 | string details = Substitute(HBASE_MEM_LIMIT_EXCEEDED, "GetValue", |
| 667 | *length, "value array"); |
| 668 | return value_pool_->mem_tracker()->MemLimitExceeded(state_, details, *length); |
| 669 | } |
| 670 | env->GetByteArrayRegion(jdata, offset, *length, reinterpret_cast<jbyte*>(*data)); |
| 671 | RETURN_ERROR_IF_EXC(env); |
| 672 | COUNTER_ADD(scan_node_->bytes_read_counter(), *length); |
| 673 | return Status::OK(); |
| 674 | } |
| 675 | |
| 676 | Status HBaseTableScanner::GetRowKey(JNIEnv* env, void** key, int* key_length) { |
| 677 | JniLocalFrame jni_frame; |