On Thu, Oct 12, 2017 at 6:10 AM, Tom Pantelis <[email protected]> wrote:
> > > On Thu, Oct 12, 2017 at 6:05 AM, Faseela K <[email protected]> wrote: > >> >> >> >> >> *From:* Tom Pantelis [mailto:[email protected]] >> *Sent:* Thursday, October 12, 2017 3:23 PM >> *To:* Faseela K <[email protected]> >> *Cc:* Anil Vishnoi <[email protected]>; Muthukumaran K < >> [email protected]>; [email protected]; >> [email protected]; R Srinivasan E < >> [email protected]>; Dayavanti Gopal Kamath < >> [email protected]> >> *Subject:* Re: [controller-dev] Expose Datastore health to applications >> via infrautils.diagstatus >> >> >> >> >> >> So here is how diagstatus module works – any application should register >> as a “service” with the framework, report an initial status(using the APIs >> provided by diagstatus). >> >> There is another OsgiService “ServiceStatusProvider” exposed, and if >> applications implement the same, that will be called everytime an external >> request is made to get the current service status. >> >> In looking at the API, it appears an app would register with the >> DiagStatusService and invoke report each time its status changes. An app >> can also register a ServiceStatusProvider to report its status when >> queried. It seems this is an alternative to interacting with the >> DiagStatusService in looking at the DiagStatusServiceImpl which always >> calls updateServiceStatusMap to query the ServiceStatusProviders from the >> get* methods. Given that, why would an app need to explicitly register and >> push its status to the DiagStatusService? Why not just advertise a >> ServiceStatusProvider? This seems simpler. In that case, >> DiagStatusServiceImpl doesn't need to maintain the statusMap - it would >> just query the ServiceStatusProvider(s) on demand. Or am I missing >> something? >> >> >> >> For services like “DATASTORE” only the pull model is required, just >> register the service and implement ServiceStatusProvider. >> >> There are some usecases in genius, where a push model was preferred, and >> hence we have kept both the options open. >> > > OK. By "just register the service" I assume you mean just advertise a > ServiceStatusProvider > OSGi service. It is not necessary to explicitly register with the > DiagStatusService > as that is implicit by advertising a ServiceStatusProvider. > The code in DiagStatusServiceImpl does not enforce explicit registration - one can just call report w/o a prior register call - not sure if that was the original intent. Similarly a ServiceStatusProvider's status is reported even if it didn't explicitly call register. > >> >> Thanks, >> >> Faseela >> >> >> > >
_______________________________________________ controller-dev mailing list [email protected] https://lists.opendaylight.org/mailman/listinfo/controller-dev
