Previous | Contents | Index |
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 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
RTRPartition 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 |
---|---|
RTRPartitionProperties(const char) | Constructor |
~RTRPartitionProperties(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 | 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 | 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);
Construction
Method | Description |
---|---|
RTRFacilityManager | Constructor |
~RTRFacilityManager() | Destructor |
Operations
Method | Description |
---|---|
AddBackend(rtr_const_facnam_t, rtr_const_nodnam_t) | Add a backend role to an existing facility. |
AddFrontend(rtr_const_facnam_t, rtr_const_nodnam_t) | Add a fronted role to an existing facility. |
AddRouter(rtr_const_facnam_t, rtr_const_nodnam_t) | Add a router role to an existing facility. |
CreateFacility(rtr_const_facnam_t, rtr_const_nodnam_t, rtr_const_nodnam_t, bool) | Create a facility, designating router and frontend. |
CreateFacility(rtr_const_facnam_t, rtr_const_nodnam_t, rtr_const_nodnam_t, bool, bool) | Create a facility, designating router and backend. |
CreateFacility(rtr_const_facnam_t, rtr_const_nodnam_t, rtr_const_nodnam_t, rtr_const_nodnam_t, bool, bool) | Create a facility, designating router, frontend, and backend. |
DeleteFacility(rtr_const_facnam_t) | Delete a facility. |
GetFacilityProperties(rtr_const_facnam_t, RTRFacilityProperties) | Retrieve properties for an existing facility. |
RemoveBackend(rtr_const_facnam_t, rtr_const_nodnam_t) | Remove a backend role from an existing facility. |
RemoveFrontend(rtr_const_facnam_t, rtr_const_nodnam_t) | Remove a fronted role from an existing facility. |
RemoveRouter(rtr_const_facnam_t, rtr_const_nodnam_t) | Remove a router role from an existing facility. |
Previous | Next | Contents | Index |