Description of CPM. More...
Description of CPM.
If you have not already done so, please read the high availability section of OpenClovis SDK user guide to get an idea of the architecture of the AMF in general and CPM in particular.
The functions exposed by the CPM can be classified as SAF APIs and non SAF APIs. Non SAF APIs include other utility APIs provided by the CPM.
CPM exposes most of the SAF defined interfaces, which can be used by the application developers to develop highly available applications.
The APIs in this section fall into various category as defined in the SAF AMF specification.
The application begins its life cycle by calling clCpmClientInitialize() API. It can call the clCpmSelectionObjectGet() to get a OS specific object on which to wait for the callbacks that are or will be invoked by the CPM. To actually execute the callback in the applications context, the application can call clCpmDispatch() API. When the process is terminating gracefully, it should call the clCpmClientFinalize() API to indicate its end of association with the CPM client.
The application can call clCpmComponentRegister() to notify to the AMF that it is now ready to provide service. It should call the clCpmComponentUnregister while terminating. The clCpmComponentNameGet() API returns the name of calling component. This is the name that should be used while registration and unregistration.
The application can call clCpmHAStateGet() API to query AMF about the HA state of the component for a particular component service instance. The application should call the clCpmCSIQuiescingComplete() API to indicate to AMF that it has serviced all the pending requests since being moved to the quiesced state and can now be terminated.
To request the AMF to track the changes in the protection group associated with a component service instance, the application should call clCpmProtectionGroupTrack() API. Different kinds of track are supported via different flags. To request the AMF to stop tracking the changes in the protection group associated with a component service instance, the application should call clCpmProtectionGroupTrackStop() API.
A component can report error on either itself or some other component using the clCpmComponentFailureReport() API.
The application can call clCpmResponse() API to indicate the status of carrying out the AMFs request (Callbacks invoked by the CPM) in the applications context. a
The AMF assigns work to a component by invoking ClCpmCSISetCallbackT. To be more specific, the AMF requests the application to assume a particular HA state for component on behalf of a component service instance by invoking this callback. Depending on the HA state which is passed by this callback, the application can start providing service.
The AMF removes work assigned to a component by invoking ClCpmCSIRmvCallbackT. The AMF requests that the component stop providing service for a particular component service instance, by invoking this callback.
The AMF invokes the ClCpmProtectionGroupTrackCallbackT in the applications context, whenever there is a change in the protection group associated with a component service instance and the application has called clCpmProtectionGroupTrack() API to track changes in the same protection group.
The AMF requests the component to gracefully terminate by invoking ClCpmTerminateCallbackT. The application is supposed to call clCpmComponentUnregister() and clCpmClientFinalize() API after doing all the component specific finalization.
The AMF requests a proxy component to instantiate a proxied component by invoking ClCpmProxiedComponentInstantiateCallbackT callback of the proxy component.
The AMF requests a proxy component to abruptly terminate a proxied component by invoking ClCpmProxiedComponentCleanupCallbackT callback of the proxy component.
The clCpmComponentIdGet() API returns an ID which is guaranteed to be unique in the cluster.
The clCpmComponentAddressGet() API can be called by the application to find out the communication port of some other component, by giving the name of the component and address of the node where the component is present.
To find out the address of the active system controller node in the cluster the application can call clCpmMasterAddressGet() API. To check whether it is running on active system controller node it can call clCpmIsMaster() API. To find the name of the node where the application is running it can call the clCpmLocalNodeNameGet() API.