Package org.ojalgo.data.batch
Class BatchManager
- java.lang.Object
-
- org.ojalgo.data.batch.BatchManager
-
public final class BatchManager extends java.lang.Object
When you're going to instantiate multipleBatchNode
:s and you want them to share some properties, this is a convenient alternative. Just create aBatchManager
, configure it, and use it to create theBatchNode.Builder
:s usingnewNodeBuilder(String, DataInterpreter)
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
myBatchRootDirectory
private java.util.concurrent.ExecutorService
myExecutor
private java.lang.Integer
myFragmentation
private java.util.function.IntSupplier
myParallelism
private java.lang.Integer
myQueueCapacity
-
Constructor Summary
Constructors Constructor Description BatchManager(java.io.File batchRootDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Dispose of all files associated with nodes instantiated from this manager.BatchManager
executor(java.util.concurrent.ExecutorService executor)
BatchManager
fragmentation(int fragmentation)
<T> BatchNode.Builder<T>
newNodeBuilder(java.lang.String nodeName, DataInterpreter<T> dataInterpreter)
BatchManager
parallelism(int parallelism)
BatchManager
parallelism(java.util.function.IntSupplier parallelism)
BatchManager
queue(int capacity)
-
-
-
Field Detail
-
myBatchRootDirectory
private final java.io.File myBatchRootDirectory
-
myExecutor
private java.util.concurrent.ExecutorService myExecutor
-
myFragmentation
private java.lang.Integer myFragmentation
-
myParallelism
private java.util.function.IntSupplier myParallelism
-
myQueueCapacity
private java.lang.Integer myQueueCapacity
-
-
Method Detail
-
dispose
public void dispose()
Dispose of all files associated with nodes instantiated from this manager. It's recommended that you callBatchNode.dispose()
on the individual nodes as you're done with them. This is just a convenient alternative to dispose of multiple (all) nodes simultaneously.- See Also:
BatchNode.dispose()
-
executor
public BatchManager executor(java.util.concurrent.ExecutorService executor)
-
fragmentation
public BatchManager fragmentation(int fragmentation)
- See Also:
BatchNode.Builder.fragmentation(int)
-
newNodeBuilder
public <T> BatchNode.Builder<T> newNodeBuilder(java.lang.String nodeName, DataInterpreter<T> dataInterpreter)
-
parallelism
public BatchManager parallelism(int parallelism)
- See Also:
BatchNode.Builder.parallelism(int)
-
parallelism
public BatchManager parallelism(java.util.function.IntSupplier parallelism)
-
queue
public BatchManager queue(int capacity)
- See Also:
BatchNode.Builder.queue(int)
-
-