Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HDFS-7369. Erasure coding: distribute recovery work for striped block…
…s to DataNode. Contributed by Zhe Zhang.
- Loading branch information
1 parent
e3dbfeb
commit 57a84c0
Showing
11 changed files
with
484 additions
and
108 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
290 changes: 208 additions & 82 deletions
290
...hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
63 changes: 63 additions & 0 deletions
63
...oop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlockECRecoveryCommand.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,63 @@ | ||
/** | ||
* 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.hdfs.server.protocol; | ||
|
||
import com.google.common.base.Joiner; | ||
import org.apache.hadoop.classification.InterfaceAudience; | ||
import org.apache.hadoop.classification.InterfaceStability; | ||
import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeDescriptor.BlockECRecoveryInfo; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* A BlockECRecoveryCommand is an instruction to a DataNode to reconstruct a | ||
* striped block group with missing blocks. | ||
* | ||
* Upon receiving this command, the DataNode pulls data from other DataNodes | ||
* hosting blocks in this group and reconstructs the lost blocks through codec | ||
* calculation. | ||
* | ||
* After the reconstruction, the DataNode pushes the reconstructed blocks to | ||
* their final destinations if necessary (e.g., the destination is different | ||
* from the reconstruction node, or multiple blocks in a group are to be | ||
* reconstructed). | ||
*/ | ||
@InterfaceAudience.Private | ||
@InterfaceStability.Evolving | ||
public class BlockECRecoveryCommand extends DatanodeCommand { | ||
final Collection<BlockECRecoveryInfo> ecTasks; | ||
|
||
/** | ||
* Create BlockECRecoveryCommand from a collection of | ||
* {@link BlockECRecoveryInfo}, each representing a recovery task | ||
*/ | ||
public BlockECRecoveryCommand(int action, | ||
Collection<BlockECRecoveryInfo> blockECRecoveryInfoList) { | ||
super(action); | ||
this.ecTasks = blockECRecoveryInfoList; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("BlockECRecoveryCommand(\n "); | ||
Joiner.on("\n ").appendTo(sb, ecTasks); | ||
sb.append("\n)"); | ||
return sb.toString(); | ||
} | ||
} |
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.