Skip to content

Commit

Permalink
[FLINK-30454] Fixing visibility issue for SizeGauge.SizeSupplier;
Browse files Browse the repository at this point in the history
Also changing visibility JsonJobResultEntry.FIELD_NAME_VERSION as per JLS§6.6.1 requirements.

This closes apache#21531
  • Loading branch information
gunnarmorling authored and rmetzger committed Dec 22, 2022
1 parent 287929c commit f82be84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public Set<JobResult> getDirtyResultsInternal() throws IOException {
@VisibleForTesting
static class JsonJobResultEntry extends JobResultEntry {
private static final String FIELD_NAME_RESULT = "result";
private static final String FIELD_NAME_VERSION = "version";
static final String FIELD_NAME_VERSION = "version";

private JsonJobResultEntry(JobResultEntry entry) {
this(entry.getJobResult());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public void registerResultPartitionBytesCounter(
this.resultPartitionBytes.put(resultPartitionId, resultPartitionBytesCounter);
}

public void registerMailboxSizeSupplier(SizeGauge.SizeSupplier<Integer> supplier) {
public void registerMailboxSizeSupplier(SizeSupplier<Integer> supplier) {
this.mailboxSize.registerSupplier(supplier);
}

Expand Down Expand Up @@ -275,11 +275,6 @@ public long getCount() {
private static class SizeGauge implements Gauge<Integer> {
private SizeSupplier<Integer> supplier;

@FunctionalInterface
public interface SizeSupplier<R> {
R get();
}

public void registerSupplier(SizeSupplier<Integer> supplier) {
this.supplier = supplier;
}
Expand All @@ -293,4 +288,10 @@ public Integer getValue() {
}
}
}

/** Supplier for sizes. */
@FunctionalInterface
public interface SizeSupplier<R> {
R get();
}
}

0 comments on commit f82be84

Please sign in to comment.