Class ChunkLoaderV1
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.internal.parser.v1.ChunkLoaderV1
-
- All Implemented Interfaces:
java.util.concurrent.Callable<byte[]>,IChunkLoader
public class ChunkLoaderV1 extends java.lang.Object implements IChunkLoader
-
-
Field Summary
Fields Modifier and Type Field Description private static longCONSTANT_POOL_EVENT_TYPEprivate LoaderContextcontextprivate byte[]dataprivate ChunkStructureheader
-
Constructor Summary
Constructors Constructor Description ChunkLoaderV1(ChunkStructure header, byte[] data, LoaderContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]call()Perform the chunk loading.static IChunkLoadercreate(Chunk input, LoaderContext context)static ChunkInfogetInfo(Chunk input, long position)longgetTimestamp()private static longreadConstantPoolEvent(IDataInput input, TypeManager manager)
-
-
-
Field Detail
-
CONSTANT_POOL_EVENT_TYPE
private static final long CONSTANT_POOL_EVENT_TYPE
- See Also:
- Constant Field Values
-
header
private final ChunkStructure header
-
data
private final byte[] data
-
context
private final LoaderContext context
-
-
Constructor Detail
-
ChunkLoaderV1
public ChunkLoaderV1(ChunkStructure header, byte[] data, LoaderContext context)
-
-
Method Detail
-
call
public byte[] call() throws java.lang.ExceptionDescription copied from interface:IChunkLoaderPerform the chunk loading.- Specified by:
callin interfacejava.util.concurrent.Callable<byte[]>- Specified by:
callin interfaceIChunkLoader- Returns:
- The byte array that was backing the chunk data. After returning this, the chunk loader is done with the array and it may be reused for a new chunk.
- Throws:
java.lang.Exception
-
readConstantPoolEvent
private static long readConstantPoolEvent(IDataInput input, TypeManager manager) throws java.io.IOException, InvalidJfrFileException
- Throws:
java.io.IOExceptionInvalidJfrFileException
-
create
public static IChunkLoader create(Chunk input, LoaderContext context) throws java.io.IOException, CouldNotLoadRecordingException
- Throws:
java.io.IOExceptionCouldNotLoadRecordingException
-
getInfo
public static ChunkInfo getInfo(Chunk input, long position) throws java.io.IOException, CouldNotLoadRecordingException
- Throws:
java.io.IOExceptionCouldNotLoadRecordingException
-
getTimestamp
public long getTimestamp()
- Specified by:
getTimestampin interfaceIChunkLoader- Returns:
- The chunk timestamp. The unit is not specified, it might be milliseconds or nanoseconds since 1970, but the important thing is that it is unique for every chunk in a recording.
-
-