TibrvFtMember::create()
Method
Declaration
TibrvStatuscreate
(
TibrvQueue* queue,
TibrvFtMemberCallback* callback,
TibrvTransport* transport,
const char* groupName,
tibrv_u16 weight,
tibrv_u16 activeGoal,
tibrv_f64 heartbeatInterval,
tibrv_f64 preparationInterval,
tibrv_f64 activationInterval,
const void* closure = NULL);
Purpose
Create a member of a fault tolerance group.
Remarks
This method creates a C fault tolerance member object, and stores it in the C++ object. The program becomes a member of the fault tolerance group.
A program may hold simultaneous memberships in several distinct fault tolerance groups. For examples, see Multiple Groups in
.Avoid joining the same group twice. It is illegal for a program to maintain more than one membership in any one fault tolerance group. This method does not guard against this illegal situation, and results are unpredictable.
All arguments are required except for preparationInterval
(which may be zero) and closure
(which may be NULL
).
Intervals
The heartbeat interval must be less than the activation interval. If the preparation interval is non-zero, it must be greater than the heartbeat interval and less than the activation interval. It is an error to violate these rules.
In addition, intervals must be reasonable for the hardware and network conditions. For information and examples, see Step 4: Choose the Intervals in
.Group Name
The group name must be a legal Rendezvous subject name (see Subject Names in ). You may use names with several elements; for examples, see Multiple Groups in .
Parameter |
Description |
|
Place fault tolerance events for this member on this event queue. |
|
On dispatch, process the event with this callback object. |
|
Use this transport for fault tolerance internal protocol messages (such as heartbeat messages). |
|
Join the fault tolerant group with this name. The group name must conform to the syntax required for Rendezvous subject names. For details, see Subject Names in . |
Weight represents the ability of this member to fulfill its purpose, relative to other members of the same fault tolerance group. Rendezvous fault tolerance software uses relative weight values to select which members to activate; members with higher weight take precedence over members with lower weight. Acceptable values range from 1 to 65535. Zero is a special, reserved value; Rendezvous fault tolerance software assigns zero weight to processes with resource errors, so they only activate when no other members are available. |
|
|
Rendezvous fault tolerance software sends callback instructions to maintain this number of active members. Acceptable values range from 1 to 65535. |
When this member is active, it sends heartbeat messages at this interval (in seconds). The interval must be positive. To determine the correct value, see Step 4: Choose the Intervals in . |
|
When the heartbeat signal from one or more active members has been silent for this interval (in seconds), Rendezvous fault tolerance software issues an early warning hint (TIBRVFT_PREPARE_TO_ACTIVATE) to the ranking inactive member. This warning lets the inactive member prepare to activate, for example, by connecting to a database server, or allocating memory. The interval must be non-negative. Zero is a special value, indicating that the member does not need advance warning to activate; Rendezvous fault tolerance software never issues a TIBRVFT_PREPARE_TO_ACTIVATE hint when this value is zero. To determine the correct value, see Step 4: Choose the Intervals in . |
|
When the heartbeat signal from one or more active members has been silent for this interval (in seconds), Rendezvous fault tolerance software considers the silent member to be lost, and issues the instruction to activate (TIBRVFT_ACTIVATE) to the ranking inactive member. When a new member joins a group, Rendezvous fault tolerance software identifies the new member to existing members (if any), and then waits for this interval to receive identification from them in return. If, at the end of this interval, it determines that too few members are active, it issues the activate instruction (TIBRVFT_ACTIVATE) to the new member. Then interval must be positive. To determine the correct value, see Step 4: Choose the Intervals in . |
|
|
Store this closure data in the member object. |
See Also
Step 1: Choose a Group Name in
Step 2: Choose the Active Goal in
Step 4: Choose the Intervals in
Step 5: Program Start Sequence in