org.apache.storm.utils.Utils.readAndLogStream()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.apache.storm.utils.Utils.readAndLogStream()方法的一些代码示例,展示了Utils.readAndLogStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.readAndLogStream()方法的具体详情如下:
包路径:org.apache.storm.utils.Utils
类名称:Utils
方法名:readAndLogStream

Utils.readAndLogStream介绍

暂无

代码示例

代码示例来源:origin: apache/storm

public static int processLauncherAndWait(Map<String, Object> conf, String user, List<String> args,
                     final Map<String, String> environment, final String logPreFix)
  throws IOException {
  int ret = 0;
  Process process = processLauncher(conf, user, null, args, environment, logPreFix, null, null);
  if (StringUtils.isNotBlank(logPreFix)) {
    Utils.readAndLogStream(logPreFix, process.getInputStream());
  }
  try {
    process.waitFor();
  } catch (InterruptedException e) {
    LOG.info("{} interrupted.", logPreFix);
  }
  ret = process.exitValue();
  return ret;
}

代码示例来源:origin: apache/storm

public Long call() {
    if (logPrefix != null) {
      Utils.readAndLogStream(logPrefix,
                  process.getInputStream());
    }
    if (exitCodeCallback != null) {
      try {
        process.waitFor();
        exitCodeCallback.call(process.exitValue());
      } catch (InterruptedException ie) {
        LOG.info("{} interrupted", logPrefix);
        exitCodeCallback.call(-1);
      }
    }
    return null; // Run only once.
  }
});

代码示例来源:origin: org.apache.storm/storm-core

public static int processLauncherAndWait(Map<String, Object> conf, String user, List<String> args, final Map<String, String> environment, final String logPreFix)
    throws IOException {
  int ret = 0;
  Process process = processLauncher(conf, user, null, args, environment, logPreFix, null, null);
  if (StringUtils.isNotBlank(logPreFix))
    Utils.readAndLogStream(logPreFix, process.getInputStream());
  try {
    process.waitFor();
  } catch (InterruptedException e) {
    LOG.info("{} interrupted.", logPreFix);
  }
  ret = process.exitValue();
  return ret;
}

代码示例来源:origin: org.apache.storm/storm-core

public Object call() {
    if (logPrefix != null ) {
      Utils.readAndLogStream(logPrefix,
          process.getInputStream());
    }
    if (exitCodeCallback != null) {
      try {
        process.waitFor();
        exitCodeCallback.call(process.exitValue());
      } catch (InterruptedException ie) {
        LOG.info("{} interrupted", logPrefix);
        exitCodeCallback.call(-1);
      }
    }
    return null; // Run only once.
  }
});

相关文章

微信公众号

最新文章

更多

Utils类方法