Java Code Examples for jdk.jfr.events.FileReadEvent#reset()

The following examples show how to use jdk.jfr.events.FileReadEvent#reset() . 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: FileChannelImplInstrumentor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst, long position) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst, position);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst, position);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 2
Source File: FileChannelImplInstrumentor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst, long position) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst, position);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst, position);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 3
Source File: FileChannelImplInstrumentor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 4
Source File: FileInputStreamInstrumentor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 5
Source File: FileInputStreamInstrumentor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 6
Source File: FileChannelImplInstrumentor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dsts, offset, length);
    }
    long bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dsts, offset, length);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 7
Source File: RandomAccessFileInstrumentor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[], int off, int len) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b, off, len);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b, off, len);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 8
Source File: RandomAccessFileInstrumentor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 9
Source File: RandomAccessFileInstrumentor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 10
Source File: RandomAccessFileInstrumentor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 11
Source File: FileChannelImplInstrumentor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 12
Source File: FileInputStreamInstrumentor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 13
Source File: RandomAccessFileInstrumentor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 14
Source File: FileInputStreamInstrumentor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 15
Source File: FileInputStreamInstrumentor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 16
Source File: RandomAccessFileInstrumentor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[], int off, int len) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b, off, len);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b, off, len);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 17
Source File: RandomAccessFileInstrumentor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 18
Source File: RandomAccessFileInstrumentor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 19
Source File: FileChannelImplInstrumentor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dsts, offset, length);
    }
    long bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dsts, offset, length);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 20
Source File: FileChannelImplInstrumentor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst, long position) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst, position);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst, position);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}