hadoop git commit: HDDS-234. Add SCM node report handler. Contributed by Ajay Kumar.
Repository: hadoop Updated Branches: refs/heads/trunk 5ee90efed -> 556d9b36b HDDS-234. Add SCM node report handler. Contributed by Ajay Kumar. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/556d9b36 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/556d9b36 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/556d9b36 Branch: refs/heads/trunk Commit: 556d9b36be4b0b759646b8f6030c9e693b97bdb8 Parents: 5ee90ef Author: Anu Engineer Authored: Thu Jul 12 12:09:31 2018 -0700 Committer: Anu Engineer Committed: Thu Jul 12 12:09:31 2018 -0700 -- .../hadoop/hdds/scm/node/NodeManager.java | 9 ++ .../hadoop/hdds/scm/node/NodeReportHandler.java | 19 +++- .../hadoop/hdds/scm/node/SCMNodeManager.java| 11 +++ .../hdds/scm/container/MockNodeManager.java | 11 +++ .../hdds/scm/node/TestNodeReportHandler.java| 95 .../testutils/ReplicationNodeManagerMock.java | 10 +++ 6 files changed, 152 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/556d9b36/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java -- diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java index 5e2969d..deb1628 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java @@ -17,6 +17,7 @@ */ package org.apache.hadoop.hdds.scm.node; +import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.NodeReportProto; import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeMetric; import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeStat; import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException; @@ -138,4 +139,12 @@ public interface NodeManager extends StorageContainerNodeProtocol, * @param command */ void addDatanodeCommand(UUID dnId, SCMCommand command); + + /** + * Process node report. + * + * @param dnUuid + * @param nodeReport + */ + void processNodeReport(UUID dnUuid, NodeReportProto nodeReport); } http://git-wip-us.apache.org/repos/asf/hadoop/blob/556d9b36/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java -- diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java index aa78d53..331bfed 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java @@ -7,7 +7,7 @@ * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,25 +18,38 @@ package org.apache.hadoop.hdds.scm.node; +import com.google.common.base.Preconditions; +import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.scm.server.SCMDatanodeHeartbeatDispatcher .NodeReportFromDatanode; import org.apache.hadoop.hdds.server.events.EventHandler; import org.apache.hadoop.hdds.server.events.EventPublisher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Handles Node Reports from datanode. */ public class NodeReportHandler implements EventHandler { + private static final Logger LOGGER = LoggerFactory + .getLogger(NodeReportHandler.class); private final NodeManager nodeManager; public NodeReportHandler(NodeManager nodeManager) { +Preconditions.checkNotNull(nodeManager); this.nodeManager = nodeManager; } @Override public void onMessage(NodeReportFromDatanode nodeReportFromDatanode, -EventPublisher publisher) { -//TODO: process node report. + EventPublisher publisher) { +Preconditions.checkNotNull(nodeReportFromDatanode); +DatanodeDetails dn = nodeReportFromDatanode.getDatanodeDetails(); +Preconditions.checkNotNull(dn, "NodeReport is " ++ "missing DatanodeDetails."); +LOGGER.trace("Processing node report for dn: {}", dn); +nodeManager +.processNodeReport(dn.getUuid(), nodeR
[05/32] hadoop git commit: HDDS-234. Add SCM node report handler. Contributed by Ajay Kumar.
HDDS-234. Add SCM node report handler. Contributed by Ajay Kumar. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/556d9b36 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/556d9b36 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/556d9b36 Branch: refs/heads/HDFS-12943 Commit: 556d9b36be4b0b759646b8f6030c9e693b97bdb8 Parents: 5ee90ef Author: Anu Engineer Authored: Thu Jul 12 12:09:31 2018 -0700 Committer: Anu Engineer Committed: Thu Jul 12 12:09:31 2018 -0700 -- .../hadoop/hdds/scm/node/NodeManager.java | 9 ++ .../hadoop/hdds/scm/node/NodeReportHandler.java | 19 +++- .../hadoop/hdds/scm/node/SCMNodeManager.java| 11 +++ .../hdds/scm/container/MockNodeManager.java | 11 +++ .../hdds/scm/node/TestNodeReportHandler.java| 95 .../testutils/ReplicationNodeManagerMock.java | 10 +++ 6 files changed, 152 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/556d9b36/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java -- diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java index 5e2969d..deb1628 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java @@ -17,6 +17,7 @@ */ package org.apache.hadoop.hdds.scm.node; +import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.NodeReportProto; import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeMetric; import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeStat; import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException; @@ -138,4 +139,12 @@ public interface NodeManager extends StorageContainerNodeProtocol, * @param command */ void addDatanodeCommand(UUID dnId, SCMCommand command); + + /** + * Process node report. + * + * @param dnUuid + * @param nodeReport + */ + void processNodeReport(UUID dnUuid, NodeReportProto nodeReport); } http://git-wip-us.apache.org/repos/asf/hadoop/blob/556d9b36/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java -- diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java index aa78d53..331bfed 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java @@ -7,7 +7,7 @@ * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,25 +18,38 @@ package org.apache.hadoop.hdds.scm.node; +import com.google.common.base.Preconditions; +import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.scm.server.SCMDatanodeHeartbeatDispatcher .NodeReportFromDatanode; import org.apache.hadoop.hdds.server.events.EventHandler; import org.apache.hadoop.hdds.server.events.EventPublisher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Handles Node Reports from datanode. */ public class NodeReportHandler implements EventHandler { + private static final Logger LOGGER = LoggerFactory + .getLogger(NodeReportHandler.class); private final NodeManager nodeManager; public NodeReportHandler(NodeManager nodeManager) { +Preconditions.checkNotNull(nodeManager); this.nodeManager = nodeManager; } @Override public void onMessage(NodeReportFromDatanode nodeReportFromDatanode, -EventPublisher publisher) { -//TODO: process node report. + EventPublisher publisher) { +Preconditions.checkNotNull(nodeReportFromDatanode); +DatanodeDetails dn = nodeReportFromDatanode.getDatanodeDetails(); +Preconditions.checkNotNull(dn, "NodeReport is " ++ "missing DatanodeDetails."); +LOGGER.trace("Processing node report for dn: {}", dn); +nodeManager +.processNodeReport(dn.getUuid(), nodeReportFromDatanode.getReport()); } } http://git-wip-us.apache.org/repos/
[12/50] hadoop git commit: HDDS-234. Add SCM node report handler. Contributed by Ajay Kumar.
HDDS-234. Add SCM node report handler. Contributed by Ajay Kumar. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/556d9b36 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/556d9b36 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/556d9b36 Branch: refs/heads/HDFS-13572 Commit: 556d9b36be4b0b759646b8f6030c9e693b97bdb8 Parents: 5ee90ef Author: Anu Engineer Authored: Thu Jul 12 12:09:31 2018 -0700 Committer: Anu Engineer Committed: Thu Jul 12 12:09:31 2018 -0700 -- .../hadoop/hdds/scm/node/NodeManager.java | 9 ++ .../hadoop/hdds/scm/node/NodeReportHandler.java | 19 +++- .../hadoop/hdds/scm/node/SCMNodeManager.java| 11 +++ .../hdds/scm/container/MockNodeManager.java | 11 +++ .../hdds/scm/node/TestNodeReportHandler.java| 95 .../testutils/ReplicationNodeManagerMock.java | 10 +++ 6 files changed, 152 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/556d9b36/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java -- diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java index 5e2969d..deb1628 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java @@ -17,6 +17,7 @@ */ package org.apache.hadoop.hdds.scm.node; +import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.NodeReportProto; import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeMetric; import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeStat; import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException; @@ -138,4 +139,12 @@ public interface NodeManager extends StorageContainerNodeProtocol, * @param command */ void addDatanodeCommand(UUID dnId, SCMCommand command); + + /** + * Process node report. + * + * @param dnUuid + * @param nodeReport + */ + void processNodeReport(UUID dnUuid, NodeReportProto nodeReport); } http://git-wip-us.apache.org/repos/asf/hadoop/blob/556d9b36/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java -- diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java index aa78d53..331bfed 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java @@ -7,7 +7,7 @@ * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,25 +18,38 @@ package org.apache.hadoop.hdds.scm.node; +import com.google.common.base.Preconditions; +import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.scm.server.SCMDatanodeHeartbeatDispatcher .NodeReportFromDatanode; import org.apache.hadoop.hdds.server.events.EventHandler; import org.apache.hadoop.hdds.server.events.EventPublisher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Handles Node Reports from datanode. */ public class NodeReportHandler implements EventHandler { + private static final Logger LOGGER = LoggerFactory + .getLogger(NodeReportHandler.class); private final NodeManager nodeManager; public NodeReportHandler(NodeManager nodeManager) { +Preconditions.checkNotNull(nodeManager); this.nodeManager = nodeManager; } @Override public void onMessage(NodeReportFromDatanode nodeReportFromDatanode, -EventPublisher publisher) { -//TODO: process node report. + EventPublisher publisher) { +Preconditions.checkNotNull(nodeReportFromDatanode); +DatanodeDetails dn = nodeReportFromDatanode.getDatanodeDetails(); +Preconditions.checkNotNull(dn, "NodeReport is " ++ "missing DatanodeDetails."); +LOGGER.trace("Processing node report for dn: {}", dn); +nodeManager +.processNodeReport(dn.getUuid(), nodeReportFromDatanode.getReport()); } } http://git-wip-us.apache.org/repos/
[35/50] [abbrv] hadoop git commit: HDDS-234. Add SCM node report handler. Contributed by Ajay Kumar.
HDDS-234. Add SCM node report handler. Contributed by Ajay Kumar. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/556d9b36 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/556d9b36 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/556d9b36 Branch: refs/heads/YARN-7402 Commit: 556d9b36be4b0b759646b8f6030c9e693b97bdb8 Parents: 5ee90ef Author: Anu Engineer Authored: Thu Jul 12 12:09:31 2018 -0700 Committer: Anu Engineer Committed: Thu Jul 12 12:09:31 2018 -0700 -- .../hadoop/hdds/scm/node/NodeManager.java | 9 ++ .../hadoop/hdds/scm/node/NodeReportHandler.java | 19 +++- .../hadoop/hdds/scm/node/SCMNodeManager.java| 11 +++ .../hdds/scm/container/MockNodeManager.java | 11 +++ .../hdds/scm/node/TestNodeReportHandler.java| 95 .../testutils/ReplicationNodeManagerMock.java | 10 +++ 6 files changed, 152 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/556d9b36/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java -- diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java index 5e2969d..deb1628 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java @@ -17,6 +17,7 @@ */ package org.apache.hadoop.hdds.scm.node; +import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.NodeReportProto; import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeMetric; import org.apache.hadoop.hdds.scm.container.placement.metrics.SCMNodeStat; import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException; @@ -138,4 +139,12 @@ public interface NodeManager extends StorageContainerNodeProtocol, * @param command */ void addDatanodeCommand(UUID dnId, SCMCommand command); + + /** + * Process node report. + * + * @param dnUuid + * @param nodeReport + */ + void processNodeReport(UUID dnUuid, NodeReportProto nodeReport); } http://git-wip-us.apache.org/repos/asf/hadoop/blob/556d9b36/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java -- diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java index aa78d53..331bfed 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeReportHandler.java @@ -7,7 +7,7 @@ * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,25 +18,38 @@ package org.apache.hadoop.hdds.scm.node; +import com.google.common.base.Preconditions; +import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.scm.server.SCMDatanodeHeartbeatDispatcher .NodeReportFromDatanode; import org.apache.hadoop.hdds.server.events.EventHandler; import org.apache.hadoop.hdds.server.events.EventPublisher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Handles Node Reports from datanode. */ public class NodeReportHandler implements EventHandler { + private static final Logger LOGGER = LoggerFactory + .getLogger(NodeReportHandler.class); private final NodeManager nodeManager; public NodeReportHandler(NodeManager nodeManager) { +Preconditions.checkNotNull(nodeManager); this.nodeManager = nodeManager; } @Override public void onMessage(NodeReportFromDatanode nodeReportFromDatanode, -EventPublisher publisher) { -//TODO: process node report. + EventPublisher publisher) { +Preconditions.checkNotNull(nodeReportFromDatanode); +DatanodeDetails dn = nodeReportFromDatanode.getDatanodeDetails(); +Preconditions.checkNotNull(dn, "NodeReport is " ++ "missing DatanodeDetails."); +LOGGER.trace("Processing node report for dn: {}", dn); +nodeManager +.processNodeReport(dn.getUuid(), nodeReportFromDatanode.getReport()); } } http://git-wip-us.apache.org/repos/a