Previous | Contents | Index |
RTR();
None
None
Call this method to declare an RTR object.
RTR *myRTR = new RTR();
rtr_status_t Start();
rtr_status_t Interpret value for the success or failure of this call.
None
Call this method to start RTR on a node.
// declare RTR object. RTR *myRTR = new RTR(); rtr_status_t sStatus; sStatus = myRTR->Start();
rtr_status_t StartWebServer(bool bAuthentication = true, bool bReadOnlyAccess = false);
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
bAuthentication
A boolean attribute for specifying and controlling the web server user authentication. The default setting is for the server to perform user authentication using the username and password. This may be disabled, allowing anyone with a browser to access the management component.bReadOnlyAccess
A boolean attribute for specifying read-only access to the web browser RTR management component. A server started with the StartWebServer method servers status and monitor pages but does not permit any changes to be made to the configuration. By specifying read-only access for server operation, no shadowing or journaling is required. The message is still written to the journal but is not played to a shadow and is purged after the transaction is completed on the primary server. The message is still needed in the journal to allow recovery of in-flight transactions.
Call this method to start RTR on a web server. This starts a user's HTTP server component, thus enabling usage of the web browser RTR management component for the calling user.
bool RTR::StartWebServer() { bool bOverallResult = true; RTR MyRTR; rtr_status_t stsStartWebServer; stsStartWebServer = MyRTR.StartWebServer(); if (IsFailure(stsStartWebServer == RTR_STS_OK)) { bOverallResult = false; OutputStatus(stsStartWebServer); }
rtr_status_t Stop();
rtr_status_t Interpret value for the success or failure of this call.
Status | Description |
---|---|
RTR_STS_ ACPDIED | The RTR ACP is no longer running, restart RTR. |
RTR_STS_OK | Normal successful completion. |
RTR_STS_ RTRNOTRUN | RTR not running. |
None
Call this method to stop RTR on a node. Calling this method stops all RTR activity on the computer where it is called. Any running applications receive the error indication RTR_STS_NOACP. All facilities, links, and partitions are destroyed.
// declare RTR object RTR *myRTR = new RTR(); rtr_status_t sStatus; sStatus = myRTR->Stop();
rtr_status_t StopWebServer();
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_ NFW | Operation requires SETPRV privilege. |
RTR_STS_OK | Normal successful completion. |
RTR_STS_SRVDISCON | Server disconnected on node 'nodename.' |
None
Call this method to stop RTR on a web server.
rtr_status_t stsStopWebServer; stsStopWebServer = MyRTR.StopWebServer(); if (IsFailure(stsStopWebServer == RTR_STS_OK || stsStopWebServer == RTR_STS_SRVDISCON)) { bOverallResult = false; OutputStatus(stsStopWebServer); }
4.2 RTRBackendPartitionProperties
This class holds and makes available the properties of its associated
RTRBackendPartition object. This allows the RTR application to Get and
Set various attributes of an RTR partition. This class may be called by
both new C++ API and legacy applications.
Construction
Method | Description |
---|---|
RTRBackendPartitionProperties(const char) | Constructor |
~RTRBackendPartitionProperties(const char) | Destructor |
Operations()
Method | Description |
---|---|
GetFacilityName(rtr_facnam_t,
const size_t) |
Gets the facility name associated with the RTRPartition object this RTRPartitionProperties object describes. |
GetNumberOfRecoveredTransactions
(rtr_uns_32_t) |
Gets the number of recovered transactions associated with the RTRPartition object this RTRPartitionProperties object describes. |
GetPartitionName(rtr_parnam_t, const size_t) | Gets the partition name associated with the RTRPartition object this RTRPartitionProperties object describes. |
GetRetryCount(rtr_uns_32_t) | Gets the number of retrys associated with the RTRPartition object this RTRPartitionProperties object describes. |
SetFailoverPolicy(const eRTRFailoverPolicy) | Defines the policy that RTR should take when a primary partition fails. |
SetPriorityList(const char) | Sets a relative priority used by RTR when selecting a backend member to make active. |
SetRecoveryRetryCount
(rtr_uns_32_t) |
Indicates the maximum number of times that a transaction should be presented for recovery before being written to the journal as an exception. |
rtr_status_t GetFacilityName(rtr_facnam_t pszFacilityName, const size_t uiFacilityNameSize);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_ APPBUFFTOOSMALL | The application buffer is too small. |
RTR_STS_INVARGPTR | Invalid parameter address specified on last call. |
RTR_STS_OK | Normal successful completion. |
pszFacilityName
Pointer to a zero-terminated string receiving the facility name for the RTRPartition this RTRPartitionProperties object describes.uiFacilityNameSize
An unsigned integer for the size of the specified facility name. The maximum string length is RTR_MAX_FACNAM_LEN.
Gets the facility name associated with the RTRPartition object this RTRPartitionProperties object describes.
// declare a partition properties object. rtr_status_t sStatus; RTRBackendPartitionProperties *pPartProperties = PartitionManager.GetBackendPartitionProperties("MyPartition"); char *pszFacilityName = new char[RTR_MAX_FACNAM_LEN+1]; sStatus = pPartProperties->GetFacilityName(pszFacilityName, RTR_MAX_FACNAM_LEN+1);
rtr_status_t GetNumberOfRecoveredTransactions(rtr_uns_32_t &uiNumberRecoveredTxns);
Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
uiNumberRecoveredTxns
A referenced value of type rtr_uns_32_t which receives the number of recovered transactions.
Gets the number of recovered transactions associated with the RTRPartition object this RTRPartitionProperties object describes.For more information, see the RTR System Manager's Manual.
// declare a partition properties object. rtr_status_t sStatus; RTRBackendPartitionProperties *pPartProperties = PartitionManager.GetBackendPartitionProperties()"MyPartition"); rtr_uns_32_t iNumberRecoveredTxns sStatus = pPartProperties-> GetNumberOfRecoveredTransactions(iNumberRecoveredTxns);
rtr_status_t GetPartitionName(rtr_parnam_t pszPartitionName const size_t uiPartitionNameSize);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_APPBUFFTOOSMALL | The application buffer is too small. |
RTR_STS_INVARGPTR | Invalid parameter address specified on last call. |
RTR_STS_OK | Normal successful completion. |
pszPartitionName
Pointer to a null-terminated string receiving the partition name for the RTRPartition this RTRPartitionProperties object describes.uiPartitionNameSize
An unsigned integer for the size of the specified partition name.
Gets the partition name associated with the RTRPartition object this RTRPartitionProperties object describes.
// declare a partition properties object. rtr_status_t sStatus; RTRBackendPartitionProperties *pPartProperties = PartitionManager.GetBackendPartitionProperties("MyPartition"); char *pszPartitionName = new char[RTR_MAX_PARNAM_LEN+1]; sStatus = pPartProperties->GetPartitionName(pszPartitionName, RTR_MAX_PARNAM_LEN+1);
rtr_status_t GetRetryCount(rtr_uns_32_t &uiRetryCount);
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
uiRetryCount
A referenced value of type rtr_uns_32_t which receives the number of retries.
Gets the number of times a transaction has been retried after a failure.
// declare a partition properties object. rtr_status_t sStatus; RTRBackendPartitionProperties *pPartProperties = PartitionManager.GetBackendPartitionProperties("MyPartition"); rtr_uns_32_t iRetryCount; sStatus = pPartProperties->GetRetryCount(iRetryCount);
RTRBackendPartitionProperties( rtr_const_parnam_t pszPartitionName ); virtual ~RTRBackendPartitionProperties();
None
pszPartitionName
Pointer to a zero-terminated string containing the partition name for which this RTRPartitionProperties object is being created.
Call this constructor to create an RTRPartitionProperties object for the partition named.
// Create BackendPartitionProperties object RTRBackendPartitionProperties *pBEPartitionProperties; pBEPartitionProperties = pPartitionManager-> GetBackendPartitionProperties(GetDefaultPartitionName()); if (IsFailure(pBEPartitionProperties != NULL)) { bOverallResult = false; cout << endl << " In Test_GetFacilityName(), pPartitionManager->GetBackendPartitionProperties() call failed." << endl; delete pPartitionManager; return bOverallResult; }
rtr_status_t SetFailoverPolicy(const eRTRFailoverPolicy eFailoverPolicy);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion. |
RTR_STS_PRTBADCMD | Partition command invalid or not implemented in this version of RTR. |
eRTRFailoverPolicy
An attribute for specifying an RTR failover policy:1 = RTRFailOverToShadow
2 = RTRFailOverToStandBy
Determines the action to take when the primary partition fails. The default action is to allow a standby of the primary to become the new primary. Optionally, RTR can be set to change state so that the secondary becomes primary, and a standby of the old primary (if any) becomes the new secondary.
// declare a partition properties object. rtr_status_t sStatus; RTRBackendPartitionProperties *pPartProperties = PartitionManager.GetBackendPartitionProperties("MyPartition"); const RTRFailoverPolicy eFailoverPolicy = RTRFailOverToShadow; sStatus = pPartProperties->SetFailoverPolicy(eFailoverPolicy);
rtr_status_t SetPriorityList(const char *pszPriorityList);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion. |
RTR_STS_PRTBADCMD | Partition command invalid or not implemented in this version of RTR. |
pszPriorityList
A null-terminated string pointer to a priority list.
Sets a relative priority used by RTR when selecting a backend member to make active. List the backends in your configuration in decreasing order of priority; the order of the list is taken into consideration when RTR is decides where to make a partition active.Suspend partitions before changing the priority list. It is not an error to enter different versions of the priority list at different backends, but this is not recommended. If calling SetPriorityList, it is recommended to call SetPriorityList programmatically before you register the partition with the server transaction controller.
// declare a partition properties object. rtr_status_t sStatus; RTRBackendPartitionProperties *pPartProperties = PartitionManager.GetBackendPartitionProperties("MyPartition"); char *pszPriorityList = "depth,length"; // list of BE for prioirty sStatus = pPartProperties->SetPriorityList(pszPriorityList);
rtr_status_t SetRecoveryRetryCount(rtr_uns_32_t & uiRetryCount);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_APPBUFFTOOSMALL | The application buffer is too small. |
uiRetryCount
A referenced value of type rtr_uns_32_t that receives the number of retries.
Call this method to set the recovery retry count. The recovery retry count indicates the maximum number of times that a transaction should be presented for recovery before being written to the journal as an exception. Once a transaction has been recorded as an exception, it is no longer considered eligible for recovery and will require manual processing by a qualified individual.
// declare a partition properties object. rtr_status_t sStatus; RTRBackendPartitionProperties *pPartProperties = PartitionManager.GetBackendPartitionProperties("MyPartition"); rtr_uns_32_t iRetryCount=10; // #of times to retry before giveup. sStatus = pPartProperties->SetRecoveryRetryCount(iRetryCount);
Previous | Next | Contents | Index |