Package org.agrona.concurrent.status
Class UnsafeBufferStatusIndicator
- java.lang.Object
-
- org.agrona.concurrent.status.StatusIndicatorReader
-
- org.agrona.concurrent.status.StatusIndicator
-
- org.agrona.concurrent.status.UnsafeBufferStatusIndicator
-
public class UnsafeBufferStatusIndicator extends StatusIndicator
StatusIndicator
which wraps anAtomicBuffer
with a given counter id.- See Also:
CountersManager
-
-
Field Summary
Fields Modifier and Type Field Description private long
addressOffset
private byte[]
byteArray
private java.nio.ByteBuffer
byteBuffer
private int
counterId
-
Constructor Summary
Constructors Constructor Description UnsafeBufferStatusIndicator(AtomicBuffer buffer, int counterId)
Map a status indicator over a buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getVolatile()
Get the current status indication of a component with volatile semantics.int
id()
Identifier for this status indicator.void
setOrdered(long value)
Sets the current status indication of the component with ordered atomic memory semantics.java.lang.String
toString()
-
-
-
Constructor Detail
-
UnsafeBufferStatusIndicator
public UnsafeBufferStatusIndicator(AtomicBuffer buffer, int counterId)
Map a status indicator over a buffer.- Parameters:
buffer
- containing the indicator.counterId
- identifier of the indicator.
-
-
Method Detail
-
id
public int id()
Identifier for this status indicator.- Specified by:
id
in classStatusIndicatorReader
- Returns:
- the identifier for this status indicator.
-
setOrdered
public void setOrdered(long value)
Sets the current status indication of the component with ordered atomic memory semantics.- Specified by:
setOrdered
in classStatusIndicator
- Parameters:
value
- the current status indication of the component.
-
getVolatile
public long getVolatile()
Get the current status indication of a component with volatile semantics.- Specified by:
getVolatile
in classStatusIndicatorReader
- Returns:
- the current status indication of a component with volatile semantics.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-