-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-12209. Make replica verification concurrent #8363
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
Closed
ptlrs
wants to merge
3
commits into
apache:master
from
ptlrs:HDDS-12209-Make-replica-verification-concurrent
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
165 changes: 165 additions & 0 deletions
165
...one/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/KeyVerificationResult.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,165 @@ | ||
| /* | ||
| * 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.ozone.debug.replicas; | ||
|
|
||
| import java.util.List; | ||
| import org.apache.hadoop.hdds.protocol.DatanodeDetails; | ||
|
|
||
| /** | ||
| * Class to hold the verification results for a key. | ||
| */ | ||
| public class KeyVerificationResult { | ||
| private final boolean keyPass; | ||
| private final String volumeName; | ||
| private final String bucketName; | ||
| private final String keyName; | ||
| private final List<BlockVerificationData> blockResults; | ||
|
|
||
| public KeyVerificationResult(String volumeName, String bucketName, String keyName, | ||
| List<BlockVerificationData> blockResults, boolean keyPass) { | ||
| this.volumeName = volumeName; | ||
| this.bucketName = bucketName; | ||
| this.keyName = keyName; | ||
| this.blockResults = blockResults; | ||
| this.keyPass = keyPass; | ||
| } | ||
|
|
||
| public String getVolumeName() { | ||
| return volumeName; | ||
| } | ||
|
|
||
| public String getBucketName() { | ||
| return bucketName; | ||
| } | ||
|
|
||
| public String getKeyName() { | ||
| return keyName; | ||
| } | ||
|
|
||
| public List<BlockVerificationData> getBlockResults() { | ||
| return blockResults; | ||
| } | ||
|
|
||
| public boolean isKeyPass() { | ||
| return keyPass; | ||
| } | ||
|
|
||
| /** | ||
| * Class to hold the verification results for a block. | ||
| */ | ||
| public static class BlockVerificationData { | ||
| private final long containerID; | ||
| private final long blockID; | ||
| private final List<ReplicaVerificationData> replicaResults; | ||
| private final boolean blockPass; | ||
|
|
||
| public BlockVerificationData(long containerID, long blockID, | ||
| List<ReplicaVerificationData> replicaResults, | ||
| boolean blockPass) { | ||
| this.containerID = containerID; | ||
| this.blockID = blockID; | ||
| this.replicaResults = replicaResults; | ||
| this.blockPass = blockPass; | ||
| } | ||
|
|
||
| public long getContainerID() { | ||
| return containerID; | ||
| } | ||
|
|
||
| public long getBlockID() { | ||
| return blockID; | ||
| } | ||
|
|
||
| public List<ReplicaVerificationData> getReplicaResults() { | ||
| return replicaResults; | ||
| } | ||
|
|
||
| public boolean isBlockPass() { | ||
| return blockPass; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Class to hold the verification results for a replica. | ||
| */ | ||
| public static class ReplicaVerificationData { | ||
| private final DatanodeDetails datanode; | ||
| private final int replicaIndex; | ||
| private final List<CheckData> checkResults; | ||
| private final boolean replicaPass; | ||
|
|
||
| public ReplicaVerificationData(DatanodeDetails datanode, int replicaIndex, | ||
| List<CheckData> checkResults, | ||
| boolean replicaPass) { | ||
| this.datanode = datanode; | ||
| this.replicaIndex = replicaIndex; | ||
| this.checkResults = checkResults; | ||
| this.replicaPass = replicaPass; | ||
| } | ||
|
|
||
| public DatanodeDetails getDatanode() { | ||
| return datanode; | ||
| } | ||
|
|
||
| public int getReplicaIndex() { | ||
| return replicaIndex; | ||
| } | ||
|
|
||
| public List<CheckData> getCheckResults() { | ||
| return checkResults; | ||
| } | ||
|
|
||
| public boolean isReplicaPass() { | ||
| return replicaPass; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Class to hold the results of a single check. | ||
| */ | ||
| public static class CheckData { | ||
| private final String type; | ||
| private final boolean completed; | ||
| private final boolean pass; | ||
| private final List<String> failures; | ||
|
|
||
| public CheckData(String type, boolean completed, boolean pass, | ||
| List<String> failures) { | ||
| this.type = type; | ||
| this.completed = completed; | ||
| this.pass = pass; | ||
| this.failures = failures; | ||
| } | ||
|
|
||
| public String getType() { | ||
| return type; | ||
| } | ||
|
|
||
| public boolean isCompleted() { | ||
| return completed; | ||
| } | ||
|
|
||
| public boolean isPass() { | ||
| return pass; | ||
| } | ||
|
|
||
| public List<String> getFailures() { | ||
| return failures; | ||
| } | ||
| } | ||
| } | ||
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.
I don't think this is in the json output currently but we probably want a
keyCompletedfield as well which would map to the AND of all block verifier'scompletedstatuses. This is used to indicate that a check failed without actually being able to run the check (like datanode not reachable). We would also set this to false if thegetKeyInfocall fails.