org.apache.hadoop.tools.rumen.ZombieJob.getNextRandomSeed()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(102)

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

ZombieJob.getNextRandomSeed介绍

暂无

代码示例

代码示例来源:origin: ch.cern.hadoop/hadoop-rumen

private long makeUpRuntimeCore(LoggedDiscreteCDF loggedDiscreteCDF) {
 CDFRandomGenerator interpolator;
 synchronized (interpolatorMap) {
  interpolator = interpolatorMap.get(loggedDiscreteCDF);
 }
 if (interpolator == null) {
  if (loggedDiscreteCDF.getNumberValues() == 0) {
   throw new NoValueToMakeUpRuntime("no value to use to make up runtime");
  }
  interpolator =
    hasRandomSeed ? new CDFPiecewiseLinearRandomGenerator(
      loggedDiscreteCDF, getNextRandomSeed())
      : new CDFPiecewiseLinearRandomGenerator(loggedDiscreteCDF);
  /*
   * It doesn't matter if we compute and store an interpolator twice because
   * the two instances will be semantically identical and stateless, unless
   * we're seeded, in which case we're not stateless but this code will be
   * called synchronizedly.
   */
  synchronized (interpolatorMap) {
   interpolatorMap.put(loggedDiscreteCDF, interpolator);
  }
 }
 return interpolator.randomValue();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-rumen

private long makeUpRuntimeCore(LoggedDiscreteCDF loggedDiscreteCDF) {
 CDFRandomGenerator interpolator;
 synchronized (interpolatorMap) {
  interpolator = interpolatorMap.get(loggedDiscreteCDF);
 }
 if (interpolator == null) {
  if (loggedDiscreteCDF.getNumberValues() == 0) {
   throw new NoValueToMakeUpRuntime("no value to use to make up runtime");
  }
  interpolator =
    hasRandomSeed ? new CDFPiecewiseLinearRandomGenerator(
      loggedDiscreteCDF, getNextRandomSeed())
      : new CDFPiecewiseLinearRandomGenerator(loggedDiscreteCDF);
  /*
   * It doesn't matter if we compute and store an interpolator twice because
   * the two instances will be semantically identical and stateless, unless
   * we're seeded, in which case we're not stateless but this code will be
   * called synchronizedly.
   */
  synchronized (interpolatorMap) {
   interpolatorMap.put(loggedDiscreteCDF, interpolator);
  }
 }
 return interpolator.randomValue();
}

相关文章