-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add action queue for data nodes and queued removal * implement wait for completed bus event * add change log * add queue status to frontend * add bulk start/stop * adjust test for removing multiple nodes * add queue field to entity test * integrated bulk action endpoints * action_queue status styling * cleanup mocks * add tests for removing multiple * fixed requested wordings and typos --------- Co-authored-by: Mohamed Ould Hocine <[email protected]> Co-authored-by: Mohamed OULD HOCINE <[email protected]> Co-authored-by: Laura <[email protected]>
- Loading branch information
1 parent
64a3b0d
commit 76ee116
Showing
22 changed files
with
508 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type = "a" | ||
message = "add bulk management capabilities for data nodes" | ||
|
||
issues = ["17732"] | ||
pulls = ["18121"] | ||
|
62 changes: 62 additions & 0 deletions
62
data-node/src/main/java/org/graylog/datanode/management/ClusterNodeStateTracer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
package org.graylog.datanode.management; | ||
|
||
import org.graylog.datanode.process.ProcessEvent; | ||
import org.graylog.datanode.process.ProcessState; | ||
import org.graylog.datanode.process.StateMachineTracer; | ||
import org.graylog2.cluster.NodeNotFoundException; | ||
import org.graylog2.cluster.nodes.DataNodeDto; | ||
import org.graylog2.cluster.nodes.NodeService; | ||
import org.graylog2.datanode.DataNodeLifecycleTrigger; | ||
import org.graylog2.plugin.system.NodeId; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class ClusterNodeStateTracer implements StateMachineTracer { | ||
|
||
private final Logger log = LoggerFactory.getLogger(ClusterNodeStateTracer.class); | ||
|
||
private final NodeService<DataNodeDto> nodeService; | ||
private final NodeId nodeId; | ||
|
||
public ClusterNodeStateTracer(NodeService<DataNodeDto> nodeService, NodeId nodeId) { | ||
this.nodeService = nodeService; | ||
this.nodeId = nodeId; | ||
} | ||
|
||
@Override | ||
public void trigger(ProcessEvent processEvent) { | ||
} | ||
|
||
@Override | ||
public void transition(ProcessEvent processEvent, ProcessState source, ProcessState destination) { | ||
try { | ||
if (!source.equals(destination)) { | ||
log.info("Updating cluster node {} from {} to {} (reason: {})", nodeId.getNodeId(), | ||
source.getDataNodeStatus(), destination.getDataNodeStatus(), processEvent.name()); | ||
DataNodeDto node = nodeService.byNodeId(nodeId); | ||
nodeService.update(node.toBuilder() | ||
.setDataNodeStatus(destination.getDataNodeStatus()) | ||
.setActionQueue(DataNodeLifecycleTrigger.CLEAR) | ||
.build()); | ||
} | ||
} catch (NodeNotFoundException e) { | ||
throw new RuntimeException("Node not registered, this should not happen."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.