当前位置: 首页>>代码示例>>Java>>正文


Java InfoMessage类代码示例

本文整理汇总了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);
			}
		}
	});
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:13,代码来源:ResourceManager.java

示例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;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:42,代码来源:YarnClusterClient.java

示例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());
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:FlinkResourceManager.java

示例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;
}
 
开发者ID:hopshadoop,项目名称:hopsworks,代码行数:54,代码来源:YarnClusterClient.java

示例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);
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:InfoMessageListenerRpcGateway.java


注:本文中的org.apache.flink.runtime.clusterframework.messages.InfoMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。