private static String generateZookeeperDigestSecretPayload() { return Utils.secureRandomLong() + ":" + Utils.secureRandomLong(); }
@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); }
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; }
@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()); }
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);
private static String generateZookeeperDigestSecretPayload() { return Utils.secureRandomLong() + ":" + Utils.secureRandomLong(); }
@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); }
@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()); }
@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(); }