Skip to content

Releases: graphql-java/java-dataloader

4.0.0

07 Apr 01:32
5865f0e
Compare
Choose a tag to compare

Instrumentation support of DataLoaders

A new org.dataloader.instrumentation.DataLoaderInstrumentation has been added that is a callback to allow you to know when certain DataLoader actions start and when they finish.

        DataLoaderInstrumentation timingInstrumentation = new DataLoaderInstrumentation() {
            @Override
            public DataLoaderInstrumentationContext<DispatchResult<?>> beginDispatch(DataLoader<?, ?> dataLoader) {
                long then = System.currentTimeMillis();
                return DataLoaderInstrumentationHelper.whenCompleted((result, err) -> {
                    long ms = System.currentTimeMillis() - then;
                    System.out.println(format("dispatch time: %d ms", ms));
                });
            }

            @Override
            public DataLoaderInstrumentationContext<List<?>> beginBatchLoader(DataLoader<?, ?> dataLoader, List<?> keys, BatchLoaderEnvironment environment) {
                long then = System.currentTimeMillis();
                return DataLoaderInstrumentationHelper.whenCompleted((result, err) -> {
                    long ms = System.currentTimeMillis() - then;
                    System.out.println(format("batch loader time: %d ms", ms));
                });
            }
        };
        DataLoaderOptions options = DataLoaderOptions.newOptions().setInstrumentation(timingInstrumentation);
        DataLoader<String, User> userDataLoader = DataLoaderFactory.newDataLoader(userBatchLoader, options);

Immutable classes

Some of the key classes like org.dataloader.DataLoaderOptions have been made immutable so as to provide more surety in how they get used and transformed. This is technically a breaking change if you code relied on the old mutability, however on balance we think this is a better code position to be in.

What's Changed

New Contributors

Full Changelog: v3.4.0...v4.0.0

v3.4.0

16 Dec 23:54
1c19b6b
Compare
Choose a tag to compare

Thanks to everybody who contributed to this release of Dataloader!

With this release, this library changed from using Java 8 to Java 11.

What's Changed

New Contributors

Full Changelog: v3.3.0...v3.4.0

3.3.0

14 Apr 22:31
bd101a2
Compare
Choose a tag to compare

What's Changed

  • Pre-size resulting lists by @dfa1 in #142
  • Minor javadoc fixes by @dfa1 in #141
  • Shuts down executor if its was auto added by our code by @bbakerman in #144
  • If there is a specific predicate for a dataloader - its is the final say on whether to dispatch by @bbakerman in #145

Full Changelog: v3.2.2...v3.3.0

3.2.2

14 Nov 04:47
415ff76
Compare
Choose a tag to compare

What's Changed

A series of small fixes to make the code more efficient

  • Lazily initialize Executor in ScheduledDataLoaderRegistry builder by @kilink in #135
  • Avoid allocations in DataLoaderHelper.dispatch when there's no work by @kilink in #136

New Contributors

Full Changelog: v3.2.1...v3.2.2

3.2.1

17 Oct 04:44
5f8ec4a
Compare
Choose a tag to compare

New ticker mode

There is a new mode in ScheduledDataLoaderRegistry called ticker mode that will continue to tick away and allow for chained data loader calls. See the readme for more details.

  ScheduledDataLoaderRegistry registry = ScheduledDataLoaderRegistry.newScheduledRegistry()
        .register("a", dataLoaderA)
        .register("b", dataLoaderB)
        .scheduledExecutorService(executorService)
        .schedule(Duration.ofMillis(10))
        .tickerMode(true) // ticker mode is on
        .build();

  CompletableFuture<Object> chainedCalls = dataLoaderA.load("user1")
        .thenCompose(userAsKey -> dataLoaderB.load(userAsKey));

Predicates per dataloader in ScheduledDataLoaderRegistry

ScheduledDataLoaderRegistry now has the capability to have a predicate per data loader specified as well as an overall one. This allows you to have fine control on when dataloaders get dispatched.

What's Changed

  • Try.getThrowable - fixed incorrect exception message by @rstata in #122
  • Prepend 0.0.0 to build version by @dondonz in #126
  • Batch scheduler function support by @bbakerman in #128
  • Adds a predicate to DataLoaderRegistry and a per dataloader map of pedicates is also possible by @bbakerman in #133
  • Ticker mode on ScheduledDataLoaderRegistry by @bbakerman in #131

New Contributors

Full Changelog: v3.2.0...v3.2.1

3.2.0

18 Jul 05:56
59b26b8
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.1.4...v3.2.0

3.1.4

08 Jun 12:26
d42e37e
Compare
Choose a tag to compare

What's Changed

  • Changed Automatic Module Name to org.dataloader by @zrbrown in #118

New Contributors

Full Changelog: v3.1.3...v3.1.4

3.1.3

26 May 00:21
fa94732
Compare
Choose a tag to compare

What's Changed

  • Configure Manifest task to create valid OSGi bundle by @Lana11s in #113
  • Make NoOpStatisticsCollector to be default StatisticsCollector by @dugenkui03 in #112
  • feat: make cache map values accesible for read only purposes by @samuelAndalon in #115

New Contributors

Full Changelog: v3.1.2...vv3.1.3

3.1.2

15 Feb 04:28
388c4fd
Compare
Choose a tag to compare

This fix release prevents excessive object allocation in the no-op ValueCache

3.1.1

30 Oct 22:00
4253050
Compare
Choose a tag to compare

Small bugs fixes and the ability to prime the cache