Java Code Examples for jdk.jfr.internal.consumer.ChunkHeader#nextHeader()

The following examples show how to use jdk.jfr.internal.consumer.ChunkHeader#nextHeader() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RecordingFile.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a list of all event types in this recording.
 *
 * @return a list of event types, not {@code null}
 * @throws IOException if an I/O error occurred while reading from the file
 *
 * @see #hasMoreEvents()
 */
public List<EventType> readEventTypes() throws IOException {
    ensureOpen();
    List<EventType> types = new ArrayList<>();
    HashSet<Long> foundIds = new HashSet<>();
    try (RecordingInput ri = new RecordingInput(file)) {
        ChunkHeader ch = new ChunkHeader(ri);
        aggregateTypeForChunk(ch, types, foundIds);
        while (!ch.isLastChunk()) {
            ch = ch.nextHeader();
            aggregateTypeForChunk(ch, types, foundIds);
        }
    }
    return types;
}
 
Example 2
Source File: SplitCommand.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private List<Long> findChunkSizes(Path p) throws IOException {
    try (RecordingInput input = new RecordingInput(p.toFile())) {
        List<Long> sizes = new ArrayList<>();
        ChunkHeader ch = new ChunkHeader(input);
        sizes.add(ch.getSize());
        while (!ch.isLastChunk()) {
            ch = ch.nextHeader();
            sizes.add(ch.getSize());
        }
        return sizes;
    }
}
 
Example 3
Source File: RecordingFile.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a list of all event types in this recording.
 *
 * @return a list of event types, not {@code null}
 * @throws IOException if an I/O error occurred while reading from the file
 *
 * @see #hasMoreEvents()
 */
public List<EventType> readEventTypes() throws IOException {
    ensureOpen();
    List<EventType> types = new ArrayList<>();
    HashSet<Long> foundIds = new HashSet<>();
    try (RecordingInput ri = new RecordingInput(file)) {
        ChunkHeader ch = new ChunkHeader(ri);
        aggregateEventTypeForChunk(ch, types, foundIds);
        while (!ch.isLastChunk()) {
            ch = ch.nextHeader();
            aggregateEventTypeForChunk(ch, types, foundIds);
        }
    }
    return types;
}
 
Example 4
Source File: RecordingFile.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
List<Type> readTypes() throws IOException  {
    ensureOpen();
    List<Type> types = new ArrayList<>();
    HashSet<Long> foundIds = new HashSet<>();
    try (RecordingInput ri = new RecordingInput(file)) {
        ChunkHeader ch = new ChunkHeader(ri);
        aggregateTypeForChunk(ch, types, foundIds);
        while (!ch.isLastChunk()) {
            ch = ch.nextHeader();
            aggregateTypeForChunk(ch, types, foundIds);
        }
    }
    return types;
}
 
Example 5
Source File: Disassemble.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private List<Long> findChunkSizes(Path p) throws IOException {
    try (RecordingInput input = new RecordingInput(p.toFile())) {
        List<Long> sizes = new ArrayList<>();
        ChunkHeader ch = new ChunkHeader(input);
        sizes.add(ch.getSize());
        while (!ch.isLastChunk()) {
            ch = ch.nextHeader();
            sizes.add(ch.getSize());
        }
        return sizes;
    }
}
 
Example 6
Source File: RecordingFile.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a list of all event types in this recording.
 *
 * @return a list of event types, not {@code null}
 * @throws IOException if an I/O error occurred while reading from the file
 *
 * @see #hasMoreEvents()
 */
public List<EventType> readEventTypes() throws IOException {
    ensureOpen();
    List<EventType> types = new ArrayList<>();
    HashSet<Long> foundIds = new HashSet<>();
    try (RecordingInput ri = new RecordingInput(file)) {
        ChunkHeader ch = new ChunkHeader(ri);
        aggregateEventTypeForChunk(ch, types, foundIds);
        while (!ch.isLastChunk()) {
            ch = ch.nextHeader();
            aggregateEventTypeForChunk(ch, types, foundIds);
        }
    }
    return types;
}
 
Example 7
Source File: RecordingFile.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
List<Type> readTypes() throws IOException  {
    ensureOpen();
    List<Type> types = new ArrayList<>();
    HashSet<Long> foundIds = new HashSet<>();
    try (RecordingInput ri = new RecordingInput(file)) {
        ChunkHeader ch = new ChunkHeader(ri);
        aggregateTypeForChunk(ch, types, foundIds);
        while (!ch.isLastChunk()) {
            ch = ch.nextHeader();
            aggregateTypeForChunk(ch, types, foundIds);
        }
    }
    return types;
}
 
Example 8
Source File: Disassemble.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private List<Long> findChunkSizes(Path p) throws IOException {
    try (RecordingInput input = new RecordingInput(p.toFile())) {
        List<Long> sizes = new ArrayList<>();
        ChunkHeader ch = new ChunkHeader(input);
        sizes.add(ch.getSize());
        while (!ch.isLastChunk()) {
            ch = ch.nextHeader();
            sizes.add(ch.getSize());
        }
        return sizes;
    }
}