APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.jfr.internal.consumer.filter

public final Class ChunkWriter

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.Closeable, .IOException, java.nio.file.Files, .Path, java.util.ArrayDeque, .Deque, .Map, .HashMap, .List, java.util.function.Predicate, jdk.jfr.consumer.RecordedEvent, jdk.jfr.internal.LongMap, .Type, .Logger, .LogLevel, .LogTag, jdk.jfr.internal.consumer.ChunkHeader, .RecordingInput, .Reference

Class that can filter out events and associated constants from a recording file.

All positional values are relative to file start, not the chunk.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final Deque<CheckpointEvent>
private boolean
private long
private final boolean
private final Path
private final Predicate<RecordedEvent>
private final RecordingInput
private long
private final RecordingOutput
private LongMap<Constants>
private final LongMap<ChunkWriter.RemovedEvents>
private final Map<String, Long>

Constructor Summary

AccessConstructor and Description
public
ChunkWriter(Path source, Path destination, Predicate<RecordedEvent> filter, boolean collectResults)

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public void
public RecordingInput
pack-priv Constants
getPool(Type type)

public List<ChunkWriter.RemovedEvents>
public CheckpointEvent
newCheckpointEvent(long startPosition)

public void
touch(Object object)

private void
private void
updateHeader(long size, long constantPosition, long metadataPosition)

public void
write(long startPosition, long endPosition)

private void
write(CheckpointEvent event, long delta)

private void
writeCheckpointEvents(long before)

public void
writeEvent(long startPosition, long endPosition)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkpointsback to summary
private final Deque<CheckpointEvent> checkpoints
chunkCompleteback to summary
private boolean chunkComplete
chunkStartPositionback to summary
private long chunkStartPosition
collectResultsback to summary
private final boolean collectResults
destinationback to summary
private final Path destination
filterback to summary
private final Predicate<RecordedEvent> filter
inputback to summary
private final RecordingInput input
lastCheckpointback to summary
private long lastCheckpoint
outputback to summary
private final RecordingOutput output
poolsback to summary
private LongMap<Constants> pools
removedEventsback to summary
private final LongMap<ChunkWriter.RemovedEvents> removedEvents
wasteback to summary
private final Map<String, Long> waste

Constructor Detail

ChunkWriterback to summary
public ChunkWriter(Path source, Path destination, Predicate<RecordedEvent> filter, boolean collectResults) throws IOException

Method Detail

acceptback to summary
public boolean accept(RecordedEvent event)
beginChunkback to summary
public void beginChunk(ChunkHeader header) throws IOException
closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
endChunkback to summary
public void endChunk(ChunkHeader header) throws IOException
getInputback to summary
public RecordingInput getInput()
getPoolback to summary
pack-priv Constants getPool(Type type)
getRemovedEventTypesback to summary
public List<ChunkWriter.RemovedEvents> getRemovedEventTypes()
newCheckpointEventback to summary
public CheckpointEvent newCheckpointEvent(long startPosition)
touchback to summary
public void touch(Object object)
touchRefback to summary
private void touchRef(Reference ref)
updateHeaderback to summary
private void updateHeader(long size, long constantPosition, long metadataPosition) throws IOException
writeback to summary
public void write(long startPosition, long endPosition) throws IOException
writeback to summary
private void write(CheckpointEvent event, long delta) throws IOException
writeCheckpointEventsback to summary
private void writeCheckpointEvents(long before) throws IOException
writeEventback to summary
public void writeEvent(long startPosition, long endPosition) throws IOException
writeMetadataEventback to summary
private void writeMetadataEvent(ChunkHeader header) throws IOException
jdk.jfr.internal.consumer.filter back to summary

public Class ChunkWriter.RemovedEvents

extends Object
implements Comparable<ChunkWriter.RemovedEvents>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

Field Summary

Modifier and TypeField and Description
private long
public final String
private long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(ChunkWriter.RemovedEvents that)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public String
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
private long count
nameback to summary
public final String name
removedback to summary
private long removed

Constructor Detail

RemovedEventsback to summary
private RemovedEvents(String name)

Method Detail

compareToback to summary
public int compareTo(ChunkWriter.RemovedEvents that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
getNameback to summary
public String getName()
shareback to summary
public String share()