Class LoadGeneratorImpl<I extends Item,​O extends Operation<I>>

  • 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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.github.akurilov.commons.concurrent.AsyncRunnable

        com.github.akurilov.commons.concurrent.AsyncRunnable.State
    • Field Summary

      • Fields inherited from interface com.github.akurilov.fiber4j.Fiber

        DEBUG_DURATION_LIMIT_NANOS, SOFT_DURATION_LIMIT_NANOS, WARN_DURATION_LIMIT_NANOS
    • 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 void doClose()  
      protected void doStop()  
      long generatedOpCount()  
      protected void invokeTimed​(long startTimeNanos)  
      boolean isItemInputFinished()  
      boolean isNothingToRecycle()  
      void recycle​(O op)
      Enqueues the task for further recycling
      java.lang.String toString()  
      • Methods inherited from class com.github.akurilov.fiber4j.FiberBase

        doStart, invoke
      • 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.github.akurilov.fiber4j.Fiber

        invoke
    • 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:
        invokeTimed in class com.github.akurilov.fiber4j.FiberBase
      • isItemInputFinished

        public final boolean isItemInputFinished()
        Specified by:
        isItemInputFinished in interface LoadGenerator<I extends Item,​O extends Operation<I>>
        Returns:
        true if item input has been read until its end, false otherwise
      • recycle

        public final void recycle​(O op)
        Description copied from interface: LoadGenerator
        Enqueues the task for further recycling
        Specified by:
        recycle in interface LoadGenerator<I extends Item,​O extends Operation<I>>
        Parameters:
        op - the task to recycle
      • isNothingToRecycle

        public final boolean isNothingToRecycle()
        Specified by:
        isNothingToRecycle in interface LoadGenerator<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:
        doStop in class com.github.akurilov.fiber4j.FiberBase
        Throws:
        java.lang.IllegalStateException
      • doClose

        protected final void doClose()
        Overrides:
        doClose in class com.github.akurilov.commons.concurrent.AsyncRunnableBase
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object