本文整理汇总了C++中VoltDBEngine::executePlanFragment方法的典型用法代码示例。如果您正苦于以下问题:C++ VoltDBEngine::executePlanFragment方法的具体用法?C++ VoltDBEngine::executePlanFragment怎么用?C++ VoltDBEngine::executePlanFragment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VoltDBEngine
的用法示例。
在下文中一共展示了VoltDBEngine::executePlanFragment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: castToEngine
/*
* Executes a plan fragment of an adhoc query.
* Class: org_voltdb_jni_ExecutionEngine
* Method: nativeExecuteCustomPlanFragment
* Signature: (JLjava/lang/String;JJJ)I
*/
SHAREDLIB_JNIEXPORT jint JNICALL
Java_org_voltdb_jni_ExecutionEngine_nativeExecuteCustomPlanFragment (
JNIEnv *env,
jobject obj,
jlong engine_ptr,
jstring plan,
jint outputDependencyId,
jint inputDependencyId,
jlong txnId,
jlong lastCommittedTxnId,
jlong undoToken) {
int retval = org_voltdb_jni_ExecutionEngine_ERRORCODE_ERROR;
VOLT_DEBUG("nativeExecuteCustomPlanFragment() start");
// setup
VoltDBEngine *engine = castToEngine(engine_ptr);
assert(engine);
Topend *topend = static_cast<JNITopend*>(engine->getTopend())->updateJNIEnv(env);
//JNIEnv pointer can change between calls, must be updated
updateJNILogProxy(engine);
engine->resetReusedResultOutputBuffer();
engine->setUndoToken(undoToken);
static_cast<JNITopend*>(engine->getTopend())->updateJNIEnv(env);
Pool *stringPool = engine->getStringPool();
// convert java plan string to stdc++ string plan
const char *str = static_cast<const char*>(env->GetStringUTFChars(plan,
NULL));
assert(str);
string cppplan = str;
env->ReleaseStringUTFChars(plan, str);
// execute
engine->setUsedParamcnt(0);
try {
retval = engine->executePlanFragment(cppplan, outputDependencyId,
inputDependencyId, txnId,
lastCommittedTxnId);
} catch (FatalException e) {
topend->crashVoltDB(e);
}
// cleanup
stringPool->purge();
return retval;
}