Skip to content

Commit 97c6def

Browse files
committed
Javadoc p fix ups
1 parent 0e2ada8 commit 97c6def

File tree

6 files changed

+25
-27
lines changed

6 files changed

+25
-27
lines changed

src/main/java/org/dataloader/BatchLoader.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,19 @@
1616

1717
package org.dataloader;
1818

19-
import java.util.Collections;
2019
import java.util.List;
21-
import java.util.concurrent.CompletableFuture;
2220
import java.util.concurrent.CompletionStage;
2321

2422
/**
2523
* A function that is invoked for batch loading a list of data values indicated by the provided list of keys. The
2624
* function returns a promise of a list of results of individual load requests.
27-
*
25+
* <p>
2826
* There are a few constraints that must be upheld:
2927
* <ul>
3028
* <li>The list of values must be the same size as the list of keys.</li>
3129
* <li>Each index in the list of values must correspond to the same index in the list of keys.</li>
3230
* </ul>
33-
*
31+
* <p>
3432
* For example, if your batch function was provided the list of keys:
3533
*
3634
* <pre>
@@ -50,10 +48,10 @@
5048
* </pre>
5149
*
5250
* then the batch loader function contract has been broken.
53-
*
51+
* <p>
5452
* The back-end service returned results in a different order than we requested, likely because it was more efficient for it to
5553
* do so. Also, it omitted a result for key 6, which we may interpret as no value existing for that key.
56-
*
54+
* <p>
5755
* To uphold the constraints of the batch function, it must return an List of values the same length as
5856
* the List of keys, and re-order them to ensure each index aligns with the original keys [ 2, 9, 6, 1 ]:
5957
*
@@ -77,7 +75,7 @@ public interface BatchLoader<K, V> {
7775

7876
/**
7977
* Called to batch load the provided keys and return a promise to a list of values.
80-
*
78+
* <p>
8179
* If you need calling context then implement {@link org.dataloader.BatchLoaderWithContext}
8280
*
8381
* @param keys the collection of keys to load

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadF
9595
* Creates new DataLoader with the specified batch loader function and default options
9696
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
9797
* {@link org.dataloader.Try} objects.
98-
*
98+
* <p>
9999
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
100100
* you can use this form to create the data loader.
101-
*
101+
* <p>
102102
* Using Try objects allows you to capture a value returned or an exception that might
103103
* have occurred trying to get a value. .
104104
*
@@ -163,10 +163,10 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoaderWithContext<K, V>
163163
* Creates new DataLoader with the specified batch loader function and default options
164164
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
165165
* {@link org.dataloader.Try} objects.
166-
*
166+
* <p>
167167
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
168168
* you can use this form to create the data loader.
169-
*
169+
* <p>
170170
* Using Try objects allows you to capture a value returned or an exception that might
171171
* have occurred trying to get a value. .
172172
*
@@ -230,13 +230,13 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoader<K, V
230230
* Creates new DataLoader with the specified batch loader function and default options
231231
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
232232
* {@link org.dataloader.Try} objects.
233-
*
233+
* <p>
234234
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
235235
* you can use this form to create the data loader.
236236
*
237237
* Using Try objects allows you to capture a value returned or an exception that might
238238
* have occurred trying to get a value. .
239-
*
239+
* <p>
240240
* @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
241241
* @param <K> the key type
242242
* @param <V> the value type
@@ -298,10 +298,10 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoaderWithC
298298
* Creates new DataLoader with the specified batch loader function and default options
299299
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
300300
* {@link org.dataloader.Try} objects.
301-
*
301+
* <p>
302302
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
303303
* you can use this form to create the data loader.
304-
*
304+
* <p>
305305
* Using Try objects allows you to capture a value returned or an exception that might
306306
* have occurred trying to get a value. .
307307
*

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* A function that is invoked for batch loading a map of of data values indicated by the provided list of keys. The
2525
* function returns a promise of a map of results of individual load requests.
26-
*
26+
* <p>
2727
* There are a few constraints that must be upheld:
2828
* <ul>
2929
* <li>The keys MUST be able to be first class keys in a Java map. Get your equals() and hashCode() methods in order</li>
@@ -32,25 +32,25 @@
3232
* </li>
3333
* <li>The function MUST be resilient to the same key being presented twice.</li>
3434
* </ul>
35-
*
35+
* <p>
3636
* This form is useful when you don't have a 1:1 mapping of keys to values or when null is an acceptable value for a missing value.
37-
*
37+
* <p>
3838
* For example, let's assume you want to load users from a database, you could probably use a query that looks like this:
3939
*
4040
* <pre>
4141
* SELECT * FROM User WHERE id IN (keys)
4242
* </pre>
43-
*
43+
* <p>
4444
* Given say 10 user id keys you might only get 7 results back. This can be more naturally represented in a map
4545
* than in an ordered list of values from the batch loader function.
46-
*
46+
* <p>
4747
* When the map is processed by the {@link org.dataloader.DataLoader} code, any keys that are missing in the map
4848
* will be replaced with null values. The semantic that the number of {@link org.dataloader.DataLoader#load(Object)} requests
4949
* are matched with and equal number of values is kept.
50-
*
50+
* <p>
5151
* 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.
53-
*
53+
* <p>
5454
* 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
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This form of {@link MappedBatchLoader} is given a {@link org.dataloader.BatchLoaderEnvironment} object
2525
* that encapsulates the calling context. A typical use case is passing in security credentials or database details
2626
* for example.
27-
*
27+
* <p>
2828
* See {@link MappedBatchLoader} for more details on the design invariants that you must implement in order to
2929
* use this interface.
3030
*/

src/main/java/org/dataloader/impl/PromisedValues.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
* This allows multiple {@link CompletionStage}s to be combined together and completed
1414
* as one and should something go wrong, instead of throwing {@link CompletionException}s it captures the cause and returns null for that
1515
* data value, other wise it allows you to access them as a list of values.
16-
*
16+
* <p>
1717
* This class really encapsulate a list of promised values. It is considered finished when all of the underlying futures
1818
* are finished.
19-
*
19+
* <p>
2020
* You can get that list of values via {@link #toList()}. You can also compose a {@link CompletableFuture} of that
2121
* list of values via {@link #toCompletableFuture()} ()}
2222
*

src/main/java/org/dataloader/stats/ThreadLocalStatisticsCollector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
/**
44
* This can collect statistics per thread as well as in an overall sense. This allows you to snapshot stats for a web request say
55
* as well as all requests.
6-
*
6+
* <p>
77
* You will want to call {@link #resetThread()} to clean up the thread local aspects of this object per request thread.
8-
*
8+
* <p>
99
* ThreadLocals have their place in the Java world but be careful on how you use them. If you don't clean them up on "request boundaries"
1010
* then you WILL have misleading statistics.
1111
*

0 commit comments

Comments
 (0)