MINOR: Replace lambda expressions with method references in ProducerStateManager (#18753)

Reviewers: TengYao Chi <kitingiao@gmail.com>, Divij Vaidya <diviv@amazon.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Logan Zhu 2025-02-03 10:16:22 +08:00 committed by GitHub
parent 78aff4fede
commit 04ea25b3c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -567,15 +567,15 @@ public class ProducerStateManager {
}
public Optional<File> fetchSnapshot(long offset) {
return Optional.ofNullable(snapshots.get(offset)).map(x -> x.file());
return Optional.ofNullable(snapshots.get(offset)).map(SnapshotFile::file);
}
private Optional<SnapshotFile> oldestSnapshotFile() {
return Optional.ofNullable(snapshots.firstEntry()).map(x -> x.getValue());
return Optional.ofNullable(snapshots.firstEntry()).map(Map.Entry::getValue);
}
private Optional<SnapshotFile> latestSnapshotFile() {
return Optional.ofNullable(snapshots.lastEntry()).map(e -> e.getValue());
return Optional.ofNullable(snapshots.lastEntry()).map(Map.Entry::getValue);
}
/**