Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ComputeNodePath #34272

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ComputeNodePath {

private static final String ROOT_NODE = "nodes/compute_nodes";
private static final String ROOT_NODE = "/nodes/compute_nodes";

private static final String ONLINE_NODE = "online";

Expand All @@ -53,7 +53,7 @@ public final class ComputeNodePath {
* @return compute node root path
*/
public static String getRootPath() {
return String.join("/", "", ROOT_NODE);
return ROOT_NODE;
}

/**
Expand All @@ -62,7 +62,7 @@ public static String getRootPath() {
* @return online root path
*/
public static String getOnlineRootPath() {
return String.join("/", "", ROOT_NODE, ONLINE_NODE);
return String.join("/", getRootPath(), ONLINE_NODE);
}

/**
Expand Down Expand Up @@ -92,7 +92,7 @@ public static String getOnlinePath(final String instanceId, final InstanceType i
* @return show process list trigger root path
*/
public static String getShowProcessListTriggerRootPath() {
return String.join("/", "", ROOT_NODE, SHOW_PROCESS_LIST_TRIGGER_NODE);
return String.join("/", ROOT_NODE, SHOW_PROCESS_LIST_TRIGGER_NODE);
}

/**
Expand All @@ -112,7 +112,7 @@ public static String getShowProcessListTriggerPath(final String instanceId, fina
* @return kill process trigger root path
*/
public static String getKillProcessTriggerRootPath() {
return String.join("/", "", ROOT_NODE, KILL_PROCESS_TRIGGER_NODE);
return String.join("/", ROOT_NODE, KILL_PROCESS_TRIGGER_NODE);
}

/**
Expand All @@ -133,7 +133,7 @@ public static String getKillProcessTriggerPath(final String instanceId, final St
* @return state path
*/
public static String getStatePath(final String instanceId) {
return String.join("/", "", ROOT_NODE, STATUS_NODE, instanceId);
return String.join("/", ROOT_NODE, STATUS_NODE, instanceId);
}

/**
Expand All @@ -142,7 +142,7 @@ public static String getStatePath(final String instanceId) {
* @return worker ID root path
*/
public static String getWorkerIdRootPath() {
return String.join("/", "", ROOT_NODE, WORKER_ID_NODE);
return String.join("/", ROOT_NODE, WORKER_ID_NODE);
}

/**
Expand All @@ -162,7 +162,7 @@ public static String getWorkerIdPath(final String instanceId) {
* @return labels path
*/
public static String getLabelsPath(final String instanceId) {
return String.join("/", "", ROOT_NODE, LABELS_NODE, instanceId);
return String.join("/", ROOT_NODE, LABELS_NODE, instanceId);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ public Collection<Type> getSubscribedTypes() {
@Override
public void handle(final ContextManager contextManager, final DataChangedEvent event) {
Matcher matcher = getShowProcessListTriggerMatcher(event);
if (!matcher.find()) {
return;
if (matcher.find()) {
handle(contextManager, event, matcher);
}
}

private void handle(final ContextManager contextManager, final DataChangedEvent event, final Matcher matcher) {
String instanceId = matcher.group(1);
String taskId = matcher.group(2);
if (Type.ADDED == event.getType()) {
Expand Down
Loading