Skip to content

Commit

Permalink
Fix the bug due to changed Listener that BlockHeartbeatReporter fails…
Browse files Browse the repository at this point in the history
… to report to master on remove blocks
  • Loading branch information
apc999 authored and calvinjia committed Jun 27, 2015
1 parent 24d7116 commit dc62f88
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -105,14 +105,7 @@ public void preRemoveBlock(long userId, long blockId) {

@Override
public void postRemoveBlock(long userId, long blockId) {
synchronized (mLock) {
// Remove the block from list of added blocks, in case it was added in this heartbeat period.
removeBlockFromAddedBlocks(blockId);
// Add to the list of removed blocks in this heartbeat period.
if (!mRemovedBlocks.contains(blockId)) {
mRemovedBlocks.add(blockId);
}
}
// Do nothing
}

@Override
Expand All @@ -122,7 +115,14 @@ public void preEvictBlock(long userId, long blockId) {

@Override
public void postEvictBlock(long userId, long blockId) {
// Do nothing
synchronized (mLock) {
// Remove the block from list of added blocks, in case it was added in this heartbeat period.
removeBlockFromAddedBlocks(blockId);
// Add to the list of removed blocks in this heartbeat period.
if (!mRemovedBlocks.contains(blockId)) {
mRemovedBlocks.add(blockId);
}
}
}

@Override
Expand Down

0 comments on commit dc62f88

Please sign in to comment.