public final class RecoveryState extends Object
Key layout as follows:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Leadership Term ID | | | +---------------------------------------------------------------+ | Log position for Snapshot | | | +---------------------------------------------------------------+ | Timestamp at beginning of Recovery | | | +---------------------------------------------------------------+ | Cluster ID | +---------------------------------------------------------------+ | Count of Services | +---------------------------------------------------------------+ | Snapshot Recording ID (Service ID 0) | | | +---------------------------------------------------------------+ | Snapshot Recording ID (Service ID n) | | | +---------------------------------------------------------------+
| Modifier and Type | Field and Description |
|---|---|
static int |
CLUSTER_ID_OFFSET |
static int |
LEADERSHIP_TERM_ID_OFFSET |
static int |
LOG_POSITION_OFFSET |
static String |
NAME
Human readable name for the counter.
|
static int |
RECOVERY_STATE_TYPE_ID
Type id of a recovery state counter.
|
static int |
SERVICE_COUNT_OFFSET |
static int |
SNAPSHOT_RECORDING_IDS_OFFSET |
static int |
TIMESTAMP_OFFSET |
| Modifier and Type | Method and Description |
|---|---|
static Counter |
allocate(Aeron aeron,
long leadershipTermId,
long logPosition,
long timestamp,
int clusterId,
long... snapshotRecordingIds)
Allocate a counter to represent the snapshot services should load on start.
|
static int |
findCounterId(CountersReader counters,
int clusterId)
Find the active counter id for recovery state.
|
static long |
getLeadershipTermId(CountersReader counters,
int counterId)
Get the leadership term id for the snapshot state.
|
static long |
getLogPosition(CountersReader counters,
int counterId)
Get the position at which the snapshot was taken.
|
static long |
getSnapshotRecordingId(CountersReader counters,
int counterId,
int serviceId)
Get the recording id of the snapshot for a service.
|
static long |
getTimestamp(CountersReader counters,
int counterId)
Get the timestamp at the beginning of recovery.
|
public static final int RECOVERY_STATE_TYPE_ID
public static final String NAME
public static final int LEADERSHIP_TERM_ID_OFFSET
public static final int LOG_POSITION_OFFSET
public static final int TIMESTAMP_OFFSET
public static final int CLUSTER_ID_OFFSET
public static final int SERVICE_COUNT_OFFSET
public static final int SNAPSHOT_RECORDING_IDS_OFFSET
public static Counter allocate(Aeron aeron, long leadershipTermId, long logPosition, long timestamp, int clusterId, long... snapshotRecordingIds)
aeron - to allocate the counter.leadershipTermId - at which the snapshot was taken.logPosition - at which the snapshot was taken.timestamp - the snapshot was taken.clusterId - which identifies the cluster instance.snapshotRecordingIds - for the services to use during recovery indexed by service id.Counter for the recovery state.public static int findCounterId(CountersReader counters, int clusterId)
counters - to search within.clusterId - to constrain the search.CountersReader.NULL_COUNTER_ID.public static long getLeadershipTermId(CountersReader counters, int counterId)
Aeron.NULL_VALUE if no snapshot for recovery.counters - to search within.counterId - for the active recovery counter.Aeron.NULL_VALUE.public static long getLogPosition(CountersReader counters, int counterId)
Aeron.NULL_VALUE if no snapshot for recovery.counters - to search within.counterId - for the active recovery counter.Aeron.NULL_VALUE.public static long getTimestamp(CountersReader counters, int counterId)
Aeron.NULL_VALUE if no snapshot for recovery.counters - to search within.counterId - for the active recovery counter.Aeron.NULL_VALUE.public static long getSnapshotRecordingId(CountersReader counters, int counterId, int serviceId)
counters - to search within.counterId - for the active recovery counter.serviceId - for the snapshot required.Aeron.NULL_VALUE.Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.