Class ChunkLoaderV0
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.internal.parser.v0.ChunkLoaderV0
-
- All Implemented Interfaces:
java.util.concurrent.Callable<byte[]>,IChunkLoader
public class ChunkLoaderV0 extends java.lang.Object implements IChunkLoader
-
-
Field Summary
Fields Modifier and Type Field Description private LoaderContextcontextprivate byte[]dataprivate ChunkMetadatametadataprivate ChunkStructurestructure
-
Constructor Summary
Constructors Modifier Constructor Description privateChunkLoaderV0(ChunkStructure structure, 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()
-
-
-
Field Detail
-
structure
private final ChunkStructure structure
-
data
private final byte[] data
-
context
private final LoaderContext context
-
metadata
private final ChunkMetadata metadata
-
-
Constructor Detail
-
ChunkLoaderV0
private ChunkLoaderV0(ChunkStructure structure, byte[] data, LoaderContext context) throws CouldNotLoadRecordingException
- Throws:
CouldNotLoadRecordingException
-
-
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
-
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.
-
-