Interface StorageDriver<I extends Item,​O extends Operation<I>>

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

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

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

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int activeOpCount()  
      void adjustIoBuffers​(long avgTransferSize, OpType opType)  
      void close()  
      long completedOpCount()  
      int concurrencyLimit()  
      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)  
      boolean isIdle()  
      java.util.List<I> list​(ItemFactory<I> itemFactory, java.lang.String path, java.lang.String prefix, int idRadix, I lastPrevItem, int count)  
      void operationResultOutput​(com.github.akurilov.commons.io.Output<O> opResultOut)  
      int put​(java.util.List<O> ops)  
      int put​(java.util.List<O> ops, int from, int to)  
      boolean put​(O op)  
      long scheduledOpCount()  
      com.github.akurilov.commons.concurrent.AsyncRunnable stop()  
      • Methods inherited from interface com.github.akurilov.commons.concurrent.AsyncRunnable

        await, await, isClosed, isInitial, isShutdown, isStarted, isStopped, shutdown, start, state
      • Methods inherited from interface java.util.function.Consumer

        andThen
      • Methods inherited from interface com.github.akurilov.commons.io.Output

        accept, getInput
    • 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)
        Specified by:
        put in interface com.github.akurilov.commons.io.Output<I extends Item>
      • put

        int put​(java.util.List<O> ops,
                int from,
                int to)
        Specified by:
        put in interface com.github.akurilov.commons.io.Output<I extends Item>
      • put

        int put​(java.util.List<O> ops)
        Specified by:
        put in interface com.github.akurilov.commons.io.Output<I extends Item>
      • 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:
        stop in interface com.github.akurilov.commons.concurrent.AsyncRunnable
      • close

        void close()
            throws java.io.IOException
        Specified by:
        close in interface com.github.akurilov.commons.concurrent.AsyncRunnable
        Specified by:
        close in interface java.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 type
        O - load operation type
        T - storage driver type
        Parameters:
        extensions - the resolved runtime extensions
        storageConfig - storage sub-config (also specifies the particular storage driver type)
        dataInput - the data input used to produce/reproduce the data
        verifyFlag - verify the data on read or not
        stepId - scenario step id for logging purposes
        Returns:
        the storage driver instance
        Throws:
        java.lang.IllegalArgumentException - if load config either storage config is null
        java.lang.InterruptedException - may be thrown by a specific storage driver constructor
        IllegalConfigurationException - if no storage driver implementation was found