public TransactionalStateZkStorage(Map conf, String id, String subroot) { try { conf = new HashMap(conf); String transactionalRoot = (String) conf.get(Config.TRANSACTIONAL_ZOOKEEPER_ROOT); String rootDir = transactionalRoot + "/" + id + "/" + subroot; List<String> servers = (List<String>) getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_SERVERS, Config.STORM_ZOOKEEPER_SERVERS); Object port = getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_PORT, Config.STORM_ZOOKEEPER_PORT); ZookeeperAuthInfo auth = new ZookeeperAuthInfo(conf); CuratorFramework initter = Utils.newCuratorStarted(conf, servers, port, auth); _zkAcls = Utils.getWorkerACL(conf); try { createNode(initter, transactionalRoot, null, null, null); } catch (KeeperException.NodeExistsException ignored) { } try { createNode(initter, rootDir, null, _zkAcls, null); } catch (KeeperException.NodeExistsException ignored) { } initter.close(); _curator = Utils.newCuratorStarted(conf, servers, port, rootDir, auth); } catch (Exception e) { throw new RuntimeException(e); } }
Object port = getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_PORT, Config.STORM_ZOOKEEPER_PORT); ZookeeperAuthInfo auth = new ZookeeperAuthInfo(conf); CuratorFramework initter = Utils.newCuratorStarted(conf, servers, port, auth); _zkAcls = Utils.getWorkerACL(conf); try { _curator = Utils.newCuratorStarted(conf, servers, port, rootDir, auth); _ser = new KryoValuesSerializer(conf); _des = new KryoValuesDeserializer(conf);
protected TransactionalState(Map conf, String id, Map componentConf, String subroot) { try { conf = new HashMap(conf); // ensure that the serialization registrations are consistent with the declarations in this spout if(componentConf!=null) { conf.put(Config.TOPOLOGY_KRYO_REGISTER, componentConf .get(Config.TOPOLOGY_KRYO_REGISTER)); } String rootDir = conf.get(Config.TRANSACTIONAL_ZOOKEEPER_ROOT) + "/" + id + "/" + subroot; List<String> servers = (List<String>) getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_SERVERS, Config.STORM_ZOOKEEPER_SERVERS); Object port = getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_PORT, Config.STORM_ZOOKEEPER_PORT); CuratorFramework initter = Utils.newCuratorStarted(conf, servers, port); try { initter.create().creatingParentsIfNeeded().forPath(rootDir); } catch(KeeperException.NodeExistsException e) { } initter.close(); _curator = Utils.newCuratorStarted(conf, servers, port, rootDir); _ser = new KryoValuesSerializer(conf); _des = new KryoValuesDeserializer(conf); } catch (Exception e) { throw new RuntimeException(e); } }
protected TransactionalState(Map conf, String id, String subroot) { try { conf = new HashMap(conf); String rootDir = conf.get(Config.TRANSACTIONAL_ZOOKEEPER_ROOT) + "/" + id + "/" + subroot; List<String> servers = (List<String>) getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_SERVERS, Config.STORM_ZOOKEEPER_SERVERS); Object port = getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_PORT, Config.STORM_ZOOKEEPER_PORT); CuratorFramework initter = Utils.newCuratorStarted(conf, servers, port); try { initter.create().creatingParentsIfNeeded().forPath(rootDir); } catch(KeeperException.NodeExistsException e) { } initter.close(); _curator = Utils.newCuratorStarted(conf, servers, port, rootDir); } catch (Exception e) { throw new RuntimeException(e); } }
protected TransactionalState(Map conf, String id, Map componentConf, String subroot) { try { conf = new HashMap(conf); // ensure that the serialization registrations are consistent with the declarations in this spout if(componentConf!=null) { conf.put(Config.TOPOLOGY_KRYO_REGISTER, componentConf .get(Config.TOPOLOGY_KRYO_REGISTER)); } String rootDir = conf.get(Config.TRANSACTIONAL_ZOOKEEPER_ROOT) + "/" + id + "/" + subroot; List<String> servers = (List<String>) getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_SERVERS, Config.STORM_ZOOKEEPER_SERVERS); Object port = getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_PORT, Config.STORM_ZOOKEEPER_PORT); CuratorFramework initter = Utils.newCuratorStarted(conf, servers, port); try { initter.create().creatingParentsIfNeeded().forPath(rootDir); } catch(KeeperException.NodeExistsException e) { } initter.close(); _curator = Utils.newCuratorStarted(conf, servers, port, rootDir); _ser = new KryoValuesSerializer(conf); _des = new KryoValuesDeserializer(conf); } catch (Exception e) { throw new RuntimeException(e); } }
public TransactionalStateZkStorage(Map conf, String id, String subroot) { try { conf = new HashMap(conf); String transactionalRoot = (String) conf.get(Config.TRANSACTIONAL_ZOOKEEPER_ROOT); String rootDir = transactionalRoot + "/" + id + "/" + subroot; List<String> servers = (List<String>) getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_SERVERS, Config.STORM_ZOOKEEPER_SERVERS); Object port = getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_PORT, Config.STORM_ZOOKEEPER_PORT); ZookeeperAuthInfo auth = new ZookeeperAuthInfo(conf); CuratorFramework initter = Utils.newCuratorStarted(conf, servers, port, auth); _zkAcls = Utils.getWorkerACL(conf); try { createNode(initter, transactionalRoot, null, null, null); } catch (KeeperException.NodeExistsException e) { } try { createNode(initter, rootDir, null, _zkAcls, null); } catch (KeeperException.NodeExistsException e) { } initter.close(); _curator = Utils.newCuratorStarted(conf, servers, port, rootDir, auth); } catch (Exception e) { throw new RuntimeException(e); } }
protected TransactionalState(Map conf, String id, Map componentConf, String subroot) { try { conf = new HashMap(conf); // ensure that the serialization registrations are consistent with the declarations in this spout if (componentConf != null) { conf.put(Config.TOPOLOGY_KRYO_REGISTER, componentConf.get(Config.TOPOLOGY_KRYO_REGISTER)); } String transactionalRoot = (String) conf.get(Config.TRANSACTIONAL_ZOOKEEPER_ROOT); String rootDir = transactionalRoot + "/" + id + "/" + subroot; List<String> servers = (List<String>) getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_SERVERS, Config.STORM_ZOOKEEPER_SERVERS); Object port = getWithBackup(conf, Config.TRANSACTIONAL_ZOOKEEPER_PORT, Config.STORM_ZOOKEEPER_PORT); ZookeeperAuthInfo auth = new ZookeeperAuthInfo(conf); CuratorFramework initter = Utils.newCuratorStarted(conf, servers, port, auth); _zkAcls = Utils.getWorkerACL(conf); try { TransactionalState.createNode(initter, transactionalRoot, null, null, null); } catch (KeeperException.NodeExistsException e) { } try { TransactionalState.createNode(initter, rootDir, null, _zkAcls, null); } catch (KeeperException.NodeExistsException e) { } initter.close(); _curator = Utils.newCuratorStarted(conf, servers, port, rootDir, auth); _ser = new KryoValuesSerializer(conf); _des = new KryoValuesDeserializer(conf); } catch (Exception e) { throw new RuntimeException(e); } }