- java.lang.Object
-
- com.github.akurilov.commons.concurrent.AsyncRunnableBase
-
- com.emc.mongoose.base.storage.driver.mock.DummyStorageDriverMock<I,O>
-
- All Implemented Interfaces:
Daemon,StorageDriver<I,O>,com.github.akurilov.commons.concurrent.AsyncRunnable,com.github.akurilov.commons.io.Output<O>,java.lang.AutoCloseable,java.rmi.Remote,java.util.function.Consumer<O>
public final class DummyStorageDriverMock<I extends Item,O extends Operation<I>> extends com.github.akurilov.commons.concurrent.AsyncRunnableBase implements StorageDriver<I,O>
Created by andrey on 11.05.17.
-
-
Field Summary
-
Fields inherited from interface com.emc.mongoose.base.storage.driver.StorageDriver
BUFF_SIZE_MAX, BUFF_SIZE_MIN
-
-
Constructor Summary
Constructors Constructor Description DummyStorageDriverMock(com.github.akurilov.confuse.Config storageConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intactiveOpCount()voidadjustIoBuffers(long avgTransferSize, OpType opType)booleanawait(long timeout, java.util.concurrent.TimeUnit timeUnit)longcompletedOpCount()intconcurrencyLimit()protected voiddoClose()protected voiddoShutdown()protected voiddoStart()protected voiddoStop()com.github.akurilov.commons.io.Input<O>getInput()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> tasks)intput(java.util.List<O> tasks, int from, int to)booleanput(O task)longscheduledOpCount()java.lang.StringtoString()-
Methods inherited from class com.github.akurilov.commons.concurrent.AsyncRunnableBase
await, close, isClosed, isInitial, isShutdown, isStarted, isStopped, shutdown, start, state, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.akurilov.commons.concurrent.AsyncRunnable
await, isClosed, isInitial, isShutdown, isStarted, isStopped, shutdown, start, state
-
Methods inherited from interface com.emc.mongoose.base.storage.driver.StorageDriver
close, stop
-
-
-
-
Method Detail
-
put
public final boolean put(O task)
-
put
public final int put(java.util.List<O> tasks, int from, int to)
-
put
public final int put(java.util.List<O> tasks)
-
getInput
public final com.github.akurilov.commons.io.Input<O> getInput()
-
operationResultOutput
public final void operationResultOutput(com.github.akurilov.commons.io.Output<O> opResultOut)
- Specified by:
operationResultOutputin interfaceStorageDriver<I extends Item,O extends Operation<I>>
-
list
public final 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
-
concurrencyLimit
public final int concurrencyLimit()
- Specified by:
concurrencyLimitin interfaceStorageDriver<I extends Item,O extends Operation<I>>- Returns:
- 0 if the concurrency is not limited
-
activeOpCount
public final int activeOpCount()
- Specified by:
activeOpCountin interfaceStorageDriver<I extends Item,O extends Operation<I>>
-
scheduledOpCount
public final long scheduledOpCount()
- Specified by:
scheduledOpCountin interfaceStorageDriver<I extends Item,O extends Operation<I>>
-
completedOpCount
public final long completedOpCount()
- Specified by:
completedOpCountin interfaceStorageDriver<I extends Item,O extends Operation<I>>
-
isIdle
public final boolean isIdle()
-
adjustIoBuffers
public final void adjustIoBuffers(long avgTransferSize, OpType opType)- Specified by:
adjustIoBuffersin interfaceStorageDriver<I extends Item,O extends Operation<I>>
-
doStart
protected void doStart() throws java.lang.IllegalStateException- Overrides:
doStartin classcom.github.akurilov.commons.concurrent.AsyncRunnableBase- Throws:
java.lang.IllegalStateException
-
doShutdown
protected final void doShutdown() throws java.lang.IllegalStateException- Overrides:
doShutdownin classcom.github.akurilov.commons.concurrent.AsyncRunnableBase- Throws:
java.lang.IllegalStateException
-
await
public final boolean await(long timeout, java.util.concurrent.TimeUnit timeUnit) throws java.lang.InterruptedException- Specified by:
awaitin interfacecom.github.akurilov.commons.concurrent.AsyncRunnable- Overrides:
awaitin classcom.github.akurilov.commons.concurrent.AsyncRunnableBase- Throws:
java.lang.InterruptedException
-
doStop
protected final void doStop() throws java.lang.IllegalStateException- Overrides:
doStopin classcom.github.akurilov.commons.concurrent.AsyncRunnableBase- Throws:
java.lang.IllegalStateException
-
doClose
protected final void doClose() throws java.io.IOException- Overrides:
doClosein classcom.github.akurilov.commons.concurrent.AsyncRunnableBase- Throws:
java.io.IOException
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-