src/jdk.jfr/share/classes/jdk/jfr/consumer/ChunkParser.java
branchJEP-349-branch
changeset 57459 df39f8d8f4d6
parent 57454 703fb247dc4e
child 57467 de154169948b
equal deleted inserted replaced
57454:703fb247dc4e 57459:df39f8d8f4d6
    65     private boolean ordered;
    65     private boolean ordered;
    66     private boolean resetEventCache;
    66     private boolean resetEventCache;
    67     private long firstNanos;
    67     private long firstNanos;
    68 
    68 
    69     public ChunkParser(RecordingInput input, boolean reuse) throws IOException {
    69     public ChunkParser(RecordingInput input, boolean reuse) throws IOException {
    70        this(new ChunkHeader(input), null, 100);
    70        this(new ChunkHeader(input), null, 1000);
    71        this.reuse = reuse;
    71        this.reuse = reuse;
    72     }
    72     }
    73 
    73 
    74     public ChunkParser(ChunkParser previous) throws IOException {
    74     public ChunkParser(ChunkParser previous) throws IOException {
    75         this(new ChunkHeader(previous.input), previous, 100);
    75         this(new ChunkHeader(previous.input), previous, 1000);
    76      }
    76      }
    77 
    77 
    78     private ChunkParser(ChunkHeader header, ChunkParser previous, long pollInterval) throws IOException {
    78     private ChunkParser(ChunkHeader header, ChunkParser previous, long pollInterval) throws IOException {
    79         this.input = header.getInput();
    79         this.input = header.getInput();
    80         this.chunkHeader = header;
    80         this.chunkHeader = header;
    81         if (previous == null) {
    81         if (previous == null) {
    82             this.pollInterval = 500;
    82             this.pollInterval = 1000;
    83             this.constantLookups = new LongMap<>();
    83             this.constantLookups = new LongMap<>();
    84             this.previousMetadata = null;
    84             this.previousMetadata = null;
    85         } else {
    85         } else {
    86             this.constantLookups = previous.constantLookups;
    86             this.constantLookups = previous.constantLookups;
    87             this.previousMetadata = previous.metadata;
    87             this.previousMetadata = previous.metadata;
   199                 return false;
   199                 return false;
   200             }
   200             }
   201             if (chunkHeader.isFinished()) {
   201             if (chunkHeader.isFinished()) {
   202                 return true;
   202                 return true;
   203             }
   203             }
   204             Utils.takeNap(pollInterval);
   204             Utils.waitFlush(pollInterval);
   205         }
   205         }
   206     }
   206     }
   207 
   207 
   208     private void fillConstantPools(long abortCP) throws IOException {
   208     private void fillConstantPools(long abortCP) throws IOException {
   209         long thisCP = chunkHeader.getConstantPoolPosition() + chunkHeader.getAbsoluteChunkStart();
   209         long thisCP = chunkHeader.getConstantPoolPosition() + chunkHeader.getAbsoluteChunkStart();