Skip to content

Commit c8682cb

Browse files
author
duke
committedMar 18, 2022
Automatic merge of jdk:master into master
2 parents 07b296c + c72bcfc commit c8682cb

File tree

6 files changed

+35
-35
lines changed

6 files changed

+35
-35
lines changed
 

‎src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ChunkParser.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import jdk.jfr.internal.MetadataDescriptor;
4242
import jdk.jfr.internal.Type;
4343
import jdk.jfr.internal.Utils;
44-
import jdk.jfr.internal.consumer.filter.CheckPointEvent;
44+
import jdk.jfr.internal.consumer.filter.CheckpointEvent;
4545
import jdk.jfr.internal.consumer.filter.ChunkWriter;
4646

4747
/**
@@ -77,7 +77,7 @@ public boolean isOrdered() {
7777
}
7878
}
7979

80-
private enum CheckPointType {
80+
private enum CheckpointType {
8181
// Checkpoint that finishes a flush segment
8282
FLUSH(1),
8383
// Checkpoint contains chunk header information in the first pool
@@ -87,7 +87,7 @@ private enum CheckPointType {
8787
// Checkpoint contains thread related information
8888
THREAD(8);
8989
private final int mask;
90-
private CheckPointType(int mask) {
90+
private CheckpointType(int mask) {
9191
this.mask = mask;
9292
}
9393

@@ -267,7 +267,7 @@ public RecordedEvent readEvent() throws IOException {
267267
// Not accepted by filter
268268
} else {
269269
if (typeId == 1) { // checkpoint event
270-
if (CheckPointType.FLUSH.is(parseCheckpointType())) {
270+
if (CheckpointType.FLUSH.is(parseCheckpointType())) {
271271
input.position(pos + size);
272272
return FLUSH_MARKER;
273273
}
@@ -317,9 +317,9 @@ private void fillConstantPools(long abortCP) throws IOException {
317317
long delta = -1;
318318
boolean logTrace = Logger.shouldLog(LogTag.JFR_SYSTEM_PARSER, LogLevel.TRACE);
319319
while (thisCP != abortCP && delta != 0) {
320-
CheckPointEvent cp = null;
320+
CheckpointEvent cp = null;
321321
if (configuration.chunkWriter != null) {
322-
cp = configuration.chunkWriter.newCheckPointEvent(thisCP);
322+
cp = configuration.chunkWriter.newCheckpointEvent(thisCP);
323323
}
324324
input.position(thisCP);
325325
lastCP = thisCP;

‎src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/filter/CheckPointEvent.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,36 @@
3535
* <p>
3636
* All positional values are relative to file start, not the chunk.
3737
*/
38-
public final class CheckPointEvent {
38+
public final class CheckpointEvent {
3939
private final ChunkWriter chunkWriter;
40-
private final LinkedHashMap<Long, CheckPointPool> pools = new LinkedHashMap<>();
40+
private final LinkedHashMap<Long, CheckpointPool> pools = new LinkedHashMap<>();
4141
private final long startPosition;
4242

43-
public CheckPointEvent(ChunkWriter chunkWriter, long startPosition) {
43+
public CheckpointEvent(ChunkWriter chunkWriter, long startPosition) {
4444
this.chunkWriter = chunkWriter;
4545
this.startPosition = startPosition;
4646
}
4747

4848
public PoolEntry addEntry(Type type, long id, long startPosition, long endPosition, Object references) {
4949
long typeId = type.getId();
5050
PoolEntry pe = new PoolEntry(startPosition, endPosition, type, id, references);
51-
var cpp = pools.computeIfAbsent(typeId, k -> new CheckPointPool(typeId));
51+
var cpp = pools.computeIfAbsent(typeId, k -> new CheckpointPool(typeId));
5252
cpp.add(pe);
5353
chunkWriter.getPool(type).add(id, pe);
5454
return pe;
5555
}
5656

5757
public long touchedPools() {
5858
int count = 0;
59-
for (CheckPointPool cpp : pools.values()) {
59+
for (CheckpointPool cpp : pools.values()) {
6060
if (cpp.isTouched()) {
6161
count++;
6262
}
6363
}
6464
return count;
6565
}
6666

67-
public Collection<CheckPointPool> getPools() {
67+
public Collection<CheckpointPool> getPools() {
6868
return pools.values();
6969
}
7070

@@ -74,7 +74,7 @@ public long getStartPosition() {
7474

7575
public String toString() {
7676
StringBuilder sb = new StringBuilder();
77-
for (CheckPointPool p : pools.values()) {
77+
for (CheckpointPool p : pools.values()) {
7878
for (var e : p.getEntries()) {
7979
if (e.isTouched()) {
8080
sb.append(e.getType().getName() + " " + e.getId() + "\n");

‎src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/filter/CheckPointPool.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
/**
3030
* Represents a constant pool in a checkpoint, both entries and type id
3131
*/
32-
final class CheckPointPool {
32+
final class CheckpointPool {
3333
private final List<PoolEntry> entries = new ArrayList<>();
3434
private final long typeId;
3535

36-
public CheckPointPool(long typeId) {
36+
public CheckpointPool(long typeId) {
3737
this.typeId = typeId;
3838
}
3939

‎src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/filter/ChunkWriter.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@
5151
*/
5252
public final class ChunkWriter implements Closeable {
5353
private LongMap<Constants> pools = new LongMap<>();
54-
private final Deque<CheckPointEvent> checkPoints = new ArrayDeque<>();
54+
private final Deque<CheckpointEvent> checkpoints = new ArrayDeque<>();
5555
private final Path destination;
5656
private final RecordingInput input;
5757
private final RecordingOutput output;
5858
private final Predicate<RecordedEvent> filter;
5959

6060
private long chunkStartPosition;
6161
private boolean chunkComplete;
62-
private long lastCheckPoint;
62+
private long lastCheckpoint;
6363

6464
public ChunkWriter(Path source, Path destination, Predicate<RecordedEvent> filter) throws IOException {
6565
this.destination = destination;
@@ -78,9 +78,9 @@ Constants getPool(Type type) {
7878
return pool;
7979
}
8080

81-
public CheckPointEvent newCheckPointEvent(long startPosition) {
82-
CheckPointEvent event = new CheckPointEvent(this, startPosition);
83-
checkPoints.add(event);
81+
public CheckpointEvent newCheckpointEvent(long startPosition) {
82+
CheckpointEvent event = new CheckpointEvent(this, startPosition);
83+
checkpoints.add(event);
8484
return event;
8585
}
8686

@@ -120,16 +120,16 @@ public void writeEvent(long startPosition, long endPosition) throws IOException
120120

121121
// Write check point events before a position
122122
private void writeCheckpointEvents(long before) throws IOException {
123-
CheckPointEvent cp = checkPoints.peek();
123+
CheckpointEvent cp = checkpoints.peek();
124124
while (cp != null && cp.getStartPosition() < before) {
125-
checkPoints.poll();
125+
checkpoints.poll();
126126
long delta = 0;
127-
if (lastCheckPoint != 0) {
128-
delta = lastCheckPoint - output.position();
127+
if (lastCheckpoint != 0) {
128+
delta = lastCheckpoint - output.position();
129129
}
130-
lastCheckPoint = output.position();
130+
lastCheckpoint = output.position();
131131
write(cp, delta);
132-
cp = checkPoints.peek();
132+
cp = checkpoints.peek();
133133
}
134134
}
135135

@@ -174,10 +174,10 @@ public void endChunk(ChunkHeader header) throws IOException {
174174
writeCheckpointEvents(Long.MAX_VALUE);
175175
long metadata = output.position();
176176
writeMetadataEvent(header);
177-
updateHeader(output.position(), lastCheckPoint, metadata);
177+
updateHeader(output.position(), lastCheckpoint, metadata);
178178
pools = new LongMap<>();
179179
chunkComplete = true;
180-
lastCheckPoint = 0;
180+
lastCheckpoint = 0;
181181
}
182182

183183
private void writeMetadataEvent(ChunkHeader header) throws IOException {
@@ -190,7 +190,7 @@ private void writeMetadataEvent(ChunkHeader header) throws IOException {
190190
}
191191
}
192192

193-
private void write(CheckPointEvent event, long delta) throws IOException {
193+
private void write(CheckpointEvent event, long delta) throws IOException {
194194
input.position(event.getStartPosition());
195195
long startPosition = output.position();
196196

@@ -205,7 +205,7 @@ private void write(CheckPointEvent event, long delta) throws IOException {
205205

206206
// Write even if touched pools are zero, checkpoint works as sync point
207207
output.writeLong(event.touchedPools()); // Pool count
208-
for (CheckPointPool pool : event.getPools()) {
208+
for (CheckpointPool pool : event.getPools()) {
209209
if (pool.isTouched()) {
210210
output.writeLong(pool.getTypeId());
211211
output.writeLong(pool.getTouchedCount());

‎src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private void printInformation(Path p) throws IOException {
100100
}
101101
HashMap<Long, Statistics> stats = new HashMap<>();
102102
stats.put(0L, new Statistics(eventPrefix + "Metadata"));
103-
stats.put(1L, new Statistics(eventPrefix + "CheckPoint"));
103+
stats.put(1L, new Statistics(eventPrefix + "Checkpoint"));
104104
int minWidth = 0;
105105
while (true) {
106106
long chunkEnd = ch.getEnd();

‎src/jdk.management.jfr/share/classes/jdk/management/jfr/DiskRepository.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public synchronized void write(byte[] bytes) throws IOException {
179179
bufferIndex = 0;
180180
break;
181181
case CHECKPOINT_EVENT_HEADER_BYTE_ARRAY_CONTENT:
182-
processCheckPointHeader();
182+
processCheckpointHeader();
183183
break;
184184
case CHECKPOINT_EVENT_FLUSH_TYPE:
185185
processFlush();
@@ -286,10 +286,10 @@ private void processInitialHeader() throws IOException {
286286
}
287287
}
288288

289-
private void processCheckPointHeader() throws IOException {
289+
private void processCheckpointHeader() throws IOException {
290290
buffer.put(bufferIndex, nextByte(true));
291291
if (bufferIndex == HEADER_SIZE) {
292-
writeCheckPointHeader();
292+
writeCheckpointHeader();
293293
state = State.EVENT_PAYLOAD;
294294
bufferIndex = 0;
295295
}
@@ -321,7 +321,7 @@ private void completePrevious(DiskChunk previous) throws IOException {
321321
}
322322
}
323323

324-
private void writeCheckPointHeader() throws IOException {
324+
private void writeCheckpointHeader() throws IOException {
325325
Objects.requireNonNull(raf);
326326
byte state = buffer.get(HEADER_FILE_STATE_POSITION);
327327
boolean complete = state == COMPLETE_STATE;

0 commit comments

Comments
 (0)
Please sign in to comment.