- java.lang.Object
-
- com.github.akurilov.commons.concurrent.AsyncRunnableBase
-
- com.github.akurilov.fiber4j.FiberBase
-
- com.emc.mongoose.base.load.generator.LoadGeneratorImpl<I,O>
-
- All Implemented Interfaces:
LoadGenerator<I,O>,com.github.akurilov.commons.concurrent.AsyncRunnable,com.github.akurilov.fiber4j.Fiber,java.rmi.Remote
public class LoadGeneratorImpl<I extends Item,O extends Operation<I>> extends com.github.akurilov.fiber4j.FiberBase implements LoadGenerator<I,O>
Created by kurila on 11.07.16.
-
-
Constructor Summary
Constructors Constructor Description LoadGeneratorImpl(com.github.akurilov.commons.io.Input<I> itemInput, OperationsBuilder<I,O> opsBuilder, java.util.List<java.lang.Object> throttles, com.github.akurilov.commons.io.Output<O> opOutput, int batchSize, long countLimit, int recycleQueueSize, boolean recycleFlag, boolean shuffleFlag)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoClose()protected voiddoStop()longgeneratedOpCount()protected voidinvokeTimed(long startTimeNanos)booleanisItemInputFinished()booleanisNothingToRecycle()voidrecycle(O op)Enqueues the task for further recyclingjava.lang.StringtoString()-
Methods inherited from class com.github.akurilov.commons.concurrent.AsyncRunnableBase
await, await, close, doShutdown, 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, await, isClosed, isInitial, isShutdown, isStarted, isStopped, shutdown, start, state, stop
-
Methods inherited from interface com.emc.mongoose.base.load.generator.LoadGenerator
close
-
-
-
-
Constructor Detail
-
LoadGeneratorImpl
public LoadGeneratorImpl(com.github.akurilov.commons.io.Input<I> itemInput, OperationsBuilder<I,O> opsBuilder, java.util.List<java.lang.Object> throttles, com.github.akurilov.commons.io.Output<O> opOutput, int batchSize, long countLimit, int recycleQueueSize, boolean recycleFlag, boolean shuffleFlag)
-
-
Method Detail
-
invokeTimed
protected final void invokeTimed(long startTimeNanos)
- Specified by:
invokeTimedin classcom.github.akurilov.fiber4j.FiberBase
-
isItemInputFinished
public final boolean isItemInputFinished()
- Specified by:
isItemInputFinishedin interfaceLoadGenerator<I extends Item,O extends Operation<I>>- Returns:
- true if item input has been read until its end, false otherwise
-
generatedOpCount
public final long generatedOpCount()
- Specified by:
generatedOpCountin interfaceLoadGenerator<I extends Item,O extends Operation<I>>- Returns:
- sum of the new tasks and recycled ones
-
recycle
public final void recycle(O op)
Description copied from interface:LoadGeneratorEnqueues the task for further recycling
-
isNothingToRecycle
public final boolean isNothingToRecycle()
- Specified by:
isNothingToRecyclein interfaceLoadGenerator<I extends Item,O extends Operation<I>>- Returns:
- true if the internal recycle queue is empty, false otherwise
-
doStop
protected final void doStop() throws java.lang.IllegalStateException- Overrides:
doStopin classcom.github.akurilov.fiber4j.FiberBase- Throws:
java.lang.IllegalStateException
-
doClose
protected final void doClose()
- Overrides:
doClosein classcom.github.akurilov.commons.concurrent.AsyncRunnableBase
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-