MesosStateService.java 文件源码

java
阅读 15 收藏 0 点赞 0 评论 0

项目:elastic-job-cloud 作者:
/**
 * 查找执行器信息.
 * 
 * @param appName 作业云配置App的名字
 * @return 执行器信息
 * @throws JSONException 解析JSON格式异常
 */
public Collection<ExecutorStateInfo> executors(final String appName) throws JSONException {
    return Collections2.transform(findExecutors(fetch(stateUrl).getJSONArray("frameworks"), appName), new Function<JSONObject, ExecutorStateInfo>() {
        @Override
        public ExecutorStateInfo apply(final JSONObject input) {
            try {
                return ExecutorStateInfo.builder().id(getExecutorId(input)).slaveId(input.getString("slave_id")).build();
            } catch (final JSONException ex) {
                throw new RuntimeException(ex);
            }
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号