HADOOP-17235. Erasure Coding: Remove dead code from common side. Contributed by Fei Hui.

This commit is contained in:
He Xiaoqiao 2020-09-01 11:35:55 +08:00
parent 658b1a6cde
commit 7e671f3b65
3 changed files with 0 additions and 59 deletions

View File

@ -54,34 +54,6 @@ public ECBlock[] getParityBlocks() {
return parityBlocks;
}
/**
* Any erased data block?
* @return true if any erased data block, false otherwise
*/
public boolean anyErasedDataBlock() {
for (int i = 0; i < dataBlocks.length; ++i) {
if (dataBlocks[i].isErased()) {
return true;
}
}
return false;
}
/**
* Any erased parity block?
* @return true if any erased parity block, false otherwise
*/
public boolean anyErasedParityBlock() {
for (int i = 0; i < parityBlocks.length; ++i) {
if (parityBlocks[i].isErased()) {
return true;
}
}
return false;
}
/**
* Get erased blocks count
* @return erased count of blocks

View File

@ -172,27 +172,4 @@ protected int[] getErasedIndexes(ECBlock[] inputBlocks) {
return erasedIndexes;
}
/**
* Get erased input blocks from inputBlocks
* @param inputBlocks
* @return an array of erased blocks from inputBlocks
*/
protected ECBlock[] getErasedBlocks(ECBlock[] inputBlocks) {
int numErased = getNumErasedBlocks(inputBlocks);
if (numErased == 0) {
return new ECBlock[0];
}
ECBlock[] erasedBlocks = new ECBlock[numErased];
int i = 0, j = 0;
for (; i < inputBlocks.length && j < erasedBlocks.length; i++) {
if (inputBlocks[i].isErased()) {
erasedBlocks[j++] = inputBlocks[i];
}
}
return erasedBlocks;
}
}

View File

@ -66,10 +66,6 @@ public abstract class TestCoderBase {
protected boolean allowChangeInputs;
protected int getChunkSize() {
return chunkSize;
}
protected void setChunkSize(int chunkSize) {
this.chunkSize = chunkSize;
this.zeroChunkBytes = new byte[chunkSize]; // With ZERO by default
@ -90,10 +86,6 @@ protected void prepareBufferAllocator(boolean usingSlicedBuffer) {
}
}
protected boolean isAllowDump() {
return allowDump;
}
/**
* Prepare before running the case.
* @param conf