本文整理汇总了Java中backtype.storm.utils.Utils.secureRandomLong方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.secureRandomLong方法的具体用法?Java Utils.secureRandomLong怎么用?Java Utils.secureRandomLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backtype.storm.utils.Utils
的用法示例。
在下文中一共展示了Utils.secureRandomLong方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@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);
Object active = conf.get(Config.TOPOLOGY_MAX_SPOUT_PENDING);
if (active == null) {
_maxTransactionActive = 1;
} else {
_maxTransactionActive = Utils.getInt(active);
}
_initializer = new StateInitializer();
}
示例2: open
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@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);
Object active = conf.get(Config.TOPOLOGY_MAX_SPOUT_PENDING);
if (active == null) {
_maxTransactionActive = 1;
} else {
_maxTransactionActive = Utils.getInt(active);
}
_initializer = new StateInitializer();
}
示例3: open
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
_delegate.open(conf, context, new SpoutOutputCollector(new StreamOverrideCollector(collector)));
_outputTasks = new ArrayList<Integer>();
for(String component: Utils.get(context.getThisTargets(),
_coordStream,
new HashMap<String, Grouping>()).keySet()) {
_outputTasks.addAll(context.getComponentTasks(component));
}
_rand = new Random(Utils.secureRandomLong());
}
示例4: execute
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@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);
}
示例5: open
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@Override
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
_delegate.open(conf, context, new SpoutOutputCollector(new StreamOverrideCollector(collector)));
_outputTasks = new ArrayList<Integer>();
for (String component : Utils.get(context.getThisTargets(), _coordStream, new HashMap<String, Grouping>()).keySet()) {
_outputTasks.addAll(context.getComponentTasks(component));
}
_rand = new Random(Utils.secureRandomLong());
}
示例6: execute
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@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);
}
示例7: generateId
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@Deprecated
public static long generateId() {
return Utils.secureRandomLong();
}
示例8: generateId
import backtype.storm.utils.Utils; //导入方法依赖的package包/类
@Deprecated
public static long generateId() {
return Utils.secureRandomLong();
}