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
getAcquire()
Get the current status indication of a component with acquire semantics.long
getOpaque()
Get the current status indication of a component with opaque semantics.long
getVolatile()
Get the current status indication of a component with volatile semantics.int
id()
Identifier for this status indicator.void
setOpaque(long value)
Sets the current status indication of the component with opaque memory semantics.void
setOrdered(long value)
Sets the current status indication of the component with ordered memory semantics.void
setRelease(long value)
Sets the current status indication of the component with release memory semantics.void
setVolatile(long value)
Sets the current status indication of the component with volatile 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.
-
setVolatile
public void setVolatile(long value)
Sets the current status indication of the component with volatile memory semantics.- Specified by:
setVolatile
in classStatusIndicator
- Parameters:
value
- the current status indication of the component.
-
setOrdered
public void setOrdered(long value)
Sets the current status indication of the component with ordered memory semantics.This method is identical to
StatusIndicator.setRelease(long)
and that method should be used instead.- Specified by:
setOrdered
in classStatusIndicator
- Parameters:
value
- the current status indication of the component.
-
setRelease
public void setRelease(long value)
Sets the current status indication of the component with release memory semantics.- Specified by:
setRelease
in classStatusIndicator
- Parameters:
value
- the current status indication of the component.
-
setOpaque
public void setOpaque(long value)
Sets the current status indication of the component with opaque memory semantics.- Specified by:
setOpaque
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.
-
getAcquire
public long getAcquire()
Get the current status indication of a component with acquire semantics.- Specified by:
getAcquire
in classStatusIndicatorReader
- Returns:
- the current status indication of a component.
-
getOpaque
public long getOpaque()
Get the current status indication of a component with opaque semantics.- Specified by:
getOpaque
in classStatusIndicatorReader
- Returns:
- the current status indication of a component.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-