Package io.aeron.archive
Class ArchiveCounters
java.lang.Object
io.aeron.archive.ArchiveCounters
For allocating and finding Archive associated counters identified by the
Aeron.clientId().-
Method Summary
Modifier and TypeMethodDescriptionstatic Counterallocate(Aeron aeron, MutableDirectBuffer tempBuffer, int typeId, String name, long archiveId) Allocate a counter to represent state within an Archive.static intappendArchiveIdLabel(MutableDirectBuffer tempBuffer, int offset, long archiveId) AppendarchiveIdat the end of the counter label.static intfind(CountersReader counters, int typeId, long archiveId) Find the counter id for a type of counter in an Archive.static intlengthOfArchiveIdLabel(long archiveId) Returns the length of the archive id suffix in bytes.
-
Method Details
-
allocate
public static Counter allocate(Aeron aeron, MutableDirectBuffer tempBuffer, int typeId, String name, long archiveId) Allocate a counter to represent state within an Archive. ThearchiveIdis assumed to beAeron.clientId(). -
appendArchiveIdLabel
AppendarchiveIdat the end of the counter label.- Parameters:
tempBuffer- to append label to.offset- at which current label data ends.archiveId- to use as suffix.- Returns:
- length of the suffix appended.
-
lengthOfArchiveIdLabel
public static int lengthOfArchiveIdLabel(long archiveId) Returns the length of the archive id suffix in bytes.- Parameters:
archiveId- that will be added to the label.- Returns:
- the length of the archive id suffix in bytes.
-
find
Find the counter id for a type of counter in an Archive.- Parameters:
counters- to search within.typeId- of the counter.archiveId- to which the allocated counter belongs.- Returns:
- the matching counter id or
Aeron.NULL_VALUEif not found.
-