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 LoaderContext
context
private byte[]
data
private ChunkMetadata
metadata
private ChunkStructure
structure
-
Constructor Summary
Constructors Modifier Constructor Description private
ChunkLoaderV0(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 IChunkLoader
create(Chunk input, LoaderContext context)
static ChunkInfo
getInfo(Chunk input, long position)
long
getTimestamp()
-
-
-
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.Exception
Description copied from interface:IChunkLoader
Perform the chunk loading.- Specified by:
call
in interfacejava.util.concurrent.Callable<byte[]>
- Specified by:
call
in 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.IOException
CouldNotLoadRecordingException
-
getInfo
public static ChunkInfo getInfo(Chunk input, long position) throws java.io.IOException, CouldNotLoadRecordingException
- Throws:
java.io.IOException
CouldNotLoadRecordingException
-
getTimestamp
public long getTimestamp()
- Specified by:
getTimestamp
in 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.
-
-