Package org.agrona.agent
Class BufferAlignmentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.agrona.agent.BufferAlignmentException
- All Implemented Interfaces:
Serializable
Runtime Exception thrown by
BufferAlignmentAgent
when an unaligned memory access is detected.
Package-protected to discourage catching since this as agent should be used only for testing and debugging.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
Address offset of the unaligned access.private final int
Index of the unaligned access.private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionBufferAlignmentException
(String prefix, int index, long addressOffset) Create exception with details about the unaligned access. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns an address offset into the start of the underlying buffer.int
index()
Returns an index at which unaligned access occurred.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
index
private final int indexIndex of the unaligned access. -
addressOffset
private final long addressOffsetAddress offset of the unaligned access.
-
-
Constructor Details
-
BufferAlignmentException
Create exception with details about the unaligned access.- Parameters:
prefix
- for the error message.index
- at which the unaligned access occurred.addressOffset
- pointing to the beginning of the underlying buffer.
-
-
Method Details
-
index
public int index()Returns an index at which unaligned access occurred.- Returns:
- index.
-
addressOffset
public long addressOffset()Returns an address offset into the start of the underlying buffer.- Returns:
- address of the beginning of the underlying buffer.
-