本文整理汇总了C++中VoltDBEngine::getBatchInputDepIdsContainer方法的典型用法代码示例。如果您正苦于以下问题:C++ VoltDBEngine::getBatchInputDepIdsContainer方法的具体用法?C++ VoltDBEngine::getBatchInputDepIdsContainer怎么用?C++ VoltDBEngine::getBatchInputDepIdsContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VoltDBEngine
的用法示例。
在下文中一共展示了VoltDBEngine::getBatchInputDepIdsContainer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serialize_in
/**
* Executes multiple plan fragments with the given parameter sets and gets the results.
* @param pointer the VoltDBEngine pointer
* @param plan_fragment_ids ID of the plan fragment to be executed.
* @param outputBuffer buffer to be filled with the tables.
* @param outputCapacity maximum number of bytes to write to buffer.
* @return error code
*/
SHAREDLIB_JNIEXPORT jint JNICALL Java_org_voltdb_jni_ExecutionEngine_nativeExecuteQueryPlanFragmentsAndGetResults
(JNIEnv *env,
jobject obj,
jlong engine_ptr,
jlongArray plan_fragment_ids,
jint num_fragments,
jintArray input_depIds,
jintArray output_depIds,
jlong txnId,
jlong lastCommittedTxnId,
jlong undoToken) {
//VOLT_DEBUG("nativeExecuteQueryPlanFragmentAndGetResults() start");
// setup
VoltDBEngine *engine = castToEngine(engine_ptr);
assert(engine);
Topend *topend = static_cast<JNITopend*>(engine->getTopend())->updateJNIEnv(env);
try {
updateJNILogProxy(engine); //JNIEnv pointer can change between calls, must be updated
engine->resetReusedResultOutputBuffer();
engine->setUndoToken(undoToken);
static_cast<JNITopend*>(engine->getTopend())->updateJNIEnv(env);
Pool *stringPool = engine->getStringPool();
// fragment info
int batch_size = num_fragments;
assert (batch_size <= MAX_BATCH_COUNT);
jlong* fragment_ids_buffer = engine->getBatchFragmentIdsContainer();
env->GetLongArrayRegion(plan_fragment_ids, 0, batch_size, fragment_ids_buffer);
/** PAVLO **/
// input dep ids
jint* input_depIds_buffer = engine->getBatchInputDepIdsContainer();
env->GetIntArrayRegion(input_depIds, 0, batch_size, input_depIds_buffer);
// output dep ids
jint* output_depIds_buffer = engine->getBatchOutputDepIdsContainer();
env->GetIntArrayRegion(output_depIds, 0, batch_size, output_depIds_buffer);
/** PAVLO **/
// all fragments' parameters are in this buffer
ReferenceSerializeInput serialize_in(engine->getParameterBuffer(), engine->getParameterBufferCapacity());
NValueArray ¶ms = engine->getParameterContainer();
// count failures
int failures = 0;
for (int i = 0; i < batch_size; ++i) {
int cnt = serialize_in.readShort();
if (cnt < 0) {
throwFatalException("parameter count is negative: %d", cnt);
}
assert (cnt < MAX_PARAM_COUNT);
deserializeParameterSetCommon(cnt, serialize_in, params, stringPool);
engine->setUsedParamcnt(cnt);
// success is 0 and error is 1.
if (engine->executeQuery(fragment_ids_buffer[i],
output_depIds_buffer[i],
input_depIds_buffer[i],
params, txnId, lastCommittedTxnId, i == 0,
i == (batch_size - 1)))
{
++failures;
}
}
// cleanup
stringPool->purge();
if (failures > 0)
return org_voltdb_jni_ExecutionEngine_ERRORCODE_ERROR;
else
return org_voltdb_jni_ExecutionEngine_ERRORCODE_SUCCESS;
} catch (FatalException e) {
topend->crashVoltDB(e);
}
return org_voltdb_jni_ExecutionEngine_ERRORCODE_ERROR;
}