Skip to content

Commit a7cc794

Browse files
committed
PR feedback
1 parent aa206d7 commit a7cc794

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/main/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class PerLevelDataLoaderDispatchStrategy implements DataLoaderDispatchStr
4848

4949
static final long DEFAULT_BATCH_WINDOW_NANO_SECONDS_DEFAULT = 500_000L;
5050

51-
private final Map<DeferredCallContext, CallStack> callStackMap = new ConcurrentHashMap<>();
51+
private final Map<DeferredCallContext, CallStack> deferredCallStackMap = new ConcurrentHashMap<>();
5252

5353

5454
private static class CallStack {
@@ -75,7 +75,7 @@ private static class CallStack {
7575
* { a {x} b {y} }
7676
* If a is a list of 3 objects and b is a list of 2 objects we expect 3 + 2 = 5 execute object calls on the level 1 to be happening
7777
* <p/>
78-
* An execute objects again means we can predict the number of fetches in the next level:
78+
* An executed object call again means we can predict the number of fetches in the next level:
7979
* Execute Object a with { a {f1 f2 f3} } means we expect 3 fetches on level 2.
8080
* <p/>
8181
* This means we know a level is ready to be dispatched if:
@@ -257,7 +257,7 @@ private CallStack getCallStack(@Nullable DeferredCallContext deferredCallContext
257257
if (deferredCallContext == null) {
258258
return this.initialCallStack;
259259
} else {
260-
return callStackMap.computeIfAbsent(deferredCallContext, k -> {
260+
return deferredCallStackMap.computeIfAbsent(deferredCallContext, k -> {
261261
CallStack callStack = new CallStack();
262262
int startLevel = deferredCallContext.getStartLevel();
263263
int fields = deferredCallContext.getFields();

src/test/groovy/graphql/execution/instrumentation/dataloader/BatchCompareDataFetchers.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ private static List<List<Department>> getDepartmentsForShops(List<Shop> shops) {
8383

8484

8585
private BatchLoader<String, List<Department>> departmentsForShopsBatchLoader = ids -> maybeAsyncWithSleep(() -> {
86-
System.out.println("departments for shops batch loader called with ids: " + ids);
8786
departmentsForShopsBatchLoaderCounter.incrementAndGet();
8887
List<Shop> shopList = new ArrayList<>();
8988
for (String id : ids) {
@@ -129,7 +128,6 @@ private static List<List<Product>> getProductsForDepartments(List<Department> de
129128
}
130129

131130
private BatchLoader<String, List<Product>> productsForDepartmentsBatchLoader = ids -> maybeAsyncWithSleep(() -> {
132-
System.out.println("products for deparments batch loader called with ids: " + ids);
133131
productsForDepartmentsBatchLoaderCounter.incrementAndGet();
134132
List<Department> d = ids.stream().map(departments::get).collect(Collectors.toList());
135133
return completedFuture(getProductsForDepartments(d));

0 commit comments

Comments
 (0)