src/jdk.jfr/share/classes/jdk/jfr/consumer/EventParser.java
author egahlin
Mon, 08 Jul 2019 23:08:05 +0200
branchJEP-349-branch
changeset 57460 bcbc53560c77
parent 57452 6fabe73e5d9a
child 57463 e8d4ec2bf480
permissions -rw-r--r--
Reduce allocation rate by minimizing number of fields in RecordedEvent
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;
57460
bcbc53560c77 Reduce allocation rate by minimizing number of fields in RecordedEvent
egahlin
parents: 57452
diff changeset
    57
    private ObjectContext objectContext;
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    58
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    59
    EventParser(TimeConverter timeConverter, EventType type, Parser[] parsers) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    60
        this.timeConverter = timeConverter;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    61
        this.parsers = parsers;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    62
        this.eventType = type;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    63
        this.hasDuration = type.getField(FIELD_DURATION) != null;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    64
        this.startIndex = hasDuration ? 2 : 1;
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    65
        this.length = parsers.length - startIndex;
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    66
        this.valueDescriptors = type.getFields();
57460
bcbc53560c77 Reduce allocation rate by minimizing number of fields in RecordedEvent
egahlin
parents: 57452
diff changeset
    67
        this.objectContext = new ObjectContext(type, valueDescriptors, timeConverter);
bcbc53560c77 Reduce allocation rate by minimizing number of fields in RecordedEvent
egahlin
parents: 57452
diff changeset
    68
        this.unorderedEvent = new RecordedEvent(objectContext, new Object[length], 0L, 0L);
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    69
    }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    70
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    71
    private RecordedEvent cachedEvent() {
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    72
        if (ordered) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    73
            if (index == eventCache.length) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    74
                RecordedEvent[] cache = eventCache;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    75
                eventCache = new RecordedEvent[eventCache.length * 2];
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    76
                System.arraycopy(cache, 0, eventCache, 0, cache.length);
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    77
            }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    78
            RecordedEvent event = eventCache[index];
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    79
            if (event == null) {
57460
bcbc53560c77 Reduce allocation rate by minimizing number of fields in RecordedEvent
egahlin
parents: 57452
diff changeset
    80
                event = new RecordedEvent(objectContext, new Object[length], 0L, 0L);
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    81
                eventCache[index] = event;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    82
            }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    83
            index++;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    84
            return event;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    85
        } else {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    86
            return unorderedEvent;
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
    87
        }
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    88
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    89
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    90
    public EventType getEventType() {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    91
        return eventType;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    92
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    93
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    94
    public void setThresholdNanos(long thresholdNanos) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
    95
        this.thresholdNanos = thresholdNanos;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    96
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    97
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    98
    public void setEnabled(boolean enabled) {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
    99
        this.enabled = enabled;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   100
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   101
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   102
    public boolean isEnabled() {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   103
        return this.enabled;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   104
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   105
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   106
    public RecordedEvent parse(RecordingInput input) throws IOException {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   107
        if (enabled) {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   108
            long startTicks = input.readLong();
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   109
            long durationTicks = 0;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   110
            if (hasDuration) {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   111
                durationTicks = input.readLong();
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   112
                if (thresholdNanos > 0L) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   113
                    if (timeConverter.convertTimespan(durationTicks) < thresholdNanos) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   114
                        return null;
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
                }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   117
            }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   118
            long endTicks = startTicks + durationTicks;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   119
            if (firstNanos > 0L) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   120
                if (timeConverter.convertTimestamp(endTicks) < firstNanos) {
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   121
                    return null;
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   122
                }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   123
            }
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   124
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   125
            if (eventCache != null) {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   126
                RecordedEvent event = cachedEvent();
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   127
                event.startTimeTicks = startTicks;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   128
                event.endTimeTicks = endTicks;
57376
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   129
                Object[] values = event.objects;
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   130
                for (int i = 0; i < length; i++) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   131
                    values[i] = parsers[startIndex + i].parse(input);
57376
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   132
                }
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   133
                return event;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   134
            } else {
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   135
                Object[] values = new Object[length];
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   136
                for (int i = 0; i < length; i++) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   137
                    values[i] = parsers[startIndex + i].parse(input);
57376
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   138
                }
57460
bcbc53560c77 Reduce allocation rate by minimizing number of fields in RecordedEvent
egahlin
parents: 57452
diff changeset
   139
                return new RecordedEvent(objectContext, values, startTicks, endTicks);
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   140
            }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   141
        }
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   142
        return null;
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   143
    }
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   144
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   145
    @Override
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   146
    public void skip(RecordingInput input) throws IOException {
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   147
        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
   148
    }
57360
5d043a159d5c Preview
egahlin
parents: 50113
diff changeset
   149
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   150
    public void resetCache() {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   151
        index = 0;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   152
    }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   153
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   154
    public boolean hasReuse() {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   155
        return eventCache != null;
57376
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   156
    }
8e8a06a3059c Add foundation for event object reuse
egahlin
parents: 57360
diff changeset
   157
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   158
    public void setReuse(boolean reuse) {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   159
        if (reuse == hasReuse()) {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   160
            return;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   161
        }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   162
        if (reuse) {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   163
            eventCache = new RecordedEvent[2];
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   164
            index = 0;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   165
        } else {
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   166
            eventCache = null;
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   167
        }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   168
    }
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   169
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   170
    public void setFirstNanos(long firstNanos) {
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   171
        this.firstNanos = firstNanos;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   172
    }
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   173
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   174
    public void setOrdered(boolean ordered) {
57385
7d9d4f629f6e Make setReuse and setOrdered work across chunk boundaries. Improved unit tests
egahlin
parents: 57380
diff changeset
   175
        if (this.ordered == ordered) {
7d9d4f629f6e Make setReuse and setOrdered work across chunk boundaries. Improved unit tests
egahlin
parents: 57380
diff changeset
   176
            return;
7d9d4f629f6e Make setReuse and setOrdered work across chunk boundaries. Improved unit tests
egahlin
parents: 57380
diff changeset
   177
        }
57452
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   178
        this.ordered = ordered;
6fabe73e5d9a Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents: 57385
diff changeset
   179
        this.index = 0;
57380
6a7e7743b82f setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents: 57376
diff changeset
   180
    }
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   181
}