- java.lang.Object
-
- org.ojalgo.netio.QueuedWriter<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ToFileWriter<T>
final class QueuedWriter<T> extends java.lang.Object implements ToFileWriter<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classQueuedWriter.Worker<T>-
Nested classes/interfaces inherited from interface org.ojalgo.netio.ToFileWriter
ToFileWriter.Builder<F>
-
-
Field Summary
Fields Modifier and Type Field Description private booleanmyActiveprivate intmyBatchSizeprivate java.util.concurrent.Future<?>[]myFuturesprivate java.util.concurrent.BlockingQueue<T>myQueueprivate ToFileWriter<T>[]myWriters-
Fields inherited from interface org.ojalgo.netio.ToFileWriter
NULL
-
-
Constructor Summary
Constructors Constructor Description QueuedWriter(java.util.concurrent.ExecutorService executor, java.util.concurrent.BlockingQueue<T> queue, ToFileWriter<T>... writers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()(package private) intdrainTo(java.util.List<T> batchContainer)(package private) booleanisMoreToCome()(package private) java.util.List<T>newBatchContainer()voidwrite(T item)Write the item to the consumer.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.netio.ToFileWriter
writeBatch
-
-
-
-
Field Detail
-
myActive
private volatile boolean myActive
-
myBatchSize
private final int myBatchSize
-
myWriters
private final ToFileWriter<T>[] myWriters
-
myFutures
private final java.util.concurrent.Future<?>[] myFutures
-
myQueue
private final java.util.concurrent.BlockingQueue<T> myQueue
-
-
Constructor Detail
-
QueuedWriter
QueuedWriter(java.util.concurrent.ExecutorService executor, java.util.concurrent.BlockingQueue<T> queue, ToFileWriter<T>... writers)
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceToFileWriter<T>- Throws:
java.io.IOException
-
write
public void write(T item)
Description copied from interface:ToFileWriterWrite the item to the consumer.- Specified by:
writein interfaceToFileWriter<T>- Parameters:
item- The item to be written
-
drainTo
int drainTo(java.util.List<T> batchContainer)
-
isMoreToCome
boolean isMoreToCome()
-
newBatchContainer
java.util.List<T> newBatchContainer()
-
-