@Override public void set_data(String path, byte[] data, List<ACL> acls) { stateStorage.set_data(path, data, acls); }
@Override public void setCredentials(String stormId, Credentials creds, Map<String, Object> topoConf) { List<ACL> aclList = ClusterUtils.mkTopoReadOnlyAcls(topoConf); String path = ClusterUtils.credentialsPath(stormId); stateStorage.set_data(path, Utils.serialize(creds), aclList); }
@Override public void setTopologyLogConfig(String stormId, LogConfig logConfig, Map<String, Object> topoConf) { stateStorage.mkdirs(ClusterUtils.LOGCONFIG_SUBTREE, defaultAcls); stateStorage.set_data(ClusterUtils.logConfigPath(stormId), Utils.serialize(logConfig), ClusterUtils.mkTopoReadOnlyAcls(topoConf)); }
@Override public void addPrivateWorkerKey(WorkerTokenServiceType type, String topologyId, long keyVersion, PrivateWorkerKey key) { assert context.getDaemonType() == DaemonType.NIMBUS; stateStorage.mkdirs(ClusterUtils.SECRET_KEYS_SUBTREE, defaultAcls); List<ACL> secretAcls = context.getZkSecretAcls(type); String path = ClusterUtils.secretKeysPath(type, topologyId, keyVersion); LOG.info("Storing private key for {} connecting to a {} at {} with ACL {}", topologyId, type, path, secretAcls); stateStorage.set_data(path, Utils.serialize(key), secretAcls); }
@Override public void setWorkerProfileRequest(String stormId, ProfileRequest profileRequest) { ProfileAction profileAction = profileRequest.get_action(); String host = profileRequest.get_nodeInfo().get_node(); Long port = profileRequest.get_nodeInfo().get_port_iterator().next(); String path = ClusterUtils.profilerConfigPath(stormId, host, port, profileAction); stateStorage.set_data(path, Utils.serialize(profileRequest), defaultAcls); }
@Override public void activateStorm(String stormId, StormBase stormBase, Map<String, Object> topoConf) { String path = ClusterUtils.stormPath(stormId); stateStorage.mkdirs(ClusterUtils.STORMS_SUBTREE, defaultAcls); stateStorage.set_data(path, Utils.serialize(stormBase), ClusterUtils.mkTopoReadOnlyAcls(topoConf)); this.assignmentsBackend.keepStormId(stormBase.get_name(), stormId); }
@Override public void setAssignment(String stormId, Assignment info, Map<String, Object> topoConf) { byte[] serAssignment = Utils.serialize(info); stateStorage.mkdirs(ClusterUtils.ASSIGNMENTS_SUBTREE, defaultAcls); stateStorage.set_data(ClusterUtils.assignmentPath(stormId), Utils.serialize(info), ClusterUtils.mkTopoReadOnlyAcls(topoConf)); this.assignmentsBackend.keepOrUpdateAssignment(stormId, info); }
stateStorage.mkdirs(path, defaultAcls); stateStorage.create_sequential(path + ClusterUtils.ZK_SEPERATOR + "e", serData, defaultAcls); stateStorage.set_data(lastErrorPath, serData, defaultAcls); List<String> childrens = stateStorage.get_children(path, false);
newElems.set_status(stormBase.get_status()); stateStorage.set_data(ClusterUtils.stormPath(stormId), Utils.serialize(newElems), defaultAcls);
@Override public void setCredentials(String stormId, Credentials creds, Map topoConf) { List<ACL> aclList = ClusterUtils.mkTopoReadOnlyAcls(topoConf); String path = ClusterUtils.credentialsPath(stormId); stateStorage.set_data(path, Utils.serialize(creds), aclList); }
@Override public void activateStorm(String stormId, StormBase stormBase, Map<String, Object> topoConf) { String path = ClusterUtils.stormPath(stormId); stateStorage.mkdirs(ClusterUtils.STORMS_SUBTREE, acls); stateStorage.set_data(path, Utils.serialize(stormBase), ClusterUtils.mkTopoReadOnlyAcls(topoConf)); }
@Override public void setTopologyLogConfig(String stormId, LogConfig logConfig, Map<String, Object> topoConf) { stateStorage.mkdirs(ClusterUtils.LOGCONFIG_SUBTREE, acls); stateStorage.set_data(ClusterUtils.logConfigPath(stormId), Utils.serialize(logConfig), ClusterUtils.mkTopoReadOnlyAcls(topoConf)); }
@Override public void setAssignment(String stormId, Assignment info, Map<String, Object> topoConf) { stateStorage.mkdirs(ClusterUtils.ASSIGNMENTS_SUBTREE, acls); stateStorage.set_data(ClusterUtils.assignmentPath(stormId), Utils.serialize(info), ClusterUtils.mkTopoReadOnlyAcls(topoConf)); }
@Override public void setWorkerProfileRequest(String stormId, ProfileRequest profileRequest) { ProfileAction profileAction = profileRequest.get_action(); String host = profileRequest.get_nodeInfo().get_node(); Long port = profileRequest.get_nodeInfo().get_port_iterator().next(); String path = ClusterUtils.profilerConfigPath(stormId, host, port, profileAction); stateStorage.set_data(path, Utils.serialize(profileRequest), acls); }
stateStorage.mkdirs(path, acls); stateStorage.create_sequential(path + ClusterUtils.ZK_SEPERATOR + "e", serData, acls); stateStorage.set_data(lastErrorPath, serData, acls); List<String> childrens = stateStorage.get_children(path, false);
newElems.set_status(stormBase.get_status()); stateStorage.set_data(ClusterUtils.stormPath(stormId), Utils.serialize(newElems), acls);