Package io.deephaven.kafka
Class StreamPublisherBase
- All Implemented Interfaces:
LogOutputAppendable,LivenessManager,LivenessNode,LivenessReferent,StreamPublisher
- Direct Known Subclasses:
KafkaStreamPublisher
public abstract class StreamPublisherBase
extends ReferenceCountedLivenessNode
implements StreamPublisher
Re-usable abstract implementation of
StreamPublisher for stream ingestion to column-chunks.
Users must register a consumer before allowing other threads or objects to interact
with a StreamPublisherBase.
Implementations should override shutdown to ensure that their upstream source is properly
shutdown, and synchronize on this if they have a need to prevent concurrent calls to flush.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStreamPublisherBase(@NotNull TableDefinition tableDefinition) -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()protected WritableChunk<Values>[]voidregister(@NotNull StreamConsumer consumer) Register aconsumerwhoseacceptmethod will be used when sufficient data is accumulated, or onStreamPublisher.flush().Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanageMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, dropReference, tryRetainReferenceMethods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, retainReference, tryRetainReferenceMethods inherited from interface io.deephaven.stream.StreamPublisher
shutdown
-
Field Details
-
consumer
-
chunks
-
-
Constructor Details
-
StreamPublisherBase
-
-
Method Details
-
register
Description copied from interface:StreamPublisherRegister aconsumerwhoseacceptmethod will be used when sufficient data is accumulated, or onStreamPublisher.flush(). Implementations should also be sure to deliver errors to the registered consumer via itsacceptFailuremethod.consumermust typically be primed to accept the samechunk typesthat this produces, in the same order.consumershould ensure thatthisisshutdownwhen it is no longer needed.- Specified by:
registerin interfaceStreamPublisher- Parameters:
consumer- The consumer
-
getChunksToFill
-
flush
public void flush()Description copied from interface:StreamPublisher- Specified by:
flushin interfaceStreamPublisher
-