| 174 | } |
| 175 | |
| 176 | JNIEXPORT jlong NativeScan(JNIEnv* env, jobject jobj, jlong jtable, jlong jdesc) { |
| 177 | tera::Table* table = reinterpret_cast<tera::Table*>(jtable); |
| 178 | tera::ScanDescriptor* desc = reinterpret_cast<tera::ScanDescriptor*>(jdesc); |
| 179 | tera::ErrorCode error_code; |
| 180 | |
| 181 | if (table == NULL || desc == NULL) { |
| 182 | SendErrorJ(env, jobj, "table or scan descriptor not initialized."); |
| 183 | return 0; |
| 184 | } |
| 185 | |
| 186 | tera::ResultStream* result_stream; |
| 187 | if ((result_stream = table->Scan(*desc, &error_code)) == NULL) { |
| 188 | LOG(ERROR) << "fail to scan records from table: " << table->GetName(); |
| 189 | return 0; |
| 190 | } |
| 191 | |
| 192 | return reinterpret_cast<jlong>(result_stream); |
| 193 | } |
nothing calls this directly
no test coverage detected