Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257508

The jdk.jfr.Recording.getStream does not work when toDisk is disabled.

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      jfr
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      The same behavior is kept as before. The change only clarifies what happens in case of an in memory recording.
    • Interface Kind:
      Java API
    • Scope:
      JDK

      Description

      Summary

      Clarify behavior for the jdk.jfr.Recording.getStream(Instant, Instant) method when recording in memory.

      Problem

      The jdk.jfr.Recording.getStream() allows a user to get an InputStream to read data for a stopped recording located in the disk repository. When a recording is not to disk and data is only kept temporary in native JVM buffers, it is not possible to get an InputStream,.

      Solution

      If there are no disk chunks to read in the repository, null is returned. This is also what happens when a recording is in memory (not to disk). This should be documented.

      Specification

            * Creates a data stream for a specified interval.
            * <p>
            * The stream may contain some data outside the specified range.
      +     * <p>
      +     * If the recording is not to disk, a stream can't be created
      +     * and {@code null} is returned.
            *
            * @param start the start time for the stream, or {@code null} to get data from
            *        start time of the recording
      @@ -585,7 +588,7 @@ public final class Recording implements Closeable {
            *        present time.
            *
            * @return an input stream, or {@code null} if no data is available in the
      -     *         interval.
      +     *         interval, or the recording was not recorded to disk 
            *
            * @throws IllegalArgumentException if {@code end} happens before
            *         {@code start}
            *
            * @throws IOException if a stream can't be opened
      +     * 
      +     * @see #setToDisk(boolean)
            */

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              egahlin Erik Gahlin
              Reporter:
              tzezula Tomáš Zezula
              Reviewed By:
              Markus Grönlund
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: