public static String profilerConfigPath(String stormId, String host, Long port, ProfileAction requestType) { return profilerConfigPath(stormId) + ZK_SEPERATOR + host + "_" + port + "_" + requestType; }
@Override public List<ProfileRequest> getTopologyProfileRequests(String stormId) { List<ProfileRequest> profileRequests = new ArrayList<>(); String path = ClusterUtils.profilerConfigPath(stormId); if (stateStorage.node_exists(path, false)) { List<String> strs = stateStorage.get_children(path, false); for (String str : strs) { String childPath = path + ClusterUtils.ZK_SEPERATOR + str; byte[] raw = stateStorage.get_data(childPath, false); ProfileRequest request = ClusterUtils.maybeDeserialize(raw, ProfileRequest.class); if (request != null) { profileRequests.add(request); } } } return profileRequests; }
@Override public void deleteTopologyProfileRequests(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.delete_node(path); }
@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 removeStorm(String stormId) { stateStorage.delete_node(ClusterUtils.assignmentPath(stormId)); this.assignmentsBackend.clearStateForStorm(stormId); stateStorage.delete_node(ClusterUtils.credentialsPath(stormId)); stateStorage.delete_node(ClusterUtils.logConfigPath(stormId)); stateStorage.delete_node(ClusterUtils.profilerConfigPath(stormId)); removeStormBase(stormId); }
public static String profilerConfigPath(String stormId, String host, Long port, ProfileAction requestType) { return profilerConfigPath(stormId) + ZK_SEPERATOR + host + "_" + port + "_" + requestType; }
@Override public List<ProfileRequest> getTopologyProfileRequests(String stormId) { List<ProfileRequest> profileRequests = new ArrayList<>(); String path = ClusterUtils.profilerConfigPath(stormId); if (stateStorage.node_exists(path, false)) { List<String> strs = stateStorage.get_children(path, false); for (String str : strs) { String childPath = path + ClusterUtils.ZK_SEPERATOR + str; byte[] raw = stateStorage.get_data(childPath, false); ProfileRequest request = ClusterUtils.maybeDeserialize(raw, ProfileRequest.class); if (request != null) profileRequests.add(request); } } return profileRequests; }
@Override public void deleteTopologyProfileRequests(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.delete_node(path); }
@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); }
@Override public void removeStorm(String stormId) { stateStorage.delete_node(ClusterUtils.assignmentPath(stormId)); stateStorage.delete_node(ClusterUtils.credentialsPath(stormId)); stateStorage.delete_node(ClusterUtils.logConfigPath(stormId)); stateStorage.delete_node(ClusterUtils.profilerConfigPath(stormId)); removeStormBase(stormId); }