From: <mar...@us...> - 2013-12-09 15:30:43
|
Revision: 7622 http://bigdata.svn.sourceforge.net/bigdata/?rev=7622&view=rev Author: martyncutcher Date: 2013-12-09 15:30:36 +0000 (Mon, 09 Dec 2013) Log Message: ----------- Implement ForceRemoveService task Modified Paths: -------------- branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JustKills.java Modified: branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2013-12-09 15:26:17 UTC (rev 7621) +++ branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2013-12-09 15:30:36 UTC (rev 7622) @@ -72,6 +72,7 @@ import com.bigdata.ha.HAGlue; import com.bigdata.ha.HAStatusEnum; +import com.bigdata.ha.IndexManagerCallable; import com.bigdata.ha.RunState; import com.bigdata.ha.msg.HARootBlockRequest; import com.bigdata.ha.msg.HASnapshotDigestRequest; @@ -1100,6 +1101,34 @@ } + /** + * Debug class to explicitly ask one service to remove another. + * + * This emulates the behaviour of the service in receiving correct notification + * of a target service failure -for example after a wire pull or sure kill. + * + */ + protected static class ForceRemoveService extends IndexManagerCallable<Void> { + + private static final long serialVersionUID = 1L; + private final UUID service; + + ForceRemoveService(final UUID service) { + this.service = service; + } + + @Override + public Void call() throws Exception { + + final HAJournal ha = (HAJournal) this.getIndexManager(); + + ha.getQuorum().getActor().forceRemoveService(service); + + return null; + } + + } + private void safeShutdown(final HAGlue haGlue, final File serviceDir, final ServiceListener serviceListener) { Modified: branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JustKills.java =================================================================== --- branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JustKills.java 2013-12-09 15:26:17 UTC (rev 7621) +++ branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JustKills.java 2013-12-09 15:30:36 UTC (rev 7622) @@ -78,7 +78,7 @@ // FIXME: in the face of no implemented error propagation we can explicitly // tell the leader to remove the killed service! - startup.serverA.submit(new RemoveService(getServiceCId()), true); + startup.serverA.submit(new ForceRemoveService(getServiceCId()), true); awaitPipeline(20, TimeUnit.SECONDS, new HAGlue[] {startup.serverA, startup.serverB}); @@ -99,31 +99,6 @@ } - /** - * Debug class to explicitly ask one service to remove another. - * - * This emulates the behaviour of the service in receiving correct notification - * of a target service failure -for example after a wire pull or sure kill. - * - */ - static class RemoveService extends IndexManagerCallable<Void> { - final UUID m_sid; - RemoveService(final UUID sid) { - m_sid = sid; - } - - @Override - public Void call() throws Exception { - final AbstractJournal journal = (AbstractJournal) getIndexManager(); - final Quorum<HAGlue, QuorumService<HAGlue>> quorum = journal - .getQuorum(); - - quorum.getActor().forceRemoveService(m_sid); - - return null; - } - } - public void testStressABC_LiveLoadRemainsMet_kill_C() throws Exception { for (int i = 0; i < 5; i++) { try { @@ -168,7 +143,7 @@ kill(startup.serverB); // FIXME: temporary call to explicitly remove the service prior to correct protocol - startup.serverA.submit(new RemoveService(getServiceBId()), true); + startup.serverA.submit(new ForceRemoveService(getServiceBId()), true); awaitPipeline(10, TimeUnit.SECONDS, new HAGlue[] {startup.serverA, startup.serverC}); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |