summaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2020-11-23 13:00:21 +0100
committerJon Bratseth <bratseth@gmail.com>2020-11-23 13:00:21 +0100
commit39ace8234b7e5a478e7d13515e223eb77d66ff89 (patch)
tree56fcbadfc105d735b530c4dfb4aa5c1567969873 /vespajlib
parentbc4f71df61c249ed091df5d519d1b37b19b9dc10 (diff)
Non-functional changes only
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/main/java/com/yahoo/concurrent/ThreadLocalDirectory.java46
1 files changed, 20 insertions, 26 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/concurrent/ThreadLocalDirectory.java b/vespajlib/src/main/java/com/yahoo/concurrent/ThreadLocalDirectory.java
index d5235caef9f..5ab1c88775a 100644
--- a/vespajlib/src/main/java/com/yahoo/concurrent/ThreadLocalDirectory.java
+++ b/vespajlib/src/main/java/com/yahoo/concurrent/ThreadLocalDirectory.java
@@ -62,14 +62,13 @@ import java.util.List;
* example.
* </p>
*
- * @param AGGREGATOR
- * the type input data is aggregated into
- * @param SAMPLE
- * the type of input data
+ * @param <AGGREGATOR> the type input data is aggregated into
+ * @param <SAMPLE> the type of input data
*
- * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
+ * @author Steinar Knutsen
*/
public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
+
/**
* Factory interface to create the data container for each generation of
* samples, and putting data into it.
@@ -85,12 +84,11 @@ public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
* need to implement both.
* </p>
*
- * @param AGGREGATOR
- * The type of the data container to produce
- * @param SAMPLE
- * The type of the incoming data to store in the container.
+ * @param <AGGREGATOR> the type of the data container to produce
+ * @param <SAMPLE> the type of the incoming data to store in the container.
*/
public interface Updater<AGGREGATOR, SAMPLE> {
+
/**
* Create data container to receive produced data. This is invoked once
* on every instance every time ThreadLocalDirectory.fetch() is invoked.
@@ -137,7 +135,7 @@ public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
*
* @return a fresh structure to receive data
*/
- public AGGREGATOR createGenerationInstance(AGGREGATOR previous);
+ AGGREGATOR createGenerationInstance(AGGREGATOR previous);
/**
* Insert a data element of type S into the current generation of data
@@ -180,7 +178,8 @@ public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
* the data to insert
* @return the new current value, may be the same as previous
*/
- public AGGREGATOR update(AGGREGATOR current, SAMPLE x);
+ AGGREGATOR update(AGGREGATOR current, SAMPLE x);
+
}
/**
@@ -188,14 +187,12 @@ public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
* ThreadLocalDirectory without resetting the local instances in each
* thread.
*
- * @param <AGGREGATOR>
- * as for {@link Updater}
- * @param <SAMPLE>
- * as for {@link Updater}
+ * @param <AGGREGATOR> as for {@link Updater}
+ * @param <SAMPLE> as for {@link Updater}
* @see ThreadLocalDirectory#view()
*/
- public interface ObservableUpdater<AGGREGATOR, SAMPLE> extends
- Updater<AGGREGATOR, SAMPLE> {
+ public interface ObservableUpdater<AGGREGATOR, SAMPLE> extends Updater<AGGREGATOR, SAMPLE> {
+
/**
* Create an application specific copy of the AGGREGATOR for a thread.
*
@@ -203,7 +200,8 @@ public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
* the AGGREGATOR instance to copy
* @return a copy of the incoming parameter
*/
- public AGGREGATOR copy(AGGREGATOR current);
+ AGGREGATOR copy(AGGREGATOR current);
+
}
private final ThreadLocal<LocalInstance<AGGREGATOR, SAMPLE>> local = new ThreadLocal<>();
@@ -268,8 +266,7 @@ public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
* to have been instantiated with an updater implementing ObservableUpdater.
*
* @return a list of a copy of the current data in all producer threads
- * @throws IllegalStateException
- * if the updater does not implement {@link ObservableUpdater}
+ * @throws IllegalStateException if the updater does not implement {@link ObservableUpdater}
*/
public List<AGGREGATOR> view() {
if (observableUpdater == null) {
@@ -310,8 +307,7 @@ public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
/**
* Input data from a producer thread.
*
- * @param x
- * the data to insert
+ * @param x the data to insert
*/
public void update(SAMPLE x) {
update(x, getOrCreateLocal());
@@ -330,10 +326,8 @@ public final class ThreadLocalDirectory<AGGREGATOR, SAMPLE> {
* calls necessary to update(SAMPLE, LocalInstance&lt;AGGREGATOR, SAMPLE&gt;).
* </p>
*
- * @param x
- * the data to insert
- * @param localInstance
- * the local data insertion instance
+ * @param x the data to insert
+ * @param localInstance the local data insertion instance
*/
public void update(SAMPLE x, LocalInstance<AGGREGATOR, SAMPLE> localInstance) {
boolean isRegistered;