COSMOS Design 231343
Improve query capability of the COSMOS broker
|Hubert Leung||June 23, 2008|
|Process||Sizing||Names of people doing the work|
|Build and infrastructure||0||Saurabh Dravid|
|Code review, etc.*|
'* - includes other committer work (e.g. check-in, contribution tracking)
Allow the COSMOS broker to accept more specific search criteria when searching for a list of data managers. The goal is to return a more relevant list of EPRs of data managers.
In the current implementation (as of i11), the broker supports three query operations:
- Get all data managers: return the list of all data managers registered at the broker
- Get data managers by hostname and name
- Get data managers that support a given web service: Provide the namespace of a web service definition as a parameter. Return the list of all data managers that support a web service with that namespace. E.g. "Find all data managers that support the CMDBf query service" will return the list of all MDRs.
- Searching for data managers by service namespace is sometimes insufficient. For example, when searching for MDRs, we want to filter by the record types managed by the MDRs. "Find all MDRs that manages asset data." Simply asking for data managers that support the CMDBf query service is not specific enough, and the query result may include EPRs of data managers that manage irrelevant data.
- Cannot support for data managers by new configuration values introduced by enhancement 233690.
New query capabilities to be supported:
- query EPRs by ID of data manager
- use case: a client queries the federating CMDB for a list of configuration items. Each item will have an InstanceID element which include the mdrId and the localId. The client can find the EPR the MDR from the broker by providing the MDR ID. With the EPR of the MDR, the client can issue CMDBf queries to the MDR.
- query by property values of the data manager: return data managers that has the required properties name-value pairs
- query by data-namespace of a CMDBf query service: return data managers that support the CMDBf query service, which indicates the given namespace in the service metadata for the recordTypes.
- Address limitation 1 explained above.
- use case: The current implementation allows the broker client to query for data managers by the namespace of the web services supported by the data managers. In CMDBf scenario, all MDRs support the CMDBf query service. However, we need more information to differentiate between the MDRs as they provide different information. We want to avoid asking the broker client to get a long list of MDRs and loop through them to decide which one in fact contains the type of data the client application is looking for. The service metadata of the CMDBf query service can indicate the namespace of record types. This new function is to allow broker client query for MDRs by the data-type namespace. The namespace is the unique identifier of the schema that defines the data structure.
- Remove the get data managers by hostname and group name function: enhancement 233690 has proposed to consolidate the indentifiers of all data managers to use globally unique URIs.
Cache more static values of the data managers at the broker, and allow the use of these values as query criteria when querying for EPRs of data managers.
- Broker clients can only query for EPRs of data managers by values cached at the broker. The broker won't dispatch queries to multiple queries to do the filter matching at real time.
- The indexes of data managers are static values, and can be cached at the broker
- Better performance
- Reduce complexity
- Queries for data managers will only return EPRs, not metadata definition.
- Metadata can be retrived from the client of the data managers. We don't need to use the broker to relay the information.
- Note that this decision is contrary to the original description of this enhancement request, but I think the solution can address the use case.
- Broker only stores static values about data managers.
- Broker only stores locale-independent data.
- Use namespaces to identify data model and schema instead of keywords.
- The use case written on the use case page asks for a function to search EPRs by keywords such as "storage". You can consider a data schema as a way to define a dictionary of "keywords" and the data structure. Using the namespace to identify a schema can effectively gaurentees the datastore supports a certain set of data types and data structures.
- The namespace of record types can be specified in the service metadata of CMDBf query and registation services.
Registering data managers with broker
- During registration, the following values will be included for each data manager, in addition to the current values:
- ID (an URI, equals to the MDR ID for an MDR)
- RecordTypeNamespace (for CMDBf query and registration services, if defined in service metadata)
New web service operations for the broker
Pseudo-schema for the SOAP body:
<getDataManager> <id>xs:anyURI</id> | (<property name="xs:string" value ="xs:string"> * <services> <serviceNamespace>xs:anyURI</serviceNamespace> + <recordTypesNamespace>xs:anyURI</recordTypesNamespace> * </services>) </getDataManager>
Impacts of this enhancement
- Command line client needs to expose the new query functions