void shutDownAll(List<BPOfferService> bposList) throws InterruptedException { for (BPOfferService bpos : bposList) { bpos.stop(); //interrupts the threads } //now join for (BPOfferService bpos : bposList) { bpos.join(); } }
bpos.stop(); bpos.join();
void shutDownAll(BPOfferService[] bposArray) throws InterruptedException { if (bposArray != null) { for (BPOfferService bpos : bposArray) { bpos.stop(); //interrupts the threads } //now join for (BPOfferService bpos : bposArray) { bpos.join(); } } }
void shutDownAll(BPOfferService[] bposArray) throws InterruptedException { if (bposArray != null) { for (BPOfferService bpos : bposArray) { bpos.stop(); //interrupts the threads } //now join for (BPOfferService bpos : bposArray) { bpos.join(); } } }
bpos.stop(); bpos.join();
return null; }).when(bpos).stop(); return bpos;
bpos.stop(); bpos.join();
private void stopBPServiceThreads(int numStopThreads, DataNode dn) throws Exception { BPOfferService[] bpoList = dn.getAllBpOs(); int expected = dn.getBpOsCount() - numStopThreads; int index = numStopThreads - 1; while (index >= 0) { bpoList[index--].stop(); } int iterations = 3000; // Total 30 seconds MAX wait time while(dn.getBpOsCount() != expected && iterations > 0) { Thread.sleep(WAIT_TIME_IN_MILLIS); iterations--; } assertEquals("Mismatch in number of BPServices running", expected, dn.getBpOsCount()); }
/** * Ensure that, if the two NNs configured for a block pool * have different block pool IDs, they will refuse to both * register. */ @Test public void testNNsFromDifferentClusters() throws Exception { Mockito .doReturn(new NamespaceInfo(1, "fake foreign cluster", FAKE_BPID, 0)) .when(mockNN1).versionRequest(); BPOfferService bpos = setupBPOSForNNs(mockNN1, mockNN2); bpos.start(); try { waitForOneToFail(bpos); } finally { bpos.stop(); } }
+ " processing ", difference < 5000); } finally { bpos.stop();
.reportBadBlocks(Mockito.any(LocatedBlock[].class)); } finally { bpos.stop();
+ "when errorReport threw IOException", secondCallTime != 0); } finally { bpos.stop();
bpos.stop(); bpos.join();
difference < 5000); } finally { bpos.stop();