perfsonar-dev - perfsonar: r5420 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1
Subject: perfsonar development work
List archive
perfsonar: r5420 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1
Chronological Thread
- From:
- To:
- Subject: perfsonar: r5420 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1
- Date: Tue, 15 Dec 2009 09:44:54 -0500
Author: krzjed
Date: 2009-12-15 09:44:54 -0500 (Tue, 15 Dec 2009)
New Revision: 5420
Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/DiscoveryProcessImpl.java
Log:
added system property for max number of parallel requests
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-15 13:58:48 UTC (rev 5419)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/DiscoveryProcessImpl.java
2009-12-15 14:44:54 UTC (rev 5420)
@@ -35,6 +35,7 @@
private final Set<TopologyElement> elements;
private final Set<EventType> eventTypes;
private final Set<ServiceType> type;
+ protected final static int MAX_NO_OF_THREADS = 3;
public DiscoveryProcessImpl(Level0LsClientInterface level0, RootGlses
rootGlses, Set<TopologyElement> elements,
Set<EventType> eventTypes, Set<ServiceType> type) {
@@ -80,7 +81,8 @@
final DiscoveryQuery query = new DiscoveryQuery(elements,
eventTypes, type);
final ResultContainer<InputStream> sc = new
ResultContainer<InputStream>();
- final PoolController pc = new PoolController(3);
+ int maxNumber = this.getMaxNumber();
+ final PoolController pc = new PoolController(maxNumber);
List<Thread> threads = new ArrayList<Thread>();
for (final LookupService service : rootServices) {
@@ -128,4 +130,16 @@
}
return new DiscoveryStepImpl(new LsQueryException("None of the root
lookupservices could be consulted"));
}
+
+ private int getMaxNumber() {
+ String property;
+ int number;
+ try {
+ property =
System.getProperty("application.perfsonar.lsclient.maxOfParallelRequests");
+ number = Integer.parseInt(property);
+ } catch (Exception e) {
+ number = DiscoveryProcessImpl.MAX_NO_OF_THREADS;
+ }
+ return number;
+ }
}
- perfsonar: r5420 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1, svnlog, 12/15/2009
Archive powered by MHonArc 2.6.16.