Skip to Content.
Sympa Menu

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

Subject: perfsonar development work

List archive

perfsonar: r4755 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4755 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1
  • Date: Tue, 9 Dec 2008 06:17:17 -0500

Author: michael.bischoff
Date: 2008-12-09 06:17:17 -0500 (Tue, 09 Dec 2008)
New Revision: 4755

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/Level1Impl.java
Log:
Improved robustness: if querying gls succeeds but returns a perfsonar handled
error it demotes the gls and tries an other.

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
2008-12-09 11:15:42 UTC (rev 4754)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/DiscoveryProcessImpl.java
2008-12-09 11:17:17 UTC (rev 4755)
@@ -75,35 +75,34 @@
}

protected DiscoveryStep firstStep(Set<LookupService>
referralLookupservices) {
- InputStream inputStream = queryRootLs();
- Collection<ServiceImpl> services;
- try {
- services =
JaxbTools.unMarshallPerfsonarMessage(context, inputStream, ServiceImpl.class);
- } catch (JAXBException e) {
- logger.warn("Exception while unMarshalling", e);
- return new DiscoveryStepImpl(e);
- } catch (XMLStreamException e) {
- logger.warn("Exception while unMarshalling", e);
- return new DiscoveryStepImpl(e);
- } catch (LsQueryException e) {
- logger.warn("Exception while unMarshalling", e);
- return new DiscoveryStepImpl(e);
- }
- logger.debug("First step succeded without error. Result:
["+services+"]");
- return new DiscoveryStepImpl(new
HashSet<AuthorativeLookupservice>(services));
- }
-
- private InputStream queryRootLs() {
DiscoveryQuery query = new
DiscoveryQuery(elements,eventTypes,type);

for(LookupService service : rootServices) {
logger.debug("Using Gls: " + service);
+
+ InputStream inputStream = null;
try {
- return
level0.getRawDiscoveryResponse(service,query.toString());
+ inputStream =
level0.getRawDiscoveryResponse(service,query.toString());
} catch (LsQueryException e) {
- rootServices.demote(service,e);
+ rootServices.demote(service,e);
+ continue;
}
+
+ try {
+ Collection<ServiceImpl> services =
JaxbTools.unMarshallPerfsonarMessage(context, inputStream, ServiceImpl.class);
+ logger.debug("First step succeded without
error. Result: ["+services+"]");
+ return new DiscoveryStepImpl(new
HashSet<AuthorativeLookupservice>(services));
+ } catch (JAXBException e) {
+ rootServices.demote(service,e);
+ continue;
+ } catch (XMLStreamException e) {
+ rootServices.demote(service,e);
+ continue;
+ } catch (LsQueryException e) {
+ rootServices.demote(service,e);
+ continue;
+ }
}
- throw new RuntimeException("None of the root lookupservices
could be consulted");
+ return new DiscoveryStepImpl(new LsQueryException("None of
the root lookupservices could be consulted"));
}
}

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/Level1Impl.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/Level1Impl.java
2008-12-09 11:15:42 UTC (rev 4754)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/Level1Impl.java
2008-12-09 11:17:17 UTC (rev 4755)
@@ -91,7 +91,7 @@
* @param service
* @param e
*/
- public void demote(LookupService service, LsQueryException e)
{
+ public void demote(LookupService service, Exception e) {
synchronized (mutex) {
logger.warn("Demoting serivce", e);
if(!data.contains(service)) return;



  • perfsonar: r4755 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1, svnlog, 12/09/2008

Archive powered by MHonArc 2.6.16.

Top of Page