Class DisruptorFileProducerEngine
- java.lang.Object
-
- io.gridgo.framework.AbstractComponentLifecycle
-
- io.gridgo.connector.impl.AbstractProducer
-
- io.gridgo.connector.impl.SingleThreadSendingProducer
-
- io.gridgo.connector.file.support.engines.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.MessageaccumulateBatch(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 voidexecuteSendOnSingleThread(io.gridgo.framework.support.Message message)protected java.lang.StringgenerateName()java.lang.StringgetFormat()longgetTotalSentBytes()booleanisCallSupported()protected voidonStart()protected voidonStop()voidsetLimitStrategy(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.connector.file.support.engines.FileProducerEngine
appendWithLength, writeBytesWithLength, writeToFile, writeWithBuffer
-
-
-
-
Method Detail
-
onStart
protected void onStart()
- Overrides:
onStartin classio.gridgo.connector.impl.SingleThreadSendingProducer
-
onStop
protected void onStop()
- Overrides:
onStopin classio.gridgo.connector.impl.SingleThreadSendingProducer
-
executeSendOnSingleThread
protected void executeSendOnSingleThread(io.gridgo.framework.support.Message message) throws java.lang.Exception- Specified by:
executeSendOnSingleThreadin classio.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:
accumulateBatchin classio.gridgo.connector.impl.SingleThreadSendingProducer
-
generateName
protected java.lang.String generateName()
- Specified by:
generateNamein classio.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:
callin interfaceio.gridgo.connector.Producer
-
isCallSupported
public boolean isCallSupported()
- Specified by:
isCallSupportedin interfaceio.gridgo.connector.support.ProducerCapability
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfaceio.gridgo.connector.support.FormattedMarshallable
-
getTotalSentBytes
public long getTotalSentBytes()
- Specified by:
getTotalSentBytesin interfaceFileProducerEngine
-
setLimitStrategy
public void setLimitStrategy(FileLimitStrategy limitStrategy)
- Specified by:
setLimitStrategyin interfaceFileProducerEngine
-
-