Class DisruptorFileProducerEngine

  • All Implemented Interfaces:
    FileProducerEngine, io.gridgo.connector.Producer, io.gridgo.connector.support.FormattedMarshallable, io.gridgo.connector.support.ProducerCapability, io.gridgo.framework.ComponentLifecycle, io.gridgo.utils.helper.Loggable, io.gridgo.utils.helper.Startable

    public class DisruptorFileProducerEngine
    extends io.gridgo.connector.impl.SingleThreadSendingProducer
    implements FileProducerEngine
    • Constructor Summary

      Constructors 
      Constructor Description
      DisruptorFileProducerEngine​(io.gridgo.connector.support.config.ConnectorContext context, java.lang.String format, int bufferSize, int ringBufferSize, boolean batchingEnabled, int maxBatchSize, boolean lengthPrepend)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected io.gridgo.framework.support.Message accumulateBatch​(java.util.Collection<io.gridgo.framework.support.Message> messages)  
      org.joo.promise4j.Promise<io.gridgo.framework.support.Message,​java.lang.Exception> call​(io.gridgo.framework.support.Message request)  
      protected void executeSendOnSingleThread​(io.gridgo.framework.support.Message message)  
      protected java.lang.String generateName()  
      java.lang.String getFormat()  
      long getTotalSentBytes()  
      boolean isCallSupported()  
      protected void onStart()  
      protected void onStop()  
      void setLimitStrategy​(FileLimitStrategy limitStrategy)  
      • Methods inherited from class io.gridgo.connector.impl.SingleThreadSendingProducer

        createDeferred, isBatchingEnabled, send, sendWithAck
      • Methods inherited from class io.gridgo.connector.impl.AbstractProducer

        ack, ack, ack, ack, createMessage, getContext
      • Methods inherited from class io.gridgo.framework.AbstractComponentLifecycle

        getName, isStarted, start, stop
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.gridgo.framework.ComponentLifecycle

        getName, start, stop
      • Methods inherited from interface io.gridgo.connector.support.FormattedMarshallable

        deserialize, serialize
      • Methods inherited from interface io.gridgo.utils.helper.Loggable

        getLogger, getLogger
      • Methods inherited from interface io.gridgo.connector.Producer

        send, sendWithAck
      • Methods inherited from interface io.gridgo.connector.support.ProducerCapability

        isSendSupported, isSendWithAckSupported
    • Constructor Detail

      • DisruptorFileProducerEngine

        public DisruptorFileProducerEngine​(io.gridgo.connector.support.config.ConnectorContext context,
                                           java.lang.String format,
                                           int bufferSize,
                                           int ringBufferSize,
                                           boolean batchingEnabled,
                                           int maxBatchSize,
                                           boolean lengthPrepend)
    • Method Detail

      • onStart

        protected void onStart()
        Overrides:
        onStart in class io.gridgo.connector.impl.SingleThreadSendingProducer
      • onStop

        protected void onStop()
        Overrides:
        onStop in class io.gridgo.connector.impl.SingleThreadSendingProducer
      • executeSendOnSingleThread

        protected void executeSendOnSingleThread​(io.gridgo.framework.support.Message message)
                                          throws java.lang.Exception
        Specified by:
        executeSendOnSingleThread in class io.gridgo.connector.impl.SingleThreadSendingProducer
        Throws:
        java.lang.Exception
      • accumulateBatch

        protected io.gridgo.framework.support.Message accumulateBatch​(java.util.Collection<io.gridgo.framework.support.Message> messages)
        Overrides:
        accumulateBatch in class io.gridgo.connector.impl.SingleThreadSendingProducer
      • generateName

        protected java.lang.String generateName()
        Specified by:
        generateName in class io.gridgo.framework.AbstractComponentLifecycle
      • call

        public org.joo.promise4j.Promise<io.gridgo.framework.support.Message,​java.lang.Exception> call​(io.gridgo.framework.support.Message request)
        Specified by:
        call in interface io.gridgo.connector.Producer
      • isCallSupported

        public boolean isCallSupported()
        Specified by:
        isCallSupported in interface io.gridgo.connector.support.ProducerCapability
      • getFormat

        public java.lang.String getFormat()
        Specified by:
        getFormat in interface io.gridgo.connector.support.FormattedMarshallable