本文整理汇总了C++中MesosExecutorDriver::sendFrameworkMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ MesosExecutorDriver::sendFrameworkMessage方法的具体用法?C++ MesosExecutorDriver::sendFrameworkMessage怎么用?C++ MesosExecutorDriver::sendFrameworkMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MesosExecutorDriver
的用法示例。
在下文中一共展示了MesosExecutorDriver::sendFrameworkMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*
* Class: mesos_MesosExecutorDriver
* Method: sendFrameworkMessage
* Signature: (Lmesos/FrameworkMessage;)I
*/
JNIEXPORT jint JNICALL Java_mesos_MesosExecutorDriver_sendFrameworkMessage
(JNIEnv *env, jobject thiz, jobject jmessage)
{
// Construct a C++ FrameworkMessage from the Java FrameworkMessage.
FrameworkMessage message = construct<FrameworkMessage>(env, jmessage);
// Now invoke the underlying driver.
jclass clazz = env->GetObjectClass(thiz);
jfieldID __driver = env->GetFieldID(clazz, "__driver", "J");
MesosExecutorDriver *driver = (MesosExecutorDriver *)
env->GetLongField(thiz, __driver);
return driver->sendFrameworkMessage(message);
}
示例2: temp
/*
* Class: org_apache_mesos_MesosExecutorDriver
* Method: sendFrameworkMessage
* Signature: ([B)I
*/
JNIEXPORT jint JNICALL Java_org_apache_mesos_MesosExecutorDriver_sendFrameworkMessage
(JNIEnv* env, jobject thiz, jbyteArray jdata)
{
// Construct a C++ string from the Java byte array.
jbyte* data = env->GetByteArrayElements(jdata, NULL);
jsize length = env->GetArrayLength(jdata);
string temp((char*) data, (size_t) length);
env->ReleaseByteArrayElements(jdata, data, 0);
// Now invoke the underlying driver.
jclass clazz = env->GetObjectClass(thiz);
jfieldID __driver = env->GetFieldID(clazz, "__driver", "J");
MesosExecutorDriver* driver =
(MesosExecutorDriver*) env->GetLongField(thiz, __driver);
return driver->sendFrameworkMessage(temp);
}