Loading...
Searching...
No Matches
IDataDistributionMastershipCommon Class Referenceabstract

Interface to be implemented from mastership subsystem. More...

#include <DataDistributionManager.h>

Public Member Functions

virtual OPERATION_RESULT Initialize (IDataDistributionSubsystem *transportManager, IDataDistributionMastershipCallback *cbs, const char *hostAddress=NULL, const char *arrayParams[]=NULL, int len=0)=0
 Initialize the subsystem.
 
virtual void SetParameter (const char *paramName, const char *paramValue)=0
 Sets a parameter at run-time.
 
virtual const char * GetParameter (const char *paramName)=0
 Reads a parameter at run-time.
 
virtual OPERATION_RESULT Start (unsigned long timeout)=0
 Start the mastership subsystem.
 
virtual OPERATION_RESULT Stop (unsigned long timeout)=0
 Stop the mastership subsystem.
 
virtual BOOL GetIamNextPrimary ()=0
 Verify if this server will be elected as next primary.
 
virtual BOOL RequestIAmNextPrimary ()=0
 Request to be the next primary server.
 
virtual int64_t * GetClusterIndexes (size_t *length)=0
 Returns an array of all known indexes of the servers within the cluster.
 
virtual DDM_INSTANCE_STATE GetStateOf (int64_t serverId)=0
 Returns the DDM_INSTANCE_STATE of a specific server.
 
virtual ClusterHealth GetClusterHealth ()=0
 Returns the health of the cluster.
 
virtual DDM_INSTANCE_STATE GetMyState ()=0
 Returns DDM_INSTANCE_STATE of this instance.
 
virtual void ChangeMyState (DDM_INSTANCE_STATE state)=0
 Change DDM_INSTANCE_STATE of this instance.
 
virtual void ChangeState (int64_t instanceId, DDM_INSTANCE_STATE state)=0
 Change DDM_INSTANCE_STATE of instanceId.
 
virtual int64_t GetLocalServerId ()=0
 Returns the server id of the local instance.
 
virtual int64_t GetPrimaryServerId ()=0
 Returns the server id of the primary instance.
 
virtual int64_t GetMessageDelay ()=0
 Returns the message delay within the cluster.
 
virtual int64_t GetUpTime ()=0
 Returns the current uptime.
 

Detailed Description

Interface to be implemented from mastership subsystem.

Interface to be implemented from mastership subsystem

Member Function Documentation

◆ ChangeMyState()

virtual void IDataDistributionMastershipCommon::ChangeMyState ( DDM_INSTANCE_STATE  state)
pure virtual

Change DDM_INSTANCE_STATE of this instance.

state DDM_INSTANCE_STATE expected

◆ ChangeState()

virtual void IDataDistributionMastershipCommon::ChangeState ( int64_t  instanceId,
DDM_INSTANCE_STATE  state 
)
pure virtual

Change DDM_INSTANCE_STATE of instanceId.

instanceId server id to change state state DDM_INSTANCE_STATE expected

◆ GetClusterHealth()

virtual ClusterHealth IDataDistributionMastershipCommon::GetClusterHealth ( )
pure virtual

Returns the health of the cluster.

Returns
the ClusterHealth

◆ GetClusterIndexes()

virtual int64_t * IDataDistributionMastershipCommon::GetClusterIndexes ( size_t *  length)
pure virtual

Returns an array of all known indexes of the servers within the cluster.

length the parameter receiving the length of returned buffer

Returns
the buffer of known indexes
Remarks
the returned buffer shall be freed

◆ GetIamNextPrimary()

virtual BOOL IDataDistributionMastershipCommon::GetIamNextPrimary ( )
pure virtual

Verify if this server will be elected as next primary.

Returns
TRUE if this server is the next primary

◆ GetLocalServerId()

virtual int64_t IDataDistributionMastershipCommon::GetLocalServerId ( )
pure virtual

Returns the server id of the local instance.

Returns
the server id

◆ GetMessageDelay()

virtual int64_t IDataDistributionMastershipCommon::GetMessageDelay ( )
pure virtual

Returns the message delay within the cluster.

Returns
the message delay in milliseconds

◆ GetMyState()

virtual DDM_INSTANCE_STATE IDataDistributionMastershipCommon::GetMyState ( )
pure virtual

Returns DDM_INSTANCE_STATE of this instance.

Returns
the DDM_INSTANCE_STATE

◆ GetParameter()

virtual const char * IDataDistributionMastershipCommon::GetParameter ( const char *  paramName)
pure virtual

Reads a parameter at run-time.

paramName the parameter name

Returns
parameter value

◆ GetPrimaryServerId()

virtual int64_t IDataDistributionMastershipCommon::GetPrimaryServerId ( )
pure virtual

Returns the server id of the primary instance.

Returns
the server id

◆ GetStateOf()

virtual DDM_INSTANCE_STATE IDataDistributionMastershipCommon::GetStateOf ( int64_t  serverId)
pure virtual

Returns the DDM_INSTANCE_STATE of a specific server.

serverId server index to get DDM_INSTANCE_STATE

Returns
the DDM_INSTANCE_STATE

◆ GetUpTime()

virtual int64_t IDataDistributionMastershipCommon::GetUpTime ( )
pure virtual

Returns the current uptime.

Returns
the uptime in milliseconds

◆ Initialize()

virtual OPERATION_RESULT IDataDistributionMastershipCommon::Initialize ( IDataDistributionSubsystem transportManager,
IDataDistributionMastershipCallback cbs,
const char *  hostAddress = NULL,
const char *  arrayParams[] = NULL,
int  len = 0 
)
pure virtual

Initialize the subsystem.

transportManager IDataDistributionSubsystem to use cbs IDataDistributionMastershipCallback to communicate information hostAddress optional host address or host name arrayParams an array of string in the form key=value len length of arrayParams

Returns
the OPERATION_RESULT of the operation

◆ RequestIAmNextPrimary()

virtual BOOL IDataDistributionMastershipCommon::RequestIAmNextPrimary ( )
pure virtual

Request to be the next primary server.

Returns
TRUE in case of success

◆ SetParameter()

virtual void IDataDistributionMastershipCommon::SetParameter ( const char *  paramName,
const char *  paramValue 
)
pure virtual

Sets a parameter at run-time.

paramName the parameter name paramValue the parameter value

◆ Start()

virtual OPERATION_RESULT IDataDistributionMastershipCommon::Start ( unsigned long  timeout)
pure virtual

Start the mastership subsystem.

timeout the operation timeout in milliseconds

Returns
the OPERATION_RESULT of the operation

◆ Stop()

virtual OPERATION_RESULT IDataDistributionMastershipCommon::Stop ( unsigned long  timeout)
pure virtual

Stop the mastership subsystem.

timeout the operation timeout in milliseconds

Returns
the OPERATION_RESULT of the operation

The documentation for this class was generated from the following file: