Previous | Contents | Index |
bool Remove (const size_t n);
True or False
n
The element in the array (ar[0] is the first element). The element is a pointer to an object.
This method removes the nth element of the array. This does not destroy the object pointed to; the caller must delete the contents.
bool bArrayRemoveStatus; bArrayRemoveStatus = ar.Remove(1); if (IsFailure(bArrayRemoveStatus)) { cout << " RTRFacilityMemberArray::Remove failed\n"; } return bArrayRemoveStatus;
RTRFacilityMemberArray(); virtual ~RTRFacilityMemberArray;
None
None
Construct an RTRFacilityMemberArray object.
RTRFacilityMemberArray::RTRFacilityMemberArray() { }
size_t Size() const;
size_t
None
The method returns the number of elements in the array.
size_t nArraySize = ar.Size(); if (IsFailure(nArraySize == 1)) { cout << " RTRFacilityMemberArray::Size failed\n"; } return nArraySize == 1;
4.6 RTRFacilityProperties
RTRFacilityProperties provides members that can retrieve a list of
nodes and their roles in a facility and enable reconnection of
frontends and routers based on the number of connections on each active
router.
Construction
Method | Description |
---|---|
RTRFacilityProperties(rtr_const_facnam_t) | Constructor |
~RTRFacilityProperties | Destructor |
Operations
Method | Description |
---|---|
GetMemberList(RTRFacilityMemberArray) | Retrieves a list of nodes and their roles for an existing facility. |
SetBalance(bool) | Allows intelligent reconnection of frontend to routers according to the number of connections on each active router. |
rtr_status_t GetMemberList(RTRFacilityMemberArray &aFacilityMembers);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion. |
RTR_STS_DATANOTAVAILABL | Member list data not available. |
aFacilityMembers
An array listing a facility's members.
Retrieve a list of nodes and their roles for an existing facility.
rtr_status_t stsGetMemberList; RTRFacilityMemberArray arFacMembers; stsGetMemberList = FacProps.GetMemberList(arFacMembers); if (IsFailure(stsGetMemberList == RTR_STS_OK)) { bOverallResult = false; OutputStatus(stsGetMemberList); } int nNbrFacMembers = arFacMembers.Size(); for (int i=0; i<nNbrFacMembers; i++) { delete arFacMembers[i]; } CleanupRTR(); return bOverallResult;
RTRFacilityProperties( rtr_const_facnam_t pszFacilityName); virtual ~RTRFacilityProperties();
None
pszFacility
A null-terminated pointer to a facility name.
This method retrieves the properties associated with the facility object.
char *pszFacility = "Myfacilityname"; RTRFacilityProperties *FacilityPropterties = new RTRFacilityProperties(pszFacility);
rtr_status_t SetBalance( bool bBalancingOn );
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
bBalancingOn
A boolean attribute for specifying RTR balancing of client requests for server processing.
Specifies whether router balancing is to be performed.
rtr_status_t sStatus; char *pszFacilityName= "MyfacilityName"; bool bBalanceON = true; sStatus = MyFacilityProperties->SetBalance(bBalanceOn);
4.7 RTRKeySegment
A key segment describes the data that the RTR application is sending.
RTR uses this description for routing the data to an appropriate
server. Key segments are of no value unless they are associated with a
partition. When creating a partition, the caller is allowed to specify
one or more key segments.
The RTRKeySegment class defines key segments (ranges) used in defining RTRPartition objects. RTRPartition objects are used to enable the partitioning of data across multiple servers.
Construction
Method | Description |
---|---|
RTRKeySegment(rtr_keyseg_type_t, rtr_keylen_t, rtr_keylen_t, rtr_const_pointer_t, rtr_const_pointer_t) | Constructor |
~ RTRKeySegment() | Destructor |
Method | Description |
---|---|
GetKeySegmentHighValue() | Gets the upper bound of the key range for the key segment. |
GetKeySegmentLength() | Gets the length of the key segment key. |
GetKeySegmentLowValue() | Gets the lower bound of the key range for the key segment. |
GetKeySegmentOffset() | Gets the offset of the key segment key. |
GetKeySegmentType() | Gets the type of the key segment. |
SetKeySegmentHighValue(rtr_const_pointer_t) | Sets the upper bound of the key range for the key segment. |
SetKeySegmentLength(const rtr_keylen_t) | Sets the length of the key segment key. |
SetKeySegmentLowValue(rtr_const_pointer_t) | Sets the lower bound of the key range for the key segment. |
SetKeySegmentOffset(const rtr_keylen_t) | Sets the offset of the key segment key. |
SetKeySegmentType(const rtr_keyseg_type_t) | Sets the type of the key segment. |
rtr_pointer_t GetKeySegmentHighValue();
rtr_pointer_t Pointer to the returned upper-bound key value.
None
This method returns the upper-bound key value of the key segment.
RTRKeySegment CharacterStringSegment.GetKeySegmentHighValue();
rtr_keylen_t GetKeySegmentLength();
rtr_keylen_t The returned value is the length of the key segment.
None
This method gets the length of the key segment key.
rtr_keylen_t keylength = CharacterStringSegment.GetKeySegmentLength();
rtr_pointer_t GetKeySegmentLowValue();
rtr_pointer_t Pointer to the returned lower-bound key value.
None
This method returns the lower-bound key value of the key segment.
rtr_keylen_t keylength = CharacterStringSegment.GetKeySegmentLowValue();
rtr_keylen_t GetKeySegmentOffset();
rtr_keylen_t The returned value is the offset of the key value.
None
This method gets the offset of the key segment key within the message stream.
rtr_keylen_t keylength = CharacterStringSegment.GetKeySegmentOffset();
rtr_keyseg_type_t GetKeySegmentType();
rtr_keyseg_type_t
One of the values of type rtr_keyseg_type_t, that can be:
None
This method gets the data type of the key segment.
rtr_keylen_t keylength = CharacterStringSegment.GetKeySegmentType();
RTRKeySegment(rtr_keyseg_type_t keySegmentType, rtr_keylen_t keySegmentLength, rtr_keylen_t keySegmentOffset, rtr_const_pointer_t pKeySegmentLowValue, rtr_const_pointer_t pKeySegmentHighValue ); virtual ~RTRKeySegment();
None
keySegmentType
One of the values of type rtr_keyseg_type_t, that can be one of the following:
- rtr_keyseg_signed
- rtr_keyseg_unsigned
- rtr_keyseg_string
keySegmentLength
A numerical length value in bytes of type rtr_keylen_t.Default = 4
keySegmentOffset
A numerical offset value in bytes of type rtr_keylen_t.Default = 0.
pKeySegmentLowValue
A pointer of type rtr_pointer_t to a lower-bound key value of type rtr_keyseg_type_t.Default = NULL.
PKeySegmentHighValue
A pointer of type rtr_pointer_t to an upper-bound key value of type rtr_keyseg_type_t.Default = NULL.
Call this constructor to create an RTRKeySegment object.
void ClassDerivedFromHandler::StartProcessingOrdersAtoL( ) { // This function defines a key segment and calls StartProcessingOrders to process all orders that have a ticker symbol beginning with the letters A-L. // Create a KeyRange m_pkeyRange = new RTRKeySegment( rtr_keyseg_string, 1, OffsetIntoApplicationProtocol, "A", "L" ); StartProcessingOrders(PARTITION_NAMEAToL,m_pkeyRange); }
rtr_status_t SetKeySegmentHighValue(rtr_const_pointer_t pKeySegmentHighValue );
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion. |
RTR_STS_INVKYSGVLPTARG | Invalid key segment value pointer argument. |
pKeySegmentHighValue
Pointer to the upper-bound key value to be set.
This method sets the upper bound of the key range for the key segment.
rtr_keyseg_type_t PKeySegmentHighValue = L; CharacterStringSegment.SetKeySegmentHighValue(KeySegmentHighValue);
rtr_status_t SetKeySegmentLength(const rtr_keylen_t keySegmentLength );
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
keySegmentLength
This parameter holds the key length value of type rtr_keylen_t to be set.
This method sets the length of the key segment key.
rtr_keylen_t keylength = 1; CharacterStringSegment.SetLength(keylength);
rtr_status_t SetKeySegmentLowValue(rtr_const_pointer_t pKeySegmentLowValue);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion. |
RTR_STS_INVKYSGVLPTARG | Invalid key segment value pointer argument. |
pKeySegmentLowValue
Pointer to the lower-bound key value to be set.
This method sets lower bound of the key range for the key segment.
rtr_keyseg_type_t PKeySegmentLowValue = A; CharacterStringSegment.SetKeySegmentLowValue(KeySegmentLowValue);
rtr_status_t SetKeySegmentOffset( const rtr_keylen_t keySegmentOffset );
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
keySegmentOffset
This parameter holds the key segment key offset of type rtr_keylen_t.
This method sets the offset of the key segment key within the message stream.
rtr_keylen_type_t PKeySegmentOffset = ; CharacterStringSegment.SetKeySegmentOffset(KeySegmentOffset);
rtr_status_t SetKeySegmentType( const rtr_keyseg_type_t keySegmentType);
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
keySegmentType
One of the values of type rtr_keyseg_type_t, that can be one of the following:
- rtr_keyseg_signed
- rtr_keyseg_unsigned
- rtr_keyseg_string
This method sets the data type of the key segment.
rtr_status_t stsSetKeySegmentType; rtr_keyseg_type_t NewType = rtr_keyseg_string; stsSetKeySegmentType = KeySeg.SetKeySegmentType(NewType); if (IsFailure(stsSetKeySegmentType == RTR_STS_OK)) { bOverallResult = false; } rtr_keyseg_type_t CurrType; CurrType = KeySeg.GetKeySegmentType(); if (IsFailure(CurrType == NewType)) { bOverallResult = false; cout << ) RTRKeySegment::Set/GetKeySegmentType failed.\n); } return bOverallResult;
Previous | Next | Contents | Index |