8279682: JFR: Remove dead code
Reviewed-by: mgronlun
This commit is contained in:
parent
6504458d87
commit
ec5a455efb
src/jdk.jfr/share/classes/jdk/jfr
@ -424,25 +424,6 @@ public final class Recording implements Closeable {
|
||||
internal.setMaxSize(maxSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines how often events are made available for streaming.
|
||||
*
|
||||
* @param interval the interval at which events are made available for streaming.
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code interval} is negative
|
||||
*
|
||||
* @throws IllegalStateException if the recording is in the {@code CLOSED} state
|
||||
*
|
||||
* @since 14
|
||||
*/
|
||||
/*package private*/ void setFlushInterval(Duration interval) {
|
||||
Objects.requireNonNull(interval);
|
||||
if (interval.isNegative()) {
|
||||
throw new IllegalArgumentException("Stream interval can't be negative");
|
||||
}
|
||||
internal.setFlushInterval(interval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns how often events are made available for streaming purposes.
|
||||
*
|
||||
|
@ -33,7 +33,6 @@ import java.io.RandomAccessFile;
|
||||
import java.io.Reader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.ReflectPermission;
|
||||
import java.nio.channels.FileChannel;
|
||||
@ -354,10 +353,6 @@ public final class SecuritySupport {
|
||||
doPrivileged(() -> thread.setUncaughtExceptionHandler(eh), new RuntimePermission("modifyThread"));
|
||||
}
|
||||
|
||||
static void moveReplace(SafePath from, SafePath to) throws IOException {
|
||||
doPrivilegedIOWithReturn(() -> Files.move(from.toPath(), to.toPath()));
|
||||
}
|
||||
|
||||
static void clearDirectory(SafePath safePath) throws IOException {
|
||||
doPriviligedIO(() -> Files.walkFileTree(safePath.toPath(), new DirectoryCleaner()));
|
||||
}
|
||||
@ -404,10 +399,6 @@ public final class SecuritySupport {
|
||||
return doPrivilegedIOWithReturn(() -> Files.isWritable(safePath.toPath()));
|
||||
}
|
||||
|
||||
static void deleteOnExit(SafePath safePath) {
|
||||
doPrivileged(() -> safePath.toPath().toFile().deleteOnExit());
|
||||
}
|
||||
|
||||
static ReadableByteChannel newFileChannelToRead(SafePath safePath) throws IOException {
|
||||
return doPrivilegedIOWithReturn(() -> FileChannel.open(safePath.toPath(), StandardOpenOption.READ));
|
||||
}
|
||||
@ -420,10 +411,6 @@ public final class SecuritySupport {
|
||||
return doPrivilegedIOWithReturn(() -> Files.newBufferedReader(safePath.toPath()));
|
||||
}
|
||||
|
||||
static void touch(SafePath path) throws IOException {
|
||||
doPriviligedIO(() -> new RandomAccessFile(path.toPath().toFile(), "rw").close());
|
||||
}
|
||||
|
||||
static void setAccessible(Method method) {
|
||||
doPrivileged(() -> method.setAccessible(true), new ReflectPermission("suppressAccessChecks"));
|
||||
}
|
||||
|
@ -163,14 +163,6 @@ public final class ChunkHeader {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean readHeader(byte[] bytes, int count) throws IOException {
|
||||
input.position(absoluteChunkStart);
|
||||
for (int i = 0; i< count; i++) {
|
||||
bytes[i] = input.readPhysicalByte();
|
||||
}
|
||||
return bytes[(int)FILE_STATE_POSITION] != UPDATING_CHUNK_HEADER;
|
||||
}
|
||||
|
||||
public void awaitFinished() throws IOException {
|
||||
if (finished) {
|
||||
return;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@ package jdk.jfr.internal.consumer;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.security.AccessControlContext;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
@ -49,7 +48,7 @@ import jdk.jfr.internal.consumer.ChunkParser.ParserConfiguration;
|
||||
* with chunk files.
|
||||
*
|
||||
*/
|
||||
public class EventDirectoryStream extends AbstractEventStream {
|
||||
public final class EventDirectoryStream extends AbstractEventStream {
|
||||
|
||||
private static final Comparator<? super RecordedEvent> EVENT_COMPARATOR = JdkJfrConsumer.instance().eventComparator();
|
||||
|
||||
@ -60,8 +59,6 @@ public class EventDirectoryStream extends AbstractEventStream {
|
||||
private long currentChunkStartNanos;
|
||||
private RecordedEvent[] sortedCache;
|
||||
private int threadExclusionLevel = 0;
|
||||
protected volatile long maxSize;
|
||||
protected volatile Duration maxAge;
|
||||
|
||||
private volatile Consumer<Long> onCompleteHandler;
|
||||
|
||||
@ -259,12 +256,4 @@ public class EventDirectoryStream extends AbstractEventStream {
|
||||
c.dispatch(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setMaxSize(long maxSize) {
|
||||
this.maxSize = maxSize;
|
||||
}
|
||||
|
||||
public void setMaxAge(Duration maxAge) {
|
||||
this.maxAge = maxAge;
|
||||
}
|
||||
}
|
||||
|
@ -78,10 +78,6 @@ public final class CutoffSetting extends JDKSettingControl {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static boolean isType(long typeId) {
|
||||
return CutoffSetting.typeId == typeId;
|
||||
}
|
||||
|
||||
public static long parseValueSafe(String value) {
|
||||
if (value == null) {
|
||||
return 0L;
|
||||
|
@ -91,9 +91,5 @@ public final class ThrottleSetting extends JDKSettingControl {
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static boolean isType(long typeId) {
|
||||
return ThrottleSetting.typeId == typeId;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user