Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of Java 8 to simplify computeLeaseCounts() #847

Conversation

rtyley
Copy link
Contributor

@rtyley rtyley commented Aug 6, 2021

It's possible to remove quite a few lines of code from the method using Java 8 features (groupingBy Collector, etc).

Java 8 is the minimum supported version of the KCL since PR #176 was merged in July 2017.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

It's possible to remove quite a few lines of code from the
method using Java 8 features (a `groupingBy` Collector, etc).

Java 8 is the minimum supported version of the KCL since
awslabs#176 was
merged in July 2017.

See also:

https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html#package.description
http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html
@rtyley rtyley changed the title Make use of Java 8 to simplify computeLeaseCounts() Make use of Java 8 to simplify computeLeaseCounts() Aug 7, 2021
Copy link
Contributor

@joshua-kim joshua-kim left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the invent-and-simplify.

@joshua-kim joshua-kim merged commit e638c17 into awslabs:master Oct 4, 2021
@rtyley
Copy link
Contributor Author

rtyley commented Oct 4, 2021

Many thanks @joshua-kim! I also have a couple of other open PRs, if you have time to review them:

@rtyley rtyley deleted the make-use-of-java-8-to-simplify-computeLeaseCounts branch October 4, 2021 13:41
@joshua-kim
Copy link
Contributor

joshua-kim commented Oct 4, 2021

I reviewed the smaller of the two; #848 which aims to optimize lease convergence time sounds promising but is a change to a rather critical part of KCL. Don't have an ETA of when I'll be able to look into/test it currently.

@rtyley
Copy link
Contributor Author

rtyley commented Oct 4, 2021

Sure- thanks for taking a quick look anyway, and of course for merging the logging fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants