The group facility can coordinate fault-tolerant operation, or distribute operating roles among application process instances.
More...
The group facility can coordinate fault-tolerant operation, or distribute operating roles among application process instances.
This file defines the public API of the group facility.
A group server tracks group members, and assigns an ordinal to each member. The group facility raises advisories to inform the member of its current ordinal. Based on its ordinal, each member operates in a particular application-specific role.
The group server also reports the group status as members join and leave the group, or disconnect from the server. The group facility raises advisories to inform members and observers of such changes in status.
#define TIB_GROUP_ADVISORY_FIELD_ORDINAL "ordinal" |
Group member ordinal (field name).
The positive long value of the ordinal
field represents the new ordinal of the group member.
The value -1 indicates that the group object is disconnected from the group server. The group object automatically attempts to reconnect, and continues until the program explicitly destroys it. Meanwhile, the group server could reassign the member's previous ordinal to another group member.
Zero is a reserved value.
#define TIB_GROUP_PROPERTY_LONG_MEMBER_WEIGHT "com.tibco.ftl.group.member.weight" |
Property name group member weight ; tibuint64_t
.
To set weight for group member, supply this optional property to tibGroup_Join.
Acceptable values are positive integers.
When absent, the default value is 100. Zero is a special, reserved value for future use.
FTL group service uses relative weight values to determine the ordinal of the group member; members with higher weight take precedence over members with lower weight.
#define TIB_GROUP_PROPERTY_MESSAGE_MEMBER_DESCRIPTOR "com.tibco.ftl.group.memberdescriptor" |
Property name for group member descriptor; tibMessage
.
To identify a group member to the other members, supply this optional property to tibGroup_Join.
The application programmer determines the content of the descriptor message. In best practice, each group member process supplies a unique descriptor.
Get a copy of the group name.
This call copies the group name string that your program supplied to tibGroup_Join.
If a program passes NULL
as the buffer argument, this call returns the length of the group name string, including a NULL terminating character, without actually writing the string.
If the non-NULL buffer is too short for the entire name string, the call writes to the end of the buffer, truncating the string, and returns the actual number of bytes in the buffer.
- Parameters
-
e | The exception object captures information about failures. |
group | The call gets a copy of the name from this group object. |
buffer | The call copies the name into this string buffer. |
buflen | The program supplies the length of buffer (in bytes). |
- Returns
- This call returns the length of the group name string, including the NULL terminating character.
- See also
- tibGroup_Join
Leave a group, and destroy the group object.
This call informs the group server that the member is leaving the group. In response, the group server revises the ordinals of the remaining group members appropriately.
This call releases all resources held by the group object.
Before your program calls tibRealm_Close, it must first destroy all the group objects that it has created.
- Parameters
-
e | The exception object captures information about failures. |
group | The call leaves this group. |
- Returns
- void
Set the weight for this member of the group.
Acceptable values are positive integers. Zero is a special, reserved value for future use.
Programs can adjust their weight at any time to reflect changing conditions. Adjusting weights causes each member to recompute their relative weights of all the members of the group. For large groups this recomputation can affect performance.
- Parameters
-
e | The exception object captures information about failures. |
id | The call sets the member weight of this group. |
weight | The program supplies the weight of group member. |
- Returns
- void
- See also
- TIB_GROUP_PROPERTY_INT_MEMBER_WEIGHT