Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,11 @@ private ExtendedBlock getBlockToCopy(FsVolumeSpi.BlockIterator iter,
while (!iter.atEnd() && item.getErrorCount() < getMaxError(item)) {
try {
ExtendedBlock block = iter.nextBlock();


//null pointer should not be passed to FsDatasetSpi.isValidBlock()
if(block == null){
return block;
}
Comment on lines +895 to +899
Copy link
Member

@aajisaka aajisaka Jul 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// A valid block is a finalized block, we iterate until we get
// finalized blocks
if (!this.dataset.isValidBlock(block)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,10 @@ public List<ReplicaInfo> getFinalizedBlocks(String bpid) {
@Override // FsDatasetSpi
public void checkBlock(ExtendedBlock b, long minLength, ReplicaState state)
throws ReplicaNotFoundException, UnexpectedReplicaStateException,
FileNotFoundException, EOFException, IOException {
FileNotFoundException, EOFException, IOException, NullPointerException {
if(b == null){
throw new NullPointerException("Input Block is null!");
}
Comment on lines +1820 to +1822
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the call hierarchy of the method and b is always non-null.

final ReplicaInfo replicaInfo = volumeMap.get(b.getBlockPoolId(),
b.getLocalBlock());
if (replicaInfo == null) {
Expand Down