Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5394 - in trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient: level1 utils

Subject: perfsonar development work

List archive

perfsonar: r5394 - in trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient: level1 utils


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5394 - in trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient: level1 utils
  • Date: Wed, 9 Dec 2009 09:53:04 -0500

Author: krzjed
Date: 2009-12-09 09:53:03 -0500 (Wed, 09 Dec 2009)
New Revision: 5394

Added:

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/utils/PoolController.java
Modified:

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/DiscoveryProcessImpl.java
Log:
added limit for parallel requests during querying gLS'

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/DiscoveryProcessImpl.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/DiscoveryProcessImpl.java
2009-12-09 12:54:38 UTC (rev 5393)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/DiscoveryProcessImpl.java
2009-12-09 14:53:03 UTC (rev 5394)
@@ -22,6 +22,7 @@
import org.perfsonar.lsclient.data.TopologyElement;
import org.perfsonar.ri.lsclient.data.implementation.ServiceImpl;
import org.perfsonar.ri.lsclient.handlers.ServiceCollectionHandler;
+import org.perfsonar.ri.lsclient.utils.PoolController;
import org.perfsonar.ri.lsclient.utils.ResultContainer;
import org.perfsonar.ri.lsclient.xml.ResponseParser;
import org.xml.sax.SAXException;
@@ -79,20 +80,28 @@

final DiscoveryQuery query = new DiscoveryQuery(elements,
eventTypes, type);
final ResultContainer<InputStream> sc = new
ResultContainer<InputStream>();
-
+ final PoolController pc = new PoolController(3);
List<Thread> threads = new ArrayList<Thread>();

for (final LookupService service : rootServices) {
Thread t = new Thread() {
@Override
public void run() {
- logger.debug("Using Gls: " + service);
try {
- sc.setValue(level0.getRawDiscoveryResponse(service,
query.toString()));
+ if (pc.doContinue()) {
+ logger.debug("Using Gls: " + service);
+
sc.setValue(level0.getRawDiscoveryResponse(service, query.toString()));
+ pc.processingFinished();
+ pc.finished();
+ }
} catch (LsQueryException e) {
rootServices.demote(service, e);
+ } catch (InterruptedException e) {
+ pc.finished();
+ logger.error(e);
}
}
+
};
threads.add(t);
t.setDaemon(true);

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/utils/PoolController.java



  • perfsonar: r5394 - in trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient: level1 utils, svnlog, 12/09/2009

Archive powered by MHonArc 2.6.16.

Top of Page