-
Notifications
You must be signed in to change notification settings - Fork 874
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
JDK Downloader: fix current GA/EA values #6590
JDK Downloader: fix current GA/EA values #6590
Conversation
I'm fairly sure it did at one point, which actually makes some sense - an LTS is still STS on the way! There's also |
no there is not, there is |
No, I know, I swear I was just looking at code with that method in, but certainly can't find it now. 🤷 Having a look at an alternative idea. Our library is an old release too. |
testing with latest lib in a maven project, update wouldn't change anything. But we should update anyway at some point. import io.foojay.api.discoclient.DiscoClient;
import java.util.function.Supplier;
public class Disco {
public static void main(String[] args) {
DiscoClient client = new DiscoClient();
System.out.println(measure(() -> client.getLatestLts(false)));
System.out.println(measure(() -> client.getLatestSts(false)));
System.out.println(measure(() -> client.getAllMajorVersions(false)));
System.out.println(measure(() -> client.getAllMajorVersions(true)));
}
private static <R> R measure(Supplier<R> s) {
long delta = System.currentTimeMillis();
R r = s.get();
System.out.println("delta: "+ (System.currentTimeMillis()-delta)/1000.0f);
return r;
}
} |
this works and is just one call: Queue<MajorVersion> versions = client.getAllMajorVersions(true);
int latestEA = versions.stream().filter(Predicate.not(MajorVersion::isEarlyAccessOnly)).findFirst().get().getAsInt();
int latestGA = versions.stream().filter(MajorVersion::isEarlyAccessOnly).findFirst().get().getAsInt();
System.out.println("latest EA: "+latestEA);
System.out.println("latest GA: "+latestGA); will update this PR most likely |
Came to similar conclusion. master...neilcsmith-net:netbeans:disco-nb20rc Not sure why that method returns a Not the first time we've had issues with the EA filter being wrong. EDIT : could also rewrite the cache in there to include the EA and filter that. master...neilcsmith-net:netbeans:disco-nb20rc2 |
86f8646
to
2582b09
Compare
rewrote the getters to use a cached major version list to avoid api calls. the panel should now display the main content with two api calls. |
Looks good! Even with using the |
use better caching to avoid per-call latency overhead
2582b09
to
e75a765
Compare
removed redundant The panel loads now in 3-4s, which isn't so bad. |
getLatestSts
does not include LTS (obviously :)), which means the downloader thought the latest JDK was still 20 and 21 was still in EA.(trying to find a more efficient way of running this query before RC2, since this doubles the latency)
targets delivery
before:

after:
