-
- All Superinterfaces:
com.github.akurilov.commons.concurrent.AsyncRunnable,java.lang.AutoCloseable,java.util.function.Consumer<O>,Daemon,com.github.akurilov.commons.io.Output<O>,java.rmi.Remote
- All Known Implementing Classes:
DummyStorageDriverMock,StorageDriverBase
public interface StorageDriver<I extends Item,O extends Operation<I>> extends Daemon, com.github.akurilov.commons.io.Output<O>
Created on 11.07.16.
-
-
Field Summary
Fields Modifier and Type Field Description static intBUFF_SIZE_MAXstatic intBUFF_SIZE_MIN
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description intactiveOpCount()voidadjustIoBuffers(long avgTransferSize, OpType opType)voidclose()longcompletedOpCount()intconcurrencyLimit()static <I extends Item,O extends Operation<I>,T extends StorageDriver<I,O>>
Tinstance(java.util.List<Extension> extensions, com.github.akurilov.confuse.Config storageConfig, DataInput dataInput, boolean verifyFlag, int batchSize, java.lang.String stepId)booleanisIdle()java.util.List<I>list(ItemFactory<I> itemFactory, java.lang.String path, java.lang.String prefix, int idRadix, I lastPrevItem, int count)voidoperationResultOutput(com.github.akurilov.commons.io.Output<O> opResultOut)intput(java.util.List<O> ops)intput(java.util.List<O> ops, int from, int to)booleanput(O op)longscheduledOpCount()com.github.akurilov.commons.concurrent.AsyncRunnablestop()
-
-
-
Field Detail
-
BUFF_SIZE_MIN
static final int BUFF_SIZE_MIN
- See Also:
- Constant Field Values
-
BUFF_SIZE_MAX
static final int BUFF_SIZE_MAX
- See Also:
- Constant Field Values
-
-
Method Detail
-
operationResultOutput
void operationResultOutput(com.github.akurilov.commons.io.Output<O> opResultOut)
-
list
java.util.List<I> list(ItemFactory<I> itemFactory, java.lang.String path, java.lang.String prefix, int idRadix, I lastPrevItem, int count) throws java.io.IOException
- Throws:
java.io.IOException
-
put
boolean put(O op)
-
put
int put(java.util.List<O> ops, int from, int to)
-
put
int put(java.util.List<O> ops)
-
concurrencyLimit
int concurrencyLimit()
- Returns:
- 0 if the concurrency is not limited
-
activeOpCount
int activeOpCount()
-
scheduledOpCount
long scheduledOpCount()
-
completedOpCount
long completedOpCount()
-
isIdle
boolean isIdle()
-
adjustIoBuffers
void adjustIoBuffers(long avgTransferSize, OpType opType)
-
stop
com.github.akurilov.commons.concurrent.AsyncRunnable stop()
- Specified by:
stopin interfacecom.github.akurilov.commons.concurrent.AsyncRunnable
-
close
void close() throws java.io.IOException- Specified by:
closein interfacecom.github.akurilov.commons.concurrent.AsyncRunnable- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.io.IOException
-
instance
static <I extends Item,O extends Operation<I>,T extends StorageDriver<I,O>> T instance(java.util.List<Extension> extensions, com.github.akurilov.confuse.Config storageConfig, DataInput dataInput, boolean verifyFlag, int batchSize, java.lang.String stepId) throws java.lang.IllegalArgumentException, java.lang.InterruptedException, IllegalConfigurationException
- Type Parameters:
I- item typeO- load operation typeT- storage driver type- Parameters:
extensions- the resolved runtime extensionsstorageConfig- storage sub-config (also specifies the particular storage driver type)dataInput- the data input used to produce/reproduce the dataverifyFlag- verify the data on read or notstepId- scenario step id for logging purposes- Returns:
- the storage driver instance
- Throws:
java.lang.IllegalArgumentException- if load config either storage config is nulljava.lang.InterruptedException- may be thrown by a specific storage driver constructorIllegalConfigurationException- if no storage driver implementation was found
-
-