Package io.aeron.archive.status
Class RecordingPos
java.lang.Object
io.aeron.archive.status.RecordingPos
The position a recording has reached when being archived.
Key has the following layout:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Recording ID | | | +---------------------------------------------------------------+ | Session ID | +---------------------------------------------------------------+ | Source Identity for the Image | | ... ... | +---------------------------------------------------------------+ | Archive ID | | | +---------------------------------------------------------------+
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringHuman-readable name for the counter.static final longRepresents a null recording id when not found.static final intType id of a recording position counter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Counterallocate(Aeron aeron, UnsafeBuffer tempBuffer, long archiveId, long recordingId, int sessionId, int streamId, String strippedChannel, String sourceIdentity) Allocated a recording position counter and populate the metadata.static intfindCounterIdByRecording(CountersReader countersReader, long recordingId) Deprecated.static intfindCounterIdByRecording(CountersReader countersReader, long recordingId, long archiveId) Find the active counter id for a stream based on the recording id and archive id.static intfindCounterIdBySession(CountersReader countersReader, int sessionId) Deprecated.UsefindCounterIdBySession(CountersReader, int, long)instead.static intfindCounterIdBySession(CountersReader countersReader, int sessionId, long archiveId) Find the active counter id for a stream based on the session id and archive id.static longgetRecordingId(CountersReader countersReader, int counterId) Get the recording id for a given counter id.static StringgetSourceIdentity(CountersReader counters, int counterId) Get theImage.sourceIdentity()for the recording.static booleanisActive(CountersReader counters, int counterId, long recordingId) Is the recording counter still active.
-
Field Details
-
RECORDING_POSITION_TYPE_ID
public static final int RECORDING_POSITION_TYPE_IDType id of a recording position counter.- See Also:
-
NULL_RECORDING_ID
public static final long NULL_RECORDING_IDRepresents a null recording id when not found.- See Also:
-
NAME
Human-readable name for the counter.- See Also:
-
-
Constructor Details
-
RecordingPos
public RecordingPos()
-
-
Method Details
-
allocate
public static Counter allocate(Aeron aeron, UnsafeBuffer tempBuffer, long archiveId, long recordingId, int sessionId, int streamId, String strippedChannel, String sourceIdentity) Allocated a recording position counter and populate the metadata.- Parameters:
aeron- on which the counter will be registered.tempBuffer- for encoding the metadata.archiveId- to which the counter belongs.recordingId- for the recording.sessionId- for the publication being recorded.streamId- for the publication being recorded.strippedChannel- for the recording subscription.sourceIdentity- for the publication.- Returns:
- the allocated counter.
-
findCounterIdByRecording
@Deprecated public static int findCounterIdByRecording(CountersReader countersReader, long recordingId) Deprecated.UsefindCounterIdByRecording(CountersReader, long, long)instead.Find the active counter id for a stream based on the recording id.- Parameters:
countersReader- to search within.recordingId- for the active recording.- Returns:
- the counter id if found otherwise
CountersReader.NULL_COUNTER_ID.
-
findCounterIdByRecording
public static int findCounterIdByRecording(CountersReader countersReader, long recordingId, long archiveId) Find the active counter id for a stream based on the recording id and archive id.- Parameters:
countersReader- to search within.recordingId- for the active recording.archiveId- to target specific Archive. UseAeron.NULL_VALUEto emulate old behavior.- Returns:
- the counter id if found otherwise
CountersReader.NULL_COUNTER_ID. - Since:
- 1.44.0
-
findCounterIdBySession
Deprecated.UsefindCounterIdBySession(CountersReader, int, long)instead.Find the active counter id for a stream based on the session id.- Parameters:
countersReader- to search within.sessionId- for the active recording.- Returns:
- the counter id if found otherwise
CountersReader.NULL_COUNTER_ID.
-
findCounterIdBySession
public static int findCounterIdBySession(CountersReader countersReader, int sessionId, long archiveId) Find the active counter id for a stream based on the session id and archive id.- Parameters:
countersReader- to search within.sessionId- for the active recording.archiveId- to target specific Archive. UseAeron.NULL_VALUEto emulate old behavior.- Returns:
- the counter id if found otherwise
CountersReader.NULL_COUNTER_ID. - Since:
- 1.44.0
-
getRecordingId
Get the recording id for a given counter id.- Parameters:
countersReader- to search within.counterId- for the active recording.- Returns:
- the counter id if found otherwise
NULL_RECORDING_ID.
-
getSourceIdentity
Get theImage.sourceIdentity()for the recording.- Parameters:
counters- to search within.counterId- for the active recording.- Returns:
Image.sourceIdentity()for the recording or null if not found.
-
isActive
Is the recording counter still active.- Parameters:
counters- to search within.counterId- to search for.recordingId- to confirm it is still the same value.- Returns:
- true if the counter is still active otherwise false.
-
findCounterIdByRecording(CountersReader, long, long)instead.