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 long
CONSTANT_POOL_EVENT_TYPE
private LoaderContext
context
private byte[]
data
private ChunkStructure
header
-
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 IChunkLoader
create(Chunk input, LoaderContext context)
static ChunkInfo
getInfo(Chunk input, long position)
long
getTimestamp()
private static long
readConstantPoolEvent(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.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
-
readConstantPoolEvent
private static long readConstantPoolEvent(IDataInput input, TypeManager manager) throws java.io.IOException, InvalidJfrFileException
- Throws:
java.io.IOException
InvalidJfrFileException
-
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.
-
-