Skip to content

Commit 803ba3d

Browse files
author
Eugene Ma
committed
style changes
1 parent 7241608 commit 803ba3d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/exemplar/FixedSizeExemplarReservoir.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@
99
import io.opentelemetry.context.Context;
1010
import io.opentelemetry.sdk.common.Clock;
1111
import io.opentelemetry.sdk.metrics.data.ExemplarData;
12-
import javax.annotation.Nullable;
1312
import java.util.ArrayList;
1413
import java.util.Collections;
1514
import java.util.List;
1615
import java.util.function.BiFunction;
16+
import javax.annotation.Nullable;
1717

1818
/** Base for fixed-size reservoir sampling of Exemplars. */
1919
abstract class FixedSizeExemplarReservoir<T extends ExemplarData> implements ExemplarReservoir<T> {
2020

21-
@Nullable
22-
private ReservoirCell[] storage;
23-
21+
@Nullable private ReservoirCell[] storage;
2422
private final ReservoirCellSelector reservoirCellSelector;
2523
private final BiFunction<ReservoirCell, Attributes, T> mapAndResetCell;
2624
private final int size;
@@ -42,7 +40,7 @@ abstract class FixedSizeExemplarReservoir<T extends ExemplarData> implements Exe
4240

4341
@Override
4442
public void offerLongMeasurement(long value, Attributes attributes, Context context) {
45-
if (this.storage == null) {
43+
if (storage == null) {
4644
storage = initStorage();
4745
}
4846
int bucket = reservoirCellSelector.reservoirCellIndexFor(storage, value, attributes, context);
@@ -54,7 +52,7 @@ public void offerLongMeasurement(long value, Attributes attributes, Context cont
5452

5553
@Override
5654
public void offerDoubleMeasurement(double value, Attributes attributes, Context context) {
57-
if (this.storage == null) {
55+
if (storage == null) {
5856
storage = initStorage();
5957
}
6058
int bucket = reservoirCellSelector.reservoirCellIndexFor(storage, value, attributes, context);
@@ -77,7 +75,7 @@ public List<T> collectAndReset(Attributes pointAttributes) {
7775
if (!hasMeasurements) {
7876
return Collections.emptyList();
7977
}
80-
if (this.storage == null) {
78+
if (storage == null) {
8179
storage = initStorage();
8280
}
8381
// Note: we are collecting exemplars from buckets piecemeal, but we

0 commit comments

Comments
 (0)