Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static final class State {
private final double effectiveWindowNanos;
private final long lastNanoTime;

public State(double effectiveWindowCount, double effectiveWindowNanos, long lastNanoTime) {
State(double effectiveWindowCount, double effectiveWindowNanos, long lastNanoTime) {
this.effectiveWindowCount = effectiveWindowCount;
this.effectiveWindowNanos = effectiveWindowNanos;
this.lastNanoTime = lastNanoTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static final class ReadableSpanWithPriority {
private final int rval;
private final long priority;

public static ReadableSpanWithPriority create(
static ReadableSpanWithPriority create(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, removing unnecessary public modifier and reducing since it is only used internally.

ReadableSpan readableSpan, RandomGenerator randomGenerator) {
String otelTraceStateString =
readableSpan.getSpanContext().getTraceState().get(OtelTraceState.TRACE_STATE_KEY);
Expand Down Expand Up @@ -201,7 +201,7 @@ private static final class Reservoir {
private final PriorityQueue<ReadableSpanWithPriority> queue;
private final RandomGenerator randomGenerator;

public Reservoir(int reservoirSize, RandomGenerator randomGenerator) {
Reservoir(int reservoirSize, RandomGenerator randomGenerator) {
if (reservoirSize < 1) {
throw new IllegalArgumentException();
}
Expand All @@ -211,7 +211,7 @@ public Reservoir(int reservoirSize, RandomGenerator randomGenerator) {
this.randomGenerator = randomGenerator;
}

public void add(ReadableSpanWithPriority readableSpanWithPriority) {
void add(ReadableSpanWithPriority readableSpanWithPriority) {

if (queue.size() < reservoirSize) {
queue.add(readableSpanWithPriority);
Expand All @@ -232,7 +232,7 @@ public void add(ReadableSpanWithPriority readableSpanWithPriority) {
}
}

public List<SpanData> getResult() {
List<SpanData> getResult() {

if (numberOfDiscardedSpansWithMaxDiscardedRValue == 0) {
return queue.stream().map(x -> x.readableSpan.toSpanData()).collect(Collectors.toList());
Expand Down Expand Up @@ -294,7 +294,7 @@ public List<SpanData> getResult() {
return result;
}

public boolean isEmpty() {
boolean isEmpty() {
return queue.isEmpty();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private static final class State {
private final double effectiveDelegateProbability;
private final long lastNanoTime;

public State(
State(
double effectiveWindowCount,
double effectiveWindowNanos,
long lastNanoTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public CompletableResultCode shutdown() {
return CompletableResultCode.ofSuccess();
}

public void reset() {
void reset() {
this.countDownLatch = new CountDownLatch(numberOfSpansToWaitFor);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,42 @@ private static class Input {
private OptionalLong parentThreshold = OptionalLong.empty();
private OptionalLong parentRandomValue = OptionalLong.empty();

public void setParentSampled(boolean parentSampled) {
void setParentSampled(boolean parentSampled) {
this.parentSampled = parentSampled;
}

public void setParentThreshold(long parentThreshold) {
void setParentThreshold(long parentThreshold) {
assertThat(parentThreshold).isBetween(0L, 0xffffffffffffffL);
this.parentThreshold = OptionalLong.of(parentThreshold);
}

public void setParentRandomValue(long parentRandomValue) {
void setParentRandomValue(long parentRandomValue) {
assertThat(parentRandomValue).isBetween(0L, 0xffffffffffffffL);
this.parentRandomValue = OptionalLong.of(parentRandomValue);
}

public Context getParentContext() {
Context getParentContext() {
return createParentContext(
traceId, spanId, parentThreshold, parentRandomValue, parentSampled);
}

public static String getTraceId() {
static String getTraceId() {
return traceId;
}

public static String getName() {
static String getName() {
return name;
}

public static SpanKind getSpanKind() {
static SpanKind getSpanKind() {
return spanKind;
}

public static Attributes getAttributes() {
static Attributes getAttributes() {
return attributes;
}

public static List<LinkData> getParentLinks() {
static List<LinkData> getParentLinks() {
return parentLinks;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ dependencies {
api("com.google.auto.service:auto-service-annotations:1.1.1")
api("com.google.auto.value:auto-value:1.11.0")
api("com.google.auto.value:auto-value-annotations:1.11.0")
api("com.google.errorprone:error_prone_annotations:2.40.0")
api("com.google.errorprone:error_prone_core:2.40.0")
api("com.google.errorprone:error_prone_annotations:2.41.0")
api("com.google.errorprone:error_prone_core:2.41.0")
api("io.github.netmikey.logunit:logunit-jul:2.0.0")
api("io.opentelemetry.proto:opentelemetry-proto:1.7.0-alpha")
api("io.prometheus:simpleclient:0.16.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,8 @@ private static Attributes protoToAttributes(List<KeyValue> source) {
}

private static final class DataWithType {
public final Data<?> data;
public final MetricDataType type;
final Data<?> data;
final MetricDataType type;

private DataWithType(Data<?> data, MetricDataType type) {
this.data = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,27 @@ private static class PropertiesApplier {

private final ConfigProperties properties;

public PropertiesApplier(ConfigProperties properties) {
PropertiesApplier(ConfigProperties properties) {
this.properties = properties;
}

public void applyBool(String configKey, Consumer<Boolean> funcToApply) {
void applyBool(String configKey, Consumer<Boolean> funcToApply) {
applyValue(properties.getBoolean(configKey), funcToApply);
}

public void applyInt(String configKey, Consumer<Integer> funcToApply) {
void applyInt(String configKey, Consumer<Integer> funcToApply) {
applyValue(properties.getInt(configKey), funcToApply);
}

public void applyDuration(String configKey, Consumer<Duration> funcToApply) {
void applyDuration(String configKey, Consumer<Duration> funcToApply) {
applyValue(properties.getDuration(configKey), funcToApply);
}

public void applyString(String configKey, Consumer<String> funcToApply) {
void applyString(String configKey, Consumer<String> funcToApply) {
applyValue(properties.getString(configKey), funcToApply);
}

public void applyWildcards(
String configKey, Consumer<? super List<WildcardMatcher>> funcToApply) {
void applyWildcards(String configKey, Consumer<? super List<WildcardMatcher>> funcToApply) {
String wildcardListString = properties.getString(configKey);
if (wildcardListString != null && !wildcardListString.isEmpty()) {
List<WildcardMatcher> values =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ public int compareTo(StackTraceEvent o) {
}

private static class ActivationEvent {
public static final int SERIALIZED_SIZE =
static final int SERIALIZED_SIZE =
Long.SIZE / Byte.SIZE
+ // timestamp
TraceContext.SERIALIZED_LENGTH
Expand All @@ -826,7 +826,7 @@ private static class ActivationEvent {
private long threadId;
private boolean activation;

public void activation(
void activation(
Span context,
long threadId,
@Nullable Span previousContext,
Expand All @@ -835,7 +835,7 @@ public void activation(
set(context, threadId, /* activation= */ true, previousContext, nanoTime, clock);
}

public void deactivation(
void deactivation(
Span context,
long threadId,
@Nullable Span previousContext,
Expand Down Expand Up @@ -864,7 +864,7 @@ private void set(
this.timestamp = nanoTime;
}

public void handle(SamplingProfiler samplingProfiler) {
void handle(SamplingProfiler samplingProfiler) {
if (logger.isLoggable(Level.FINE)) {
logger.log(
Level.FINE,
Expand Down Expand Up @@ -975,7 +975,7 @@ private void stopProfiling(SamplingProfiler samplingProfiler) {
}
}

public void serialize(ByteBuffer buf) {
void serialize(ByteBuffer buf) {
buf.putLong(timestamp);
buf.put(traceContextBuffer);
buf.put(previousContextBuffer);
Expand All @@ -984,7 +984,7 @@ public void serialize(ByteBuffer buf) {
buf.put(activation ? (byte) 1 : (byte) 0);
}

public void deserialize(ByteBuffer buf) {
void deserialize(ByteBuffer buf) {
timestamp = buf.getLong();
buf.get(traceContextBuffer);
buf.get(previousContextBuffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ private static class StackTraceEvent {
private final List<StackFrame> trace;
private final long nanoTime;

public StackTraceEvent(List<StackFrame> trace, long nanoTime) {
StackTraceEvent(List<StackFrame> trace, long nanoTime) {

this.trace = trace;
this.nanoTime = nanoTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static <T> Iterable<T> of(Runnable callback) {

private final Runnable callback;

public PollingIterable(Runnable callback) {
PollingIterable(Runnable callback) {
this.callback = callback;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ private RecordedRequest initializeClient(ServerToAgent initialResponse) {
private static class TestEffectiveConfig extends State.EffectiveConfig {
private opamp.proto.EffectiveConfig config;

public TestEffectiveConfig(opamp.proto.EffectiveConfig initialValue) {
TestEffectiveConfig(opamp.proto.EffectiveConfig initialValue) {
config = initialValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ public CompletableFuture<HttpSender.Response> send(BodyWriter writer, int conten
return response;
}

public void enqueueResponse(HttpSender.Response response) {
void enqueueResponse(HttpSender.Response response) {
enqueueResponseFuture(CompletableFuture.completedFuture(response));
}

public void enqueueResponseFuture(CompletableFuture<HttpSender.Response> future) {
void enqueueResponseFuture(CompletableFuture<HttpSender.Response> future) {
responses.add(future);
}

public List<RequestParams> getRequests(int size) {
List<RequestParams> getRequests(int size) {
assertThat(requests).hasSize(size);
List<RequestParams> immutableRequests =
Collections.unmodifiableList(new ArrayList<>(requests));
Expand All @@ -369,7 +369,7 @@ public List<RequestParams> getRequests(int size) {
}

private static class RequestParams {
public final int contentLength;
final int contentLength;

private RequestParams(int contentLength) {
this.contentLength = contentLength;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void verifySpanFiltering() {
private static class ModifiableSpanData extends DelegatingSpanData {
private final AttributesBuilder attributes = Attributes.builder();

protected ModifiableSpanData(SpanData delegate) {
ModifiableSpanData(SpanData delegate) {
super(delegate);
}

Expand Down
Loading