river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1563596 [1/3] - in /river/jtsk/skunk/qa_refactor/trunk: qa/src/com/sun/jini/test/impl/outrigger/matching/ qa/src/com/sun/jini/test/impl/servicediscovery/event/ qa/src/com/sun/jini/test/spec/lookupservice/test_set00/ qa/src/com/sun/jini/tes...
Date Sun, 02 Feb 2014 12:31:10 GMT
Author: peter_firmstone
Date: Sun Feb  2 12:31:09 2014
New Revision: 1563596

URL: http://svn.apache.org/r1563596
Log:
New dependency linking and call backs for Reggie and SDM.

Notes:

SDM still has a race condition where more added service events are sent than required when
rediscovering discarded services.

ServiceRegistar compliance tests appear to require that services be notified in the same order
that those services are registered with a registrar, this isn't documented in the spec,  but
may need to be complied with for backward compatibility.  For now Reggie's event notification
is single threaded to ensure these tests pass.  TaskManager.Task.runAfter didn't make any
direct dependency check for this additional requirement, instead the limited scalability of
TaskManager ensured compliance.

Reactivated previously failing tests.

Added:
    river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/DependencyLinker.java
    river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/SynchronousExecutors.java
    river/jtsk/skunk/qa_refactor/trunk/test/src/org/apache/river/impl/thread/SynchronousExecutorsTest.java
Modified:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/outrigger/matching/StressTestInterleaved.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrDel.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrMod.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNonNull.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNull.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNonNull.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNull.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNonNull.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNull.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set02/NotifyOnAttrSet.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/reggie/RegistrarImpl.java
    river/jtsk/skunk/qa_refactor/trunk/src/net/jini/lookup/JoinManager.java
    river/jtsk/skunk/qa_refactor/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java
    river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/api/util/FutureObserver.java
    river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/outrigger/matching/StressTestInterleaved.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/outrigger/matching/StressTestInterleaved.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/outrigger/matching/StressTestInterleaved.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/outrigger/matching/StressTestInterleaved.td
Sun Feb  2 12:31:09 2014
@@ -6,7 +6,7 @@ include0=../outrigger.properties
 
 com.sun.jini.test.share.restart_wait=10000
 com.sun.jini.test.impl.outrigger.matching.StressTest.num_entries=10000
-com.sun.jini.test.impl.outrigger.matching.StressTest.num_readers=400
-com.sun.jini.test.impl.outrigger.matching.StressTest.num_writers=250
+com.sun.jini.test.impl.outrigger.matching.StressTest.num_readers=2000
+com.sun.jini.test.impl.outrigger.matching.StressTest.num_writers=2000
 com.sun.jini.test.impl.outrigger.matching.StressTest.interleave=true
 

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.java?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.java
Sun Feb  2 12:31:09 2014
@@ -38,7 +38,7 @@ import java.util.logging.Level;
 /**
  * This test attempts to simulate the following race condition that
  * can occur between an instance of LookupTask and an instance of 
- * DropProxyRegTask:
+ * ProxyRegDropTask:
  *
  * - 1 LUS {L0}
  * - 1 service s0 registered in L0
@@ -48,18 +48,18 @@ import java.util.logging.Level;
  * waits a few seconds after the cache is created because if L0 is discarded
  * too quickly, L0 will be removed from the proxyRegSet before LookupTask
  * has a chance to begin any processing. After the wait period is up,
- * L0 is discarded; which initiates the DropProxyRegTask. The race occurs
+ * L0 is discarded; which initiates the ProxyRegDropTask. The race occurs
  * as follows:
- *          LookupTask                       DropProxyRegTask
+ *          LookupTask                       ProxyRegDropTask
  *   ----------------------------   ----------------------------------------
  *   o determine s0 is "new"
  *   o sleep for n seconds          o remove L0 from proxyRegSet
  *                                  o serviceIdMap is empty, do nothing else
  *   o add new s0 to serviceIdMap
  *
- * The result is that serviceIdMap should NOT be empty when DropProxyRegTask
+ * The result is that serviceIdMap should NOT be empty when ProxyRegDropTask
  * encounters it. But if LookupTask is too slow in adding s0 to the map,
- * DropProxyRegTask will have nothing to remove, and so will return without
+ * ProxyRegDropTask will have nothing to remove, and so will return without
  * modifying serviceIdMap. But when LookupTask returns, s0 will be contained
  * in serviceIdMap; even though it shouldn't.
  *
@@ -153,7 +153,7 @@ public class LookupDropProxyTaskRace ext
      *  
      *  1. Create a cache to initiate the RegisterListenerTask/LookupTask combo
      *  2. Set groups and locators so the lookup service won't be re-discovered
-     *  3. Discard the lookup service to initiate the DropProxyRegTask
+     *  3. Discard the lookup service to initiate the ProxyRegDropTask
      */
     protected void applyTestDef() throws Exception {
         int nLookupServices = getLookupServices().getnLookupServices();

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupDropProxyTaskRace.td
Sun Feb  2 12:31:09 2014
@@ -1,4 +1,4 @@
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 include0=../servicediscovery.properties
 testClass=LookupDropProxyTaskRace
 testCategories=servicediscovery,servicediscovery_impl,servicediscoveryevent,implservicediscovery,implservicediscoveryevent

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java
Sun Feb  2 12:31:09 2014
@@ -38,14 +38,14 @@ import java.util.logging.Level;
 /**
 * This test attempts to simulate the following race condition that
  * can occur between an instance of LookupTask and an instance of 
- * DropProxyRegTask:
+ * ProxyRegDropTask:
  *
  * - 1 LUS {L0}
  * - 1 services {s0}, to be registered in L0
  * - 1 cache C0 with template matching s0
  *
  * This test attempts to simulate the race that appears to be possible
- * between the NotifyEventTask and the DropProxyRegTask. This test 
+ * between the NotifyEventTask and the ProxyRegDropTask. This test 
  * starts lookup L0 and creates cache C0. It then registers s0 with L0
  * to generate a NOMATCH_MATCH event and ultimately initiate an instance
  * of NotifyEventTask. Suppose that before NotifyEventTask can modify the
@@ -65,7 +65,7 @@ import java.util.logging.Level;
  *                          o s0 registered with L0
  *                          o L0 sends NO_MATCH_MATCH
  *
- *          NotifyEventTask                       DropProxyRegTask
+ *          NotifyEventTask                       ProxyRegDropTask
  *   -----------------------------     ----------------------------------------
  *   o task0 determine s0 is "new"
  *   o sleep for n seconds
@@ -78,7 +78,7 @@ import java.util.logging.Level;
  *
  * The result is that serviceIdMap should be empty and L0 should not be 
  * in proxyRegSet. But if NotifyEventTask is too slow in processing the
- * new s0, DropProxyRegTask will have nothing to process and so the
+ * new s0, ProxyRegDropTask will have nothing to process and so the
  * serviceIdMap will not be empty, and the serviceRemoved event that should
  * have been sent because the [s0,L0] pair was removed from the serviceIdMap
  * is never sent.
@@ -160,7 +160,7 @@ public class NotifyEventDropProxyTaskRac
      *  
      *  1. Create a cache to initiate the RegisterListenerTask/LookupTask combo
      *  2. Destroy the lookup service so it won't be re-discovered
-     *  3. Discard the lookup service to initiate the DropProxyRegTask
+     *  3. Discard the lookup service to initiate the ProxyRegDropTask
      */
     protected void applyTestDef() throws Exception {
 	lus = (ldm.getRegistrars())[0];

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnAttrAdd
 testCategories=lookupservice,lookupservice_spec,test_set00
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrDel.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrDel.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrDel.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrDel.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnAttrDel
 testCategories=lookupservice,lookupservice_spec,test_set00
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrMod.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrMod.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrMod.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrMod.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnAttrMod
 testCategories=lookupservice,lookupservice_spec,test_set00
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNonNull.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNonNull.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNonNull.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNonNull.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnComboAttrAddNonNull
 testCategories=lookupservice,lookupservice_spec,test_set01
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNull.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNull.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNull.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrAddNull.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnComboAttrAddNull
 testCategories=lookupservice,lookupservice_spec,test_set01
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNonNull.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNonNull.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNonNull.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNonNull.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnComboAttrDelNonNull
 testCategories=lookupservice,lookupservice_spec,test_set01
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNull.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNull.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNull.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrDelNull.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnComboAttrDelNull
 testCategories=lookupservice,lookupservice_spec,test_set01
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNonNull.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNonNull.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNonNull.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNonNull.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnComboAttrModNonNull
 testCategories=lookupservice,lookupservice_spec,test_set01
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNull.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNull.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNull.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set01/NotifyOnComboAttrModNull.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnComboAttrModNull
 testCategories=lookupservice,lookupservice_spec,test_set01
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set02/NotifyOnAttrSet.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set02/NotifyOnAttrSet.td?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set02/NotifyOnAttrSet.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/lookupservice/test_set02/NotifyOnAttrSet.td
Sun Feb  2 12:31:09 2014
@@ -1,6 +1,6 @@
 # Skip test verifier until test is confirmed by Jini Community that 
 # Events should be prioritsed in order of registered services.
-com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
+#com.sun.jini.qa.harness.verifier=com.sun.jini.qa.harness.SkipTestVerifier
 testClass=NotifyOnAttrSet
 testCategories=lookupservice,lookupservice_spec,test_set02
 include0=../lookupservice.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java
Sun Feb  2 12:31:09 2014
@@ -240,8 +240,8 @@ abstract public class AbstractBaseTest e
      * or changed.
      */
     public static class SrvcListener implements ServiceDiscoveryListener {
-        private QAConfig util;
-        private String classname;
+        private final QAConfig util;
+        private final String classname;
         private int nAdded   = 0;
         private int nRemoved = 0;
         private int nChanged = 0;
@@ -253,24 +253,27 @@ abstract public class AbstractBaseTest e
 	public void serviceAdded(ServiceDiscoveryEvent event) {
             ServiceItem srvcItem = event.getPostEventServiceItem();
             ServiceID srvcID = srvcItem.serviceID;
-            logger.log(Level.FINE, "{0} -- serviceAdded()-{1}-{2}", new Object[]{nAdded,
srvcItem.service, srvcID});
             synchronized(lock) {
+                logger.log(Level.FINE, "{0} -- serviceAdded()-{1}-{2}", 
+                        new Object[]{nAdded, srvcItem.service, srvcID});
                 nAdded++;
             }
 	}//end serviceAdded
 	public void serviceRemoved(ServiceDiscoveryEvent event) {
             ServiceItem srvcItem = event.getPreEventServiceItem();
             ServiceID srvcID = srvcItem.serviceID;
-            logger.log(Level.FINE, "{0} -- serviceRemoved()-{1}-{2}", new Object[]{nRemoved,
srvcItem.service, srvcID});
             synchronized(lock) {
+                logger.log(Level.FINE, "{0} -- serviceRemoved()-{1}-{2}", 
+                        new Object[]{nRemoved, srvcItem.service, srvcID});
                 nRemoved++;
             }
 	}//end serviceRemoved
 	public void serviceChanged(ServiceDiscoveryEvent event) {
             ServiceItem srvcItem = event.getPreEventServiceItem();
             ServiceID srvcID = srvcItem.serviceID;
-            logger.log(Level.FINE, "{0} -- serviceChanged()-{1}-{2}", new Object[]{nChanged,
srvcItem.service, srvcID});
             synchronized(lock) {
+                logger.log(Level.FINE, "{0} -- serviceChanged()-{1}-{2}", 
+                        new Object[]{nChanged, srvcItem.service, srvcID});
                 nChanged++;
             }
 	}//end serviceChanged

Modified: river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/reggie/RegistrarImpl.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/reggie/RegistrarImpl.java?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/reggie/RegistrarImpl.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/reggie/RegistrarImpl.java Sun Feb
 2 12:31:09 2014
@@ -80,16 +80,27 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.Queue;
 import java.util.Random;
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.SortedSet;
 import java.util.TreeMap;
 import java.util.TreeSet;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ConcurrentSkipListMap;
 import java.util.concurrent.ConcurrentSkipListSet;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.PriorityBlockingQueue;
+import java.util.concurrent.RunnableFuture;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -139,13 +150,20 @@ import net.jini.jeri.BasicILFactory;
 import net.jini.jeri.BasicJeriExporter;
 import net.jini.jeri.tcp.TcpServerEndpoint;
 import net.jini.lookup.JoinManager;
+import net.jini.lookup.ServiceDiscoveryManager;
 import net.jini.lookup.entry.ServiceInfo;
 import net.jini.security.BasicProxyPreparer;
 import net.jini.security.ProxyPreparer;
 import net.jini.security.TrustVerifier;
 import net.jini.security.proxytrust.ServerProxyTrust;
+import org.apache.river.api.util.FutureObserver;
+import org.apache.river.api.util.FutureObserver.ObservableFuture;
 import org.apache.river.api.util.Startable;
+import org.apache.river.impl.thread.ExtensibleExecutorService;
+import org.apache.river.impl.thread.ExtensibleExecutorService.RunnableFutureFactory;
 import org.apache.river.impl.thread.NamedThreadFactory;
+import org.apache.river.impl.thread.ObservableFutureTask;
+import org.apache.river.impl.thread.SynchronousExecutors;
 
 /**
  * Base server-side implementation of a lookup service, subclassed by
@@ -305,7 +323,9 @@ class RegistrarImpl implements Registrar
     /** Manager for joining other lookup services */
     private volatile JoinManager joiner; // accessed without lock from DestroyThread
     /** Executors for sending events and discovery responses */
-    private final ExecutorService eventNotifierExec;
+    private final SynchronousExecutors eventNotifierExec;
+    private final Map<EventReg,ExecutorService> eventTaskMap;
+//    private final EventTaskQueue eventTaskQueue;
     private final ExecutorService discoveryResponseExec;
     /** Service lease expiration thread */
     private final Thread serviceExpirer;
@@ -398,6 +418,7 @@ class RegistrarImpl implements Registrar
     private Configuration config;
     private Exception constructionException;
     private AccessControlContext context;
+    
 
     /**
      * Constructs RegistrarImpl based on a configuration obtained using the
@@ -522,8 +543,27 @@ class RegistrarImpl implements Registrar
         multicastAnnouncementConstraints = init.multicastAnnouncementConstraints;
         unicastDiscoveryConstraints = init.unicastDiscoveryConstraints;
         context = init.context;
-        eventNotifierExec = init.eventNotifierExec;
-        discoveryResponseExec = init.discoveryResponseExec;
+        eventNotifierExec = new SynchronousExecutors(init.scheduledExecutor);
+                
+//                new ExtensibleExecutorService(init.executor,
+//            new RunnableFutureFactory(){
+//
+//                @Override
+//                public <T> RunnableFuture<T> newTaskFor(Runnable r, T value)
{
+//                     if (r instanceof ObservableFutureTask) return (RunnableFuture<T>)
r;
+//                     return new ObservableFutureTask(r, value);
+//                }
+//
+//                @Override
+//                public <T> RunnableFuture<T> newTaskFor(Callable<T> c)
{
+//                    if (c instanceof ObservableFutureTask) return (RunnableFuture<T>)
c;
+//                    return new ObservableFutureTask(c);
+//                }
+//
+//            });
+//        eventTaskQueue = new EventTaskQueue(eventNotifierExec);
+        eventTaskMap = new TreeMap<EventReg,ExecutorService>();
+        discoveryResponseExec = init.executor;
         ReliableLog log = null;
         Thread serviceExpirer = null;
         Thread eventExpirer = null;
@@ -2010,8 +2050,110 @@ class RegistrarImpl implements Registrar
 	}
     }
     
+//    private static class DependencyLinker implements FutureObserver {
+//        private final ExecutorService executor;
+//        private final ObservableFuture precedent;
+//        private final FutureTask dependant;
+//
+//        public DependencyLinker(ExecutorService ex, ObservableFuture precedent, FutureTask
dep) {
+//            executor = ex;
+//            this.precedent = precedent;
+//            dependant = dep;
+//        }
+//
+//        public synchronized void register() {
+//            precedent.addObserver(this);
+//        }
+//
+//        @Override
+//        public synchronized void futureCompleted(Future e) {
+//            if (precedent.equals(e)) executor.submit(dependant);
+//        }
+//
+//    }
+//     /**
+//     * 
+//     */
+//    static final class EventTaskWrapper extends ObservableFutureTask 
+//    {
+//        private final EventTask task;
+//
+//        private EventTaskWrapper(Runnable r, Object result) {
+//            super(r, result);
+//            if (r instanceof EventTask) task = (EventTask) r;
+//            else task = null;
+//        }
+//
+//        private EventTaskWrapper(Callable c)
+//        {
+//            super(c);
+//            task = null;
+//        }
+//        
+//        private EventTask getTask(){
+//            return task;
+//        }
+//    }
+//    
+//    private static class EventTaskWrapperComparator 
+//        implements Comparator<EventTaskWrapper> {
+//
+//        @Override
+//        public int compare(EventTaskWrapper o1, EventTaskWrapper o2) {
+//            EventTask t1 = o1.getTask();
+//            EventTask t2 = o2.getTask();
+//            if (t1.seqNo < t2.seqNo) return -1;
+//            if (t1.seqNo > t2.seqNo) return 1;
+//            return 0;
+//        }
+//        
+//    }
+//    
+//    private static final class EventTaskQueue implements FutureObserver {
+//        // CacheTasks pending completion.
+//        private final List<EventTaskWrapper> pending;
+//        private final ExecutorService executor;
+//        
+//        private EventTaskQueue(ExecutorService e){
+//            this.pending = new ArrayList<EventTaskWrapper>(200);
+//            executor = e;
+//        }
+//        
+//        private EventTaskWrapper submit(EventTask t){
+//            EventTaskWrapper future = new EventTaskWrapper(t, null);
+//            EventTaskWrapper precedent = null;
+//            synchronized (pending){
+//                pending.add(future);
+//                future.addObserver(this);
+//                Iterator<EventTaskWrapper> it = pending.iterator();
+//                while (it.hasNext()){
+//                    EventTaskWrapper w = it.next();
+//                    EventTask c = w.getTask();
+//                    if (t.dependsOn(c)) {
+//                        precedent = w;
+//                        break;
+//                    }
+//                }
+//            }
+//            if (precedent == null){
+//                executor.submit(future);
+//            } else {
+//                DependencyLinker linker = new DependencyLinker(executor, precedent, future);
+//                linker.register();
+//            }
+//            return future;
+//        }
+//
+//        @Override
+//        public void futureCompleted(Future e) {
+//            synchronized (pending){
+//                pending.remove(e);
+//            }
+//        }
+//    }
+//    
     /** An event to be sent, and the listener to send it to. */
-    private static final class EventTask implements Runnable, Comparable<EventTask>
{
+    private static final class EventTask implements Callable<Boolean>, Comparable<EventTask>
{
 
 	/** The event registration */
 	private final EventReg reg;
@@ -2043,7 +2185,7 @@ class RegistrarImpl implements Registrar
 	}
 
 	/** Send the event */
-	public void run() {
+	public Boolean call() throws Exception {
 	    if (logger.isLoggable(Level.FINE)) {
 		logger.log(
 		    Level.FINE,
@@ -2054,6 +2196,7 @@ class RegistrarImpl implements Registrar
 		reg.listener.notify(new RegistrarEvent(proxy, reg.eventID,
 						       seqNo, reg.handback,
 						       sid, transition, item));
+                return Boolean.TRUE;
 	    } catch (Throwable e) {
 		switch (ThrowableConstants.retryable(e)) {
 		case ThrowableConstants.BAD_OBJECT:
@@ -2082,9 +2225,21 @@ class RegistrarImpl implements Registrar
 			    e);
 		    }
 		}
+                return Boolean.FALSE;
 	    }
 	}
-
+        
+        /** Keep events going to the same listener ordered. 
+         * Returns a positive integer if depends, 0 if 
+         * no dependency exists and a negative integer if 
+         * precedes.
+         */
+	public boolean dependsOn(EventTask obj) {
+            if (obj == null) return false;
+            if (reg.listener.equals(obj.reg.listener)) return true;
+	    return false;
+	}
+        
         /**
          * This is inconsistent with Object.equals, it is simply intended to
          * order tasks by priority.
@@ -4242,6 +4397,7 @@ class RegistrarImpl implements Registrar
 	Long id = Long.valueOf(reg.eventID);
 	eventByID.put(id, reg);
 	eventByTime.put(reg, reg);
+        eventTaskMap.put(reg, eventNotifierExec.newSerialExecutor(new PriorityBlockingQueue())
);
 	if (reg.tmpl.serviceID != null) {
 	    Object val = subEventByService.get(reg.tmpl.serviceID);
 	    if (val == null)
@@ -4274,6 +4430,7 @@ class RegistrarImpl implements Registrar
 	Long id = Long.valueOf(reg.eventID);
 	eventByID.remove(id);
 	eventByTime.remove(reg);
+        eventTaskMap.remove(reg);
 	if (reg.tmpl.serviceID != null) {
 	    Object val = subEventByService.get(reg.tmpl.serviceID);
 	    if (val == reg) {
@@ -4705,8 +4862,8 @@ class RegistrarImpl implements Registrar
          String unicastDiscoveryHost;
          Configuration config;
          AccessControlContext context;
-         ExecutorService eventNotifierExec;
-         ExecutorService discoveryResponseExec;
+         ExecutorService executor;
+         ScheduledExecutorService scheduledExecutor;
         
         
         
@@ -4896,22 +5053,18 @@ class RegistrarImpl implements Registrar
             double blocking_coefficient = 0.9; // 0 CPU intensive to 0.9 IO intensive
             int numberOfCores = Runtime.getRuntime().availableProcessors();
             int poolSizeLimit = (int) (numberOfCores / ( 1 - blocking_coefficient));
-            this.eventNotifierExec = Config.getNonNullEntry(
+            this.scheduledExecutor = Config.getNonNullEntry(
                 config, 
                 COMPONENT, 
                 "eventNotifierExecutor",
-                ExecutorService.class, 
-                new ThreadPoolExecutor(
-                    poolSizeLimit, 
-                    poolSizeLimit, /* Ignored */
-                    15L, 
-                    TimeUnit.MINUTES, 
-                    new PriorityBlockingQueue(poolSizeLimit * 4), /* Unbounded Ordered Queue
*/
+                ScheduledExecutorService.class, 
+                new ScheduledThreadPoolExecutor(
+                    1,
                     new NamedThreadFactory("Reggie_Event_Notifier", true)   
                 )
             );
             // Set up Executor to perform discovery responses
-            this.discoveryResponseExec = Config.getNonNullEntry(
+            this.executor = Config.getNonNullEntry(
                 config, 
                 COMPONENT, 
                 "discoveryResponseExecutor", 
@@ -5029,6 +5182,7 @@ class RegistrarImpl implements Registrar
                     unicaster.start();
                     multicaster.start();
                     announcer.start();
+                    eventNotifierExec.start();
 
                     /* Shutdown hook so reggie sends a final announcement
                      * packet if VM is terminated.  If reggie is terminated
@@ -5823,7 +5977,8 @@ class RegistrarImpl implements Registrar
     {
 	if (item != null)
 	    item = copyItem(item);
-	eventNotifierExec.execute(new EventTask(reg, sid, item, transition, proxy, this, now));
+        // Should never be null.
+	eventTaskMap.get(reg).submit(new EventTask(reg, sid, item, transition, proxy, this, now));
     }
 
     /** Generate a new service ID */

Modified: river/jtsk/skunk/qa_refactor/trunk/src/net/jini/lookup/JoinManager.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/net/jini/lookup/JoinManager.java?rev=1563596&r1=1563595&r2=1563596&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/net/jini/lookup/JoinManager.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/net/jini/lookup/JoinManager.java Sun Feb  2 12:31:09
2014
@@ -1036,7 +1036,7 @@ public class JoinManager {
      *  should be registered.
      */
     private class ProxyReg implements FutureObserver{
-       
+
         /** Class that is registered as a listener with this join manager's
          *  lease renewal manager. That lease renewal manager manages the
          *  lease granted to this join manager's associated service by the



Mime
View raw message