-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-10514. Recon - Provide DN decommissioning detailed status and info inline with current CLI command output. #6376
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
523cc1d
HDDS-10514. Recon - Provide DN decommissioning detailed status and in…
525ef35
HDDS-10514. Reverting this file change.
f1df560
HDDS-10514. Added API for UUID argument.
c229db3
HDDS-10514. Fixed findbugs.
eb57e7a
HDDS-10514. Added test cases for endPoint APIs.
c29ac0b
HDDS-9537. Intermittent failure in TestPipelineManagerMXBean.
fe6ae72
Revert "HDDS-9537. Intermittent failure in TestPipelineManagerMXBean."
378ed7a
HDDS-10514. Fixed JSON formatting error and test cases.
0f76ecc
HDDS-10514. Fixed findbugs.
8e90c06
HDDS-10514. Fixed test failed cases.
b1c22b8
HDDS-10514. Fixed spelling mistakes in javadoc comments.
0869a88
HDDS-10514. Fixed review comments.
ed958bd
HDDS-10514. Changed the approach to get decommission status for DNs.
0ab6ae8
HDDS-10514. Added test cases.
6513cc3
HDDS-10514. Handled review comments.
aa1b62b
HDDS-10514. Handled review comments.
b4bc438
HDDS-10514. Removed unused constant.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
72 changes: 72 additions & 0 deletions
72
.../common/src/main/java/org/apache/hadoop/hdds/recon/CustomDatanodeDetailsDeserializer.java
This file contains hidden or 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,72 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "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 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.hadoop.hdds.recon; | ||
|
|
||
| import com.fasterxml.jackson.core.JsonParser; | ||
| import com.fasterxml.jackson.databind.DeserializationContext; | ||
| import com.fasterxml.jackson.databind.JsonNode; | ||
| import com.fasterxml.jackson.databind.deser.std.StdDeserializer; | ||
| import org.apache.hadoop.hdds.protocol.DatanodeDetails; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| /** | ||
| * This is custom jackson deserializer class for DetanodeDetails class. | ||
| * Jackson deserializer is being used to deserialize json using JSON parser | ||
| * and map JSON fields to respective DatanodeDetails class fields. | ||
| */ | ||
| public class CustomDatanodeDetailsDeserializer extends StdDeserializer<DatanodeDetails> { | ||
|
|
||
| protected CustomDatanodeDetailsDeserializer(Class<DatanodeDetails> vc) { | ||
| super(vc); | ||
| } | ||
|
|
||
| public CustomDatanodeDetailsDeserializer() { | ||
| this(null); | ||
| } | ||
|
|
||
| @Override | ||
| public DatanodeDetails deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { | ||
| JsonNode node = p.getCodec().readTree(p); | ||
| List<DatanodeDetails.Port> ports = new ArrayList<>(); | ||
| JsonNode portsNode = node.get("ports"); | ||
| if (portsNode != null && portsNode.isArray()) { | ||
| for (JsonNode portNode : portsNode) { | ||
| DatanodeDetails.Port port = new DatanodeDetails.Port( | ||
| DatanodeDetails.Port.Name.valueOf(portNode.get("name").asText()), portNode.get("value").asInt()); | ||
| ports.add(port); | ||
| } | ||
| } | ||
| DatanodeDetails datanodeDetails = DatanodeDetails.newBuilder() | ||
| .setLevel(node.get("level").asInt()) | ||
| .setCost(node.get("cost").asInt()) | ||
| .setUuid(UUID.fromString(node.get("uuid").asText())) | ||
| .setUuidAsString(node.get("uuidString").asText()) | ||
| .setIpAddress(node.get("ipAddress").asText()) | ||
| .setHostName(node.get("hostName").asText()) | ||
| .setPorts(ports) | ||
| .build(); | ||
| return datanodeDetails; | ||
| } | ||
| } | ||
|
|
||
|
|
||
72 changes: 72 additions & 0 deletions
72
...ds/common/src/main/java/org/apache/hadoop/hdds/recon/CustomDatanodeDetailsSerializer.java
This file contains hidden or 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,72 @@ | ||||||
| /* | ||||||
| * Licensed to the Apache Software Foundation (ASF) under one | ||||||
| * or more contributor license agreements. See the NOTICE file | ||||||
| * distributed with this work for additional information | ||||||
| * regarding copyright ownership. The ASF licenses this file | ||||||
| * to you under the Apache License, Version 2.0 (the | ||||||
| * "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 | ||||||
| * | ||||||
| * Unless required by applicable law or agreed to in writing, software | ||||||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
| * See the License for the specific language governing permissions and | ||||||
| * limitations under the License. | ||||||
| */ | ||||||
|
|
||||||
| package org.apache.hadoop.hdds.recon; | ||||||
|
|
||||||
| import com.fasterxml.jackson.core.JsonGenerator; | ||||||
| import com.fasterxml.jackson.databind.SerializerProvider; | ||||||
| import com.fasterxml.jackson.databind.ser.std.StdSerializer; | ||||||
| import org.apache.hadoop.hdds.protocol.DatanodeDetails; | ||||||
|
|
||||||
| import java.io.IOException; | ||||||
|
|
||||||
| /** | ||||||
| * This is custom jackson serializer class for DetanodeDetails class. | ||||||
|
||||||
| * This is custom jackson serializer class for DetanodeDetails class. | |
| * This is custom jackson serializer class for DatanodeDetails class. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo here for DatanodeDetails