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
-
Constructor Summary
ModifierConstructorDescriptionprotected
StreamPublisherBase
(@NotNull TableDefinition tableDefinition) -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
protected WritableChunk<Values>[]
void
register
(@NotNull StreamConsumer consumer) Register aconsumer
whoseaccept
method 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, tryUnmanage
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, dropReference, tryRetainReference
Methods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, retainReference, tryRetainReference
Methods inherited from interface io.deephaven.stream.StreamPublisher
shutdown
-
Field Details
-
consumer
-
chunks
-
-
Constructor Details
-
StreamPublisherBase
-
-
Method Details
-
register
Description copied from interface:StreamPublisher
Register aconsumer
whoseaccept
method will be used when sufficient data is accumulated, or onStreamPublisher.flush()
. Implementations should also be sure to deliver errors to the registered consumer via itsacceptFailure
method.consumer
must typically be primed to accept the samechunk types
that this produces, in the same order.consumer
should ensure thatthis
isshutdown
when it is no longer needed.- Specified by:
register
in interfaceStreamPublisher
- Parameters:
consumer
- The consumer
-
getChunksToFill
-
flush
public void flush()Description copied from interface:StreamPublisher
- Specified by:
flush
in interfaceStreamPublisher
-