Skip to content

Commit

Permalink
HDFS-16480. Fix typo: indicies -> indices (apache#4020)
Browse files Browse the repository at this point in the history
  • Loading branch information
qijiale76 authored and HarshitGupta11 committed Nov 28, 2022
1 parent 9ab16ac commit fddd8e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import java.util.Set;

class ErasureCodingWork extends BlockReconstructionWork {
private final byte[] liveBlockIndicies;
private final byte[] liveBusyBlockIndicies;
private final byte[] liveBlockIndices;
private final byte[] liveBusyBlockIndices;
private final String blockPoolId;

public ErasureCodingWork(String blockPoolId, BlockInfo block,
Expand All @@ -40,18 +40,18 @@ public ErasureCodingWork(String blockPoolId, BlockInfo block,
List<DatanodeDescriptor> containingNodes,
List<DatanodeStorageInfo> liveReplicaStorages,
int additionalReplRequired, int priority,
byte[] liveBlockIndicies, byte[] liveBusyBlockIndicies) {
byte[] liveBlockIndices, byte[] liveBusyBlockIndices) {
super(block, bc, srcNodes, containingNodes,
liveReplicaStorages, additionalReplRequired, priority);
this.blockPoolId = blockPoolId;
this.liveBlockIndicies = liveBlockIndicies;
this.liveBusyBlockIndicies = liveBusyBlockIndicies;
this.liveBlockIndices = liveBlockIndices;
this.liveBusyBlockIndices = liveBusyBlockIndices;
LOG.debug("Creating an ErasureCodingWork to {} reconstruct ",
block);
}

byte[] getLiveBlockIndicies() {
return liveBlockIndicies;
byte[] getLiveBlockIndices() {
return liveBlockIndices;
}

@Override
Expand All @@ -72,15 +72,15 @@ void chooseTargets(BlockPlacementPolicy blockplacement,
*/
private boolean hasAllInternalBlocks() {
final BlockInfoStriped block = (BlockInfoStriped) getBlock();
if (liveBlockIndicies.length
+ liveBusyBlockIndicies.length < block.getRealTotalBlockNum()) {
if (liveBlockIndices.length
+ liveBusyBlockIndices.length < block.getRealTotalBlockNum()) {
return false;
}
BitSet bitSet = new BitSet(block.getTotalBlockNum());
for (byte index : liveBlockIndicies) {
for (byte index : liveBlockIndices) {
bitSet.set(index);
}
for (byte busyIndex: liveBusyBlockIndicies) {
for (byte busyIndex: liveBusyBlockIndices) {
bitSet.set(busyIndex);
}
for (int i = 0; i < block.getRealDataBlockNum(); i++) {
Expand Down Expand Up @@ -147,14 +147,14 @@ void addTaskToDatanode(NumberReplicas numberReplicas) {
} else {
targets[0].getDatanodeDescriptor().addBlockToBeErasureCoded(
new ExtendedBlock(blockPoolId, stripedBlk), getSrcNodes(), targets,
getLiveBlockIndicies(), stripedBlk.getErasureCodingPolicy());
getLiveBlockIndices(), stripedBlk.getErasureCodingPolicy());
}
}

private void createReplicationWork(int sourceIndex,
DatanodeStorageInfo target) {
BlockInfoStriped stripedBlk = (BlockInfoStriped) getBlock();
final byte blockIndex = liveBlockIndicies[sourceIndex];
final byte blockIndex = liveBlockIndices[sourceIndex];
final DatanodeDescriptor source = getSrcNodes()[sourceIndex];
final long internBlkLen = StripedBlockUtil.getInternalBlockLength(
stripedBlk.getNumBytes(), stripedBlk.getCellSize(),
Expand All @@ -173,7 +173,7 @@ private List<Integer> findLeavingServiceSources() {
BitSet bitSet = new BitSet(block.getRealTotalBlockNum());
for (int i = 0; i < getSrcNodes().length; i++) {
if (getSrcNodes()[i].isInService()) {
bitSet.set(liveBlockIndicies[i]);
bitSet.set(liveBlockIndices[i]);
}
}
// If the block is on the node which is decommissioning or
Expand All @@ -184,7 +184,7 @@ private List<Integer> findLeavingServiceSources() {
if ((getSrcNodes()[i].isDecommissionInProgress() ||
(getSrcNodes()[i].isEnteringMaintenance() &&
getSrcNodes()[i].isAlive())) &&
!bitSet.get(liveBlockIndicies[i])) {
!bitSet.get(liveBlockIndices[i])) {
srcIndices.add(i);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ private static void copyKey(Configuration srcConf, Configuration destConf,
* Do the rest of the NN configuration for things like shared edits,
* as well as directory formatting, etc. for a single nameservice
* @param nnCounter the count of the number of namenodes already configured/started. Also,
* acts as the <i>index</i> to the next NN to start (since indicies start at 0).
* acts as the <i>index</i> to the next NN to start (since indices start at 0).
* @throws IOException
*/
private void configureNameService(MiniDFSNNTopology.NSConf nameservice, int nsCounter,
Expand Down

0 comments on commit fddd8e9

Please sign in to comment.