devmadhuu commented on code in PR #6360:
URL: https://github.com/apache/ozone/pull/6360#discussion_r1550252558
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1642,4 +1642,34 @@ private ReentrantReadWriteLock.WriteLock writeLock() {
private ReentrantReadWriteLock.ReadLock readLock() {
return lock.readLock();
}
+
+ /**
+ * This API allows removal of only DECOMMISSIONED and DEAD nodes from
NodeManager data structures and cleanup memory.
+ * This API call is having a pre-condition before removal of node like
following resources to be removed:
+ * --- pipelines
+ * --- containers
+ * --- network topology
+ * --- or any other cache related to node context in SCM
+ *
+ * @param datanodeDetails
+ * @throws NodeNotFoundException
+ */
+ @Override
+ public void removeNode(DatanodeDetails datanodeDetails) throws
NodeNotFoundException, IOException {
+ writeLock().lock();
+ try {
+ NodeStatus nodeStatus = this.getNodeStatus(datanodeDetails);
+ if (datanodeDetails.isDecommissioned() || nodeStatus.isDead()) {
Review Comment:
ok, will not allow `in-maintanance` node from Recon as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]