MCPcopy Create free account
hub / github.com/apple/foundationdb / createDatabase

Method createDatabase

bindings/java/JavaWorkload.cpp:480–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478 }
479
480 jobject createDatabase(jobject workload, FDBDatabase* db) {
481 auto executor = env->CallObjectMethod(workload,
482 getMethod(getClass("com/apple/foundationdb/testing/AbstractWorkload"),
483 "getExecutor",
484 "()Ljava/util/concurrent/Executor;"));
485 auto databaseClass = getClass("com/apple/foundationdb/FDBDatabase");
486 jlong databasePtr = reinterpret_cast<jlong>(db);
487 jobject javaDatabase = env->NewObject(databaseClass,
488 getMethod(databaseClass, "<init>", "(JLjava/util/concurrent/Executor;)V"),
489 databasePtr,
490 executor);
491 env->DeleteLocalRef(executor);
492 return javaDatabase;
493 }
494
495 void callWorkload(jobject workload, FDBDatabase* db, const char* method, GenericPromise<bool>&& promise) {
496 jobject jPromise = nullptr;

Callers

nothing calls this directly

Calls 1

getMethodFunction · 0.85

Tested by

no test coverage detected