本文整理汇总了Java中org.apache.flink.runtime.clusterframework.messages.InfoMessage类的典型用法代码示例。如果您正苦于以下问题:Java InfoMessage类的具体用法?Java InfoMessage怎么用?Java InfoMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InfoMessage类属于org.apache.flink.runtime.clusterframework.messages包,在下文中一共展示了InfoMessage类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendInfoMessage
import org.apache.flink.runtime.clusterframework.messages.InfoMessage; //导入依赖的package包/类
public void sendInfoMessage(final String message) {
getRpcService().execute(new Runnable() {
@Override
public void run() {
InfoMessage infoMessage = new InfoMessage(message);
for (InfoMessageListenerRpcGateway listenerRpcGateway : infoMessageListeners.values()) {
listenerRpcGateway
.notifyInfoMessage(infoMessage);
}
}
});
}
示例2: getNewMessages
import org.apache.flink.runtime.clusterframework.messages.InfoMessage; //导入依赖的package包/类
@Override
public List<String> getNewMessages() {
List<String> ret = new ArrayList<>();
// get messages from ApplicationClient (locally)
while (true) {
Object result;
try {
Future<Object> response =
Patterns.ask(
applicationClient.get(),
YarnMessages.getLocalGetYarnMessage(),
new Timeout(akkaDuration));
result = Await.result(response, akkaDuration);
} catch (Exception ioe) {
LOG.warn("Error retrieving the YARN messages locally", ioe);
break;
}
if (!(result instanceof Option)) {
throw new RuntimeException("LocalGetYarnMessage requires a response of type " +
"Option. Instead the response is of type " + result.getClass() + ".");
} else {
Option messageOption = (Option) result;
LOG.debug("Received message option {}", messageOption);
if (messageOption.isEmpty()) {
break;
} else {
Object obj = messageOption.get();
if (obj instanceof InfoMessage) {
InfoMessage msg = (InfoMessage) obj;
ret.add("[" + msg.date() + "] " + msg.message());
} else {
LOG.warn("LocalGetYarnMessage returned unexpected type: " + messageOption);
}
}
}
}
return ret;
}
示例3: sendInfoMessage
import org.apache.flink.runtime.clusterframework.messages.InfoMessage; //导入依赖的package包/类
protected void sendInfoMessage(String message) {
for (ActorRef listener : infoMessageListeners) {
listener.tell(decorateMessage(new InfoMessage(message)), self());
}
}
示例4: getNewMessages
import org.apache.flink.runtime.clusterframework.messages.InfoMessage; //导入依赖的package包/类
@Override
public List<String> getNewMessages() {
if (hasBeenShutdown()) {
throw new RuntimeException(
"The YarnClusterClient has already been stopped");
}
if (!isConnected) {
throw new IllegalStateException(
"The cluster has been connected to the ApplicationMaster.");
}
List<String> ret = new ArrayList<String>();
// get messages from ApplicationClient (locally)
while (true) {
Object result;
try {
Future<Object> response = Patterns.ask(
applicationClient.get(),
YarnMessages.getLocalGetYarnMessage(),
new Timeout(akkaDuration));
result = Await.result(response, akkaDuration);
} catch (Exception ioe) {
LOG.warn("Error retrieving the YARN messages locally", ioe);
break;
}
if (!(result instanceof Option)) {
throw new RuntimeException(
"LocalGetYarnMessage requires a response of type "
+ "Option. Instead the response is of type " + result.getClass()
+ ".");
} else {
Option messageOption = (Option) result;
LOG.debug("Received message option {}", messageOption);
if (messageOption.isEmpty()) {
break;
} else {
Object obj = messageOption.get();
if (obj instanceof InfoMessage) {
InfoMessage msg = (InfoMessage) obj;
ret.add("[" + msg.date() + "] " + msg.message());
} else {
LOG.warn("LocalGetYarnMessage returned unexpected type: "
+ messageOption);
}
}
}
}
return ret;
}
示例5: notifyInfoMessage
import org.apache.flink.runtime.clusterframework.messages.InfoMessage; //导入依赖的package包/类
/**
* Notifies when resource manager need to notify listener about InfoMessage
* @param infoMessage
*/
void notifyInfoMessage(InfoMessage infoMessage);