src/jdk.jfr/share/classes/jdk/jfr/consumer/EventParser.java
author egahlin
Fri, 05 Jul 2019 03:36:40 +0200
branchJEP-349-branch
changeset 57452 6fabe73e5d9a
parent 57385 7d9d4f629f6e
child 57460 bcbc53560c77
permissions -rw-r--r--
Reduced allocation pressure. Fix getValue for startTime and duration
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     1
/*
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
     2
 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     4
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    10
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    15
 * accompanied this code).
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    16
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    20
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    23
 * questions.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    24
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    25
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    26
package jdk.jfr.consumer;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    27
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    28
import static jdk.jfr.internal.EventInstrumentation.FIELD_DURATION;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    29
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    30
import java.io.IOException;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    31
import java.util.List;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    32
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    33
import jdk.jfr.EventType;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    34
import jdk.jfr.ValueDescriptor;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    35
import jdk.jfr.internal.consumer.Parser;
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    36
import jdk.jfr.internal.consumer.RecordingInput;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    37
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    38
/**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    39
 * Parses an event and returns a {@link RecordedEvent}.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    40
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    41
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    42
final class EventParser extends Parser {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    43
    private final Parser[] parsers;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    44
    private final EventType eventType;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    45
    private final TimeConverter timeConverter;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    46
    private final boolean hasDuration;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    47
    private final List<ValueDescriptor> valueDescriptors;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    48
    private final int startIndex;
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    49
    private final int length;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    50
    private final RecordedEvent unorderedEvent;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    51
    private boolean enabled = true;
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    52
    private RecordedEvent[] eventCache;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    53
    private int index;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    54
    private boolean ordered;
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    55
    private long firstNanos;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    56
    private long thresholdNanos = -1;
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    57
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    58
    EventParser(TimeConverter timeConverter, EventType type, Parser[] parsers) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    59
        this.timeConverter = timeConverter;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    60
        this.parsers = parsers;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    61
        this.eventType = type;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    62
        this.hasDuration = type.getField(FIELD_DURATION) != null;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    63
        this.startIndex = hasDuration ? 2 : 1;
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    64
        this.length = parsers.length - startIndex;
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    65
        this.valueDescriptors = type.getFields();
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    66
        this.unorderedEvent = new RecordedEvent(eventType, valueDescriptors, new Object[length], 0L, 0L, timeConverter);
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    67
    }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    68
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    69
    private RecordedEvent cachedEvent() {
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    70
        if (ordered) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    71
            if (index == eventCache.length) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    72
                RecordedEvent[] cache = eventCache;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    73
                eventCache = new RecordedEvent[eventCache.length * 2];
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    74
                System.arraycopy(cache, 0, eventCache, 0, cache.length);
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    75
            }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    76
            RecordedEvent event = eventCache[index];
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    77
            if (event == null) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    78
                event = new RecordedEvent(eventType, valueDescriptors, new Object[length], 0L, 0L, timeConverter);
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    79
                eventCache[index] = event;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    80
            }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    81
            index++;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    82
            return event;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    83
        } else {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    84
            return unorderedEvent;
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    85
        }
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    86
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    87
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    88
    public EventType getEventType() {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    89
        return eventType;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    90
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    91
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    92
    public void setThresholdNanos(long thresholdNanos) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    93
        this.thresholdNanos = thresholdNanos;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    94
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    95
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    96
    public void setEnabled(boolean enabled) {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    97
        this.enabled = enabled;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    98
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    99
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   100
    public boolean isEnabled() {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   101
        return this.enabled;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   102
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   103
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   104
    public RecordedEvent parse(RecordingInput input) throws IOException {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   105
        if (enabled) {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   106
            long startTicks = input.readLong();
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   107
            long durationTicks = 0;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   108
            if (hasDuration) {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   109
                durationTicks = input.readLong();
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   110
                if (thresholdNanos > 0L) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   111
                    if (timeConverter.convertTimespan(durationTicks) < thresholdNanos) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   112
                        return null;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   113
                    }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   114
                }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   115
            }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   116
            long endTicks = startTicks + durationTicks;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   117
            if (firstNanos > 0L) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   118
                if (timeConverter.convertTimestamp(endTicks) < firstNanos) {
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   119
                    return null;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   120
                }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   121
            }
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   122
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   123
            if (eventCache != null) {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   124
                RecordedEvent event = cachedEvent();
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   125
                event.startTimeTicks = startTicks;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   126
                event.endTimeTicks = endTicks;
57376
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   127
                Object[] values = event.objects;
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   128
                for (int i = 0; i < length; i++) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   129
                    values[i] = parsers[startIndex + i].parse(input);
57376
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   130
                }
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   131
                return event;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   132
            } else {
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   133
                Object[] values = new Object[length];
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   134
                for (int i = 0; i < length; i++) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   135
                    values[i] = parsers[startIndex + i].parse(input);
57376
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   136
                }
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   137
                return new RecordedEvent(eventType, valueDescriptors, values, startTicks, endTicks, timeConverter);
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   138
            }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   139
        }
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   140
        return null;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   141
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   142
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   143
    @Override
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   144
    public void skip(RecordingInput input) throws IOException {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   145
        throw new InternalError("Should not call this method. More efficent to read event size and skip ahead");
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   146
    }
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   147
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   148
    public void resetCache() {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   149
        index = 0;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   150
    }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   151
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   152
    public boolean hasReuse() {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   153
        return eventCache != null;
57376
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   154
    }
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   155
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   156
    public void setReuse(boolean reuse) {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   157
        if (reuse == hasReuse()) {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   158
            return;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   159
        }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   160
        if (reuse) {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   161
            eventCache = new RecordedEvent[2];
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   162
            index = 0;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   163
        } else {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   164
            eventCache = null;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   165
        }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   166
    }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   167
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   168
    public void setFirstNanos(long firstNanos) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   169
        this.firstNanos = firstNanos;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   170
    }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   171
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   172
    public void setOrdered(boolean ordered) {
57385
7d9d4f629f6e Make setReuse and setOrdered work across chunk boundaries. Improved unit tests
egahlin
parents: 57380
diff changeset
   173
        if (this.ordered == ordered) {
7d9d4f629f6e Make setReuse and setOrdered work across chunk boundaries. Improved unit tests
egahlin
parents: 57380
diff changeset
   174
            return;
7d9d4f629f6e Make setReuse and setOrdered work across chunk boundaries. Improved unit tests
egahlin
parents: 57380
diff changeset
   175
        }
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   176
        this.ordered = ordered;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   177
        this.index = 0;
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   178
    }
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   179
}