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

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

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

Utils.secureRandomLong介绍

暂无

代码示例

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

private static String generateZookeeperDigestSecretPayload() {
  return Utils.secureRandomLong() + ":" + Utils.secureRandomLong();
}

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

@Override
public void execute(Tuple input, BasicOutputCollector collector) {
  long id = Utils.secureRandomLong();
  List<Object> toEmit = new ArrayList<Object>();
  toEmit.add(id);
  toEmit.addAll(input.getValues());
  collector.emit(toEmit);
}

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

private Map<String, Object> withSaslConf(Map<String, Object> stormConf) {
  stormConf.put(Config.STORM_MESSAGING_NETTY_AUTHENTICATION, true);
  stormConf.put(Config.TOPOLOGY_NAME, "topo1-netty-sasl");
  stormConf.put(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD, Utils.secureRandomLong() + ":" + Utils.secureRandomLong());
  return stormConf;
}

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

@Override
public void open(Map<String, Object> conf, TopologyContext context, SpoutOutputCollector collector) {
  _delegate.open(conf, context, new SpoutOutputCollector(new StreamOverrideCollector(collector)));
  _outputTasks = new ArrayList<>();
  for (String component : Utils.get(context.getThisTargets(),
                   _coordStream,
                   new HashMap<String, Grouping>()).keySet()) {
    _outputTasks.addAll(context.getComponentTasks(component));
  }
  _rand = new Random(Utils.secureRandomLong());
}

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

this.sampler = ConfigUtils.mkStatsSampler(topoConf);
this.isDebug = ObjectReader.getBoolean(topoConf.get(Config.TOPOLOGY_DEBUG), false);
this.rand = new Random(Utils.secureRandomLong());
this.credentials = credentials;
this.hasEventLoggers = StormCommon.hasEventLoggers(topoConf);

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

private static String generateZookeeperDigestSecretPayload() {
  return Utils.secureRandomLong() + ":" + Utils.secureRandomLong();
}

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

@Override
public void execute(Tuple input, BasicOutputCollector collector) {
  long id = Utils.secureRandomLong();
  List<Object> toEmit = new ArrayList<Object>();
  toEmit.add(id);
  toEmit.addAll(input.getValues());
  collector.emit(toEmit);
}

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

@Override
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
  _delegate.open(conf, context, new SpoutOutputCollector(new StreamOverrideCollector(collector)));
  _outputTasks = new ArrayList<>();
  for(String component: Utils.get(context.getThisTargets(),
                  _coordStream,
                  new HashMap<String, Grouping>()).keySet()) {
    _outputTasks.addAll(context.getComponentTasks(component));
  }
  _rand = new Random(Utils.secureRandomLong());
}

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

@Override
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
  _rand = new Random(Utils.secureRandomLong());
  _state = TransactionalState.newCoordinatorState(conf, (String) conf.get(Config.TOPOLOGY_TRANSACTIONAL_ID), _spout.getComponentConfiguration());
  _coordinatorState = new RotatingTransactionalState(_state, META_DIR, true);
  _collector = collector;
  _coordinator = _spout.getCoordinator(conf, context);
  _currTransaction = getStoredCurrTransaction(_state);
  _maxTransactionActive = Utils.getInt(conf.get(Config.TOPOLOGY_MAX_SPOUT_PENDING), 1);
  _initializer = new StateInitializer();
}

相关文章

Utils类方法