src/jdk.jfr/share/classes/jdk/jfr/consumer/EventFileStream.java
branchJEP-349-branch
changeset 58020 f082177c5023
parent 57985 be121cbf3284
child 58129 7b751fe181a5
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventFileStream.java	Tue Sep 03 22:54:46 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventFileStream.java	Thu Sep 05 16:46:50 2019 +0200
@@ -43,7 +43,7 @@
     private ChunkParser chunkParser;
     private RecordedEvent[] sortedList;
 
-    public EventFileStream(AccessControlContext acc, Path path) throws IOException {
+    EventFileStream(AccessControlContext acc, Path path) throws IOException {
         super(acc, false);
         Objects.requireNonNull(path);
         this.input = new RecordingInput(path.toFile(), FileAccess.UNPRIVILIGED);
@@ -71,7 +71,7 @@
     }
 
     @Override
-    public void process() throws IOException {
+    protected void process() throws IOException {
         StreamConfiguration c = configuration;
         long start = 0;
         long end = Long.MAX_VALUE;
@@ -98,11 +98,11 @@
             chunkParser.resetEventCache();
             chunkParser.setParserFilter(c.getFiler());
             chunkParser.updateEventParsers();
-            clearLastDispatch();
+            c.clearDispatchCache();
             if (ordered) {
-                processOrdered();
+                processOrdered(c);
             } else {
-                processUnordered();
+                processUnordered(c);
             }
             if (chunkParser.isLastChunk()) {
                 return;
@@ -111,7 +111,7 @@
         }
     }
 
-    private void processOrdered() throws IOException {
+    private void processOrdered(StreamConfiguration c) throws IOException {
         if (sortedList == null) {
             sortedList = new RecordedEvent[10_000];
         }
@@ -122,7 +122,7 @@
             if (event == null) {
                 Arrays.sort(sortedList, 0, index, END_TIME);
                 for (int i = 0; i < index; i++) {
-                    dispatch(sortedList[i]);
+                    dispatch(c, sortedList[i]);
                 }
                 return;
             }
@@ -135,13 +135,13 @@
         }
     }
 
-    private void processUnordered() throws IOException {
+    private void processUnordered(StreamConfiguration c) throws IOException {
         while (!isClosed()) {
             RecordedEvent event = chunkParser.readEvent();
             if (event == null) {
                 return;
             }
-            dispatch(event);
+            dispatch(c, event);
         }
     }
 }