本文整理汇总了C++中VoltDBEngine::activateTableStream方法的典型用法代码示例。如果您正苦于以下问题:C++ VoltDBEngine::activateTableStream方法的具体用法?C++ VoltDBEngine::activateTableStream怎么用?C++ VoltDBEngine::activateTableStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VoltDBEngine
的用法示例。
在下文中一共展示了VoltDBEngine::activateTableStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serialize_in
/*
* Class: org_voltdb_jni_ExecutionEngine
* Method: nativeActivateTableStream
* Signature: (JIII[B)Z
*/
SHAREDLIB_JNIEXPORT jboolean JNICALL Java_org_voltdb_jni_ExecutionEngine_nativeActivateTableStream(
JNIEnv *env, jobject obj, jlong engine_ptr, jint tableId, jint streamType,
jbyteArray serialized_predicates)
{
VOLT_DEBUG("nativeActivateTableStream in C++ called");
VoltDBEngine *engine = castToEngine(engine_ptr);
Topend *topend = static_cast<JNITopend*>(engine->getTopend())->updateJNIEnv(env);
// deserialize predicates.
jsize length = env->GetArrayLength(serialized_predicates);
VOLT_DEBUG("deserializing %d predicate bytes ...", (int) length);
jbyte *bytes = env->GetByteArrayElements(serialized_predicates, NULL);
ReferenceSerializeInput serialize_in(bytes, length);
try {
try {
voltdb::TableStreamType tableStreamType = static_cast<voltdb::TableStreamType>(streamType);
bool success = engine->activateTableStream(tableId, tableStreamType, serialize_in);
env->ReleaseByteArrayElements(serialized_predicates, bytes, JNI_ABORT);
VOLT_DEBUG("deserialized predicates (success=%d)", (int)success);
return success;
} catch (SerializableEEException &e) {
engine->resetReusedResultOutputBuffer();
e.serialize(engine->getExceptionOutputSerializer());
}
} catch (const FatalException& e) {
topend->crashVoltDB(e);
}
return false;
}
示例2: castToEngine
/*
* Class: org_voltdb_jni_ExecutionEngine
* Method: nativeActivateTableStream
* Signature: (JII)Z
*/
SHAREDLIB_JNIEXPORT jboolean JNICALL Java_org_voltdb_jni_ExecutionEngine_nativeActivateTableStream
(JNIEnv *env, jobject obj, jlong engine_ptr, jint tableId, jint streamType) {
VOLT_DEBUG("nativeActivateTableStream in C++ called");
VoltDBEngine *engine = castToEngine(engine_ptr);
Topend *topend = static_cast<JNITopend*>(engine->getTopend())->updateJNIEnv(env);
try {
return engine->activateTableStream(tableId, static_cast<voltdb::TableStreamType>(streamType));
} catch (FatalException e) {
topend->crashVoltDB(e);
}
return false;
}