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

Method init

bindings/java/JavaWorkload.cpp:543–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541
542 std::string description() const override { return name; }
543 bool init(FDBWorkloadContext* context) override {
544 this->context = context;
545 try {
546 std::string classPath = context->getOption("classPath", std::string(""));
547 std::vector<std::string> paths;
548 boost::split(paths, classPath, boost::is_any_of(";,"), boost::token_compress_on);
549 for (const auto& path : paths) {
550 jvm->addToClassPath(path);
551 }
552 jvm->init();
553 jobject jContext = jvm->createWorkloadContext(context);
554 if (jContext == nullptr) {
555 failed = true;
556 return failed;
557 }
558 workload = jvm->createWorkload(jContext, name);
559 } catch (JNIError& e) {
560 failed = true;
561 log.trace(error, "JNIError", { { "Location", e.location() }, { "Error", e.toString() } });
562 }
563 return failed;
564 };
565 void setup(FDBDatabase* db, GenericPromise<bool> done) override {
566 if (failed) {
567 done.send(false);

Callers

nothing calls this directly

Calls 9

splitFunction · 0.85
addToClassPathMethod · 0.80
createWorkloadContextMethod · 0.80
createWorkloadMethod · 0.80
getOptionMethod · 0.45
initMethod · 0.45
traceMethod · 0.45
locationMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected