|
@@ -136,6 +136,7 @@ public class TestBPOfferService {
|
|
|
private FsDatasetSpi<?> mockFSDataset;
|
|
|
private DataSetLockManager dataSetLockManager = new DataSetLockManager();
|
|
|
private boolean isSlownode;
|
|
|
+ private String mockStorageID;
|
|
|
|
|
|
@Before
|
|
|
public void setupMocks() throws Exception {
|
|
@@ -157,6 +158,7 @@ public class TestBPOfferService {
|
|
|
// Set up a simulated dataset with our fake BP
|
|
|
mockFSDataset = Mockito.spy(new SimulatedFSDataset(null, conf));
|
|
|
mockFSDataset.addBlockPool(FAKE_BPID, conf);
|
|
|
+ mockStorageID = ((SimulatedFSDataset) mockFSDataset).getStorages().get(0).getStorageUuid();
|
|
|
|
|
|
// Wire the dataset to the DN.
|
|
|
Mockito.doReturn(mockFSDataset).when(mockDn).getFSDataset();
|
|
@@ -289,7 +291,7 @@ public class TestBPOfferService {
|
|
|
waitForBlockReport(mockNN2);
|
|
|
|
|
|
// When we receive a block, it should report it to both NNs
|
|
|
- bpos.notifyNamenodeReceivedBlock(FAKE_BLOCK, null, "", false);
|
|
|
+ bpos.notifyNamenodeReceivedBlock(FAKE_BLOCK, null, mockStorageID, false);
|
|
|
|
|
|
ReceivedDeletedBlockInfo[] ret = waitForBlockReceived(FAKE_BLOCK, mockNN1);
|
|
|
assertEquals(1, ret.length);
|
|
@@ -1099,7 +1101,7 @@ public class TestBPOfferService {
|
|
|
waitForBlockReport(mockNN2);
|
|
|
|
|
|
// When we receive a block, it should report it to both NNs
|
|
|
- bpos.notifyNamenodeReceivedBlock(FAKE_BLOCK, null, "", false);
|
|
|
+ bpos.notifyNamenodeReceivedBlock(FAKE_BLOCK, null, mockStorageID, false);
|
|
|
|
|
|
ReceivedDeletedBlockInfo[] ret = waitForBlockReceived(FAKE_BLOCK,
|
|
|
mockNN1);
|
|
@@ -1140,7 +1142,7 @@ public class TestBPOfferService {
|
|
|
Mockito.verify(mockNN3).registerDatanode(Mockito.any());
|
|
|
|
|
|
// When we receive a block, it should report it to both NNs
|
|
|
- bpos.notifyNamenodeReceivedBlock(FAKE_BLOCK, null, "", false);
|
|
|
+ bpos.notifyNamenodeReceivedBlock(FAKE_BLOCK, null, mockStorageID, false);
|
|
|
|
|
|
// veridfy new NN recieved block report
|
|
|
ret = waitForBlockReceived(FAKE_BLOCK, mockNN3);
|