Skip to content

Commit 0e2ada8

Browse files
committed
Spilling misteaks and gradma changes in doco
1 parent 8349cbd commit 0e2ada8

File tree

6 files changed

+31
-23
lines changed

6 files changed

+31
-23
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ For example, let's assume you want to load users from a database, you could prob
204204
```
205205

206206
Given say 10 user id keys you might only get 7 results back. This can be more naturally represented in a map
207-
than in an order list of values when returning values from the batch loader function.
207+
than in an ordered list of values from the batch loader function.
208208

209209
You can use `org.dataloader.MappedBatchLoader` for this purpose.
210210

211211
When the map is processed by the `DataLoader` code, any keys that are missing in the map
212-
will be replaced with null values. The semantics that the number of `DataLoader.load` requests
213-
are matched with values is kept.
212+
will be replaced with null values. The semantic that the number of `DataLoader.load` requests
213+
are matched with an equal number of values is kept.
214214

215-
Your keys provided MUST be first class keys since they will be used to examine the returned map and
215+
The keys provided MUST be first class keys since they will be used to examine the returned map and
216216
create the list of results, with nulls filling in for missing values.
217217

218218
```java

src/main/java/org/dataloader/BatchLoaderEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* This object is passed to a batch loader as calling context. It could contain security credentials
5-
* of the calling users say or database connection parameters that allow the data layer call to succeed.
5+
* of the calling users for example or database parameters that allow the data layer call to succeed.
66
*/
77
public class BatchLoaderEnvironment {
88

src/main/java/org/dataloader/BatchLoaderWithContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface BatchLoaderWithContext<K, V> {
1515
/**
1616
* Called to batch load the provided keys and return a promise to a list of values. This default
1717
* version can be given an environment object to that maybe be useful during the call. A typical use case
18-
* is passing in security credentials or database connection details say.
18+
* is passing in security credentials or database details for example.
1919
*
2020
* @param keys the collection of keys to load
2121
* @param environment an environment object that can help with the call

src/main/java/org/dataloader/DataLoader.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
*/
5858
public class DataLoader<K, V> {
5959

60-
private final DataLoaderHelper<K,V> helper;
60+
private final DataLoaderHelper<K, V> helper;
6161
private final DataLoaderOptions loaderOptions;
6262
private final CacheMap<Object, CompletableFuture<V>> futureCache;
6363
private final List<SimpleImmutableEntry<K, CompletableFuture<V>>> loaderQueue;
@@ -96,10 +96,12 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadF
9696
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
9797
* {@link org.dataloader.Try} objects.
9898
*
99-
* This allows you to capture both the value that might be returned and also whether exception that might have occurred getting that individual value. If its important you to
100-
* know the exact status of each item in a batch call and whether it threw exceptions when fetched then
99+
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
101100
* you can use this form to create the data loader.
102101
*
102+
* Using Try objects allows you to capture a value returned or an exception that might
103+
* have occurred trying to get a value. .
104+
*
103105
* @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
104106
* @param <K> the key type
105107
* @param <V> the value type
@@ -162,10 +164,12 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoaderWithContext<K, V>
162164
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
163165
* {@link org.dataloader.Try} objects.
164166
*
165-
* This allows you to capture both the value that might be returned and also whether exception that might have occurred getting that individual value. If its important you to
166-
* know the exact status of each item in a batch call and whether it threw exceptions when fetched then
167+
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
167168
* you can use this form to create the data loader.
168169
*
170+
* Using Try objects allows you to capture a value returned or an exception that might
171+
* have occurred trying to get a value. .
172+
*
169173
* @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
170174
* @param <K> the key type
171175
* @param <V> the value type
@@ -227,10 +231,12 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoader<K, V
227231
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
228232
* {@link org.dataloader.Try} objects.
229233
*
230-
* This allows you to capture both the value that might be returned and also whether exception that might have occurred getting that individual value. If its important you to
231-
* know the exact status of each item in a batch call and whether it threw exceptions when fetched then
234+
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
232235
* you can use this form to create the data loader.
233236
*
237+
* Using Try objects allows you to capture a value returned or an exception that might
238+
* have occurred trying to get a value. .
239+
*
234240
* @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
235241
* @param <K> the key type
236242
* @param <V> the value type
@@ -293,10 +299,12 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoaderWithC
293299
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
294300
* {@link org.dataloader.Try} objects.
295301
*
296-
* This allows you to capture both the value that might be returned and also whether exception that might have occurred getting that individual value. If its important you to
297-
* know the exact status of each item in a batch call and whether it threw exceptions when fetched then
302+
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
298303
* you can use this form to create the data loader.
299304
*
305+
* Using Try objects allows you to capture a value returned or an exception that might
306+
* have occurred trying to get a value. .
307+
*
300308
* @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
301309
* @param <K> the key type
302310
* @param <V> the value type
@@ -352,7 +360,7 @@ private DataLoader(Object batchLoadFunction, DataLoaderOptions options) {
352360
this.loaderQueue = new ArrayList<>();
353361
this.stats = nonNull(this.loaderOptions.getStatisticsCollector());
354362

355-
this.helper = new DataLoaderHelper<>(this, batchLoadFunction,this.loaderOptions, futureCache, loaderQueue, stats);
363+
this.helper = new DataLoaderHelper<>(this, batchLoadFunction, this.loaderOptions, futureCache, loaderQueue, stats);
356364
}
357365

358366
@SuppressWarnings("unchecked")

src/main/java/org/dataloader/MappedBatchLoader.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@
4242
* </pre>
4343
*
4444
* Given say 10 user id keys you might only get 7 results back. This can be more naturally represented in a map
45-
* than in an order list of values when returning values from the batch loader function.
45+
* than in an ordered list of values from the batch loader function.
4646
*
4747
* When the map is processed by the {@link org.dataloader.DataLoader} code, any keys that are missing in the map
48-
* will be replaced with null values. The semantics that the number of {@link org.dataloader.DataLoader#load(Object)} requests
49-
* are matched with values is kept.
48+
* will be replaced with null values. The semantic that the number of {@link org.dataloader.DataLoader#load(Object)} requests
49+
* are matched with and equal number of values is kept.
5050
*
51-
* This means that if 10 keys are asked for then {@link DataLoader#dispatch()} will return a promise 10 value results and each
51+
* This means that if 10 keys are asked for then {@link DataLoader#dispatch()} will return a promise of 10 value results and each
5252
* of the {@link org.dataloader.DataLoader#load(Object)} will complete with a value, null or an exception.
5353
*
54-
* When caching is disabled, its possible for the same key to be presented in the list of keys more than once. You map
54+
* When caching is disabled, its possible for the same key to be presented in the list of keys more than once. Your map
5555
* batch loader function needs to be resilient to this situation.
5656
*
5757
* @param <K> type parameter indicating the type of keys to use for data load requests.

src/main/java/org/dataloader/MappedBatchLoaderWithContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
/**
2424
* This form of {@link MappedBatchLoader} is given a {@link org.dataloader.BatchLoaderEnvironment} object
25-
* that encapsulates the calling context. A typical use case is passing in security credentials or database connection details
26-
* say.
25+
* that encapsulates the calling context. A typical use case is passing in security credentials or database details
26+
* for example.
2727
*
2828
* See {@link MappedBatchLoader} for more details on the design invariants that you must implement in order to
2929
* use this interface.

0 commit comments

Comments
 (0)