MCPcopy Create free account
hub / github.com/baidu/tera / NativeOpenTable

Function NativeOpenTable

src/sdk/java/native-src/jni_tera_client.cc:201–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201JNIEXPORT jlong NativeOpenTable(JNIEnv* env, jobject jobj, jlong jclient_ptr, jstring jtablename) {
202 tera::Client* client = reinterpret_cast<tera::Client*>(jclient_ptr);
203 tera::Table* table;
204 std::string tablename = reinterpret_cast<const char*>(env->GetStringUTFChars(jtablename, NULL));
205 tera::ErrorCode error_code;
206 std::string msg;
207 if (client == NULL) {
208 msg = "tera client not initialized.";
209 SendErrorJ(env, jobj, msg);
210 return 0;
211 }
212 table = client->OpenTable(tablename, &error_code);
213 if (table == NULL) {
214 msg = "failed to open table, reason: " + error_code.GetReason();
215 SendErrorJ(env, jobj, msg);
216 return 0;
217 }
218 jlong jtable = reinterpret_cast<uint64_t>(table);
219 return jtable;
220}
221
222JNIEXPORT jstring
223NativeGetTableDescriptor(JNIEnv* env, jobject jobj, jlong jclient_ptr, jstring jtablename) {

Callers

nothing calls this directly

Calls 4

SendErrorJFunction · 0.85
GetStringUTFCharsMethod · 0.80
OpenTableMethod · 0.45
GetReasonMethod · 0.45

Tested by

no test coverage detected