Package io.deephaven.kafka.ingest
Class KafkaStreamPublisher
- All Implemented Interfaces:
LogOutputAppendable,LivenessManager,LivenessNode,LivenessReferent,ConsumerRecordToStreamPublisherAdapter,StreamPublisher
public class KafkaStreamPublisher
extends StreamPublisherBase
implements ConsumerRecordToStreamPublisherAdapter
An adapter that maps keys and values, possibly each with multiple fields, to single Deephaven columns. Each Kafka
record produces one Deephaven row.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class io.deephaven.kafka.StreamPublisherBase
chunks, consumer -
Method Summary
Modifier and TypeMethodDescriptionlongconsumeRecords(long receiveTime, @NotNull List<? extends org.apache.kafka.clients.consumer.ConsumerRecord<?, ?>> records) Consume a List of Kafka records, producing zero or more rows in the output.make(@NotNull KafkaStreamPublisher.Parameters parameters, @NotNull Runnable shutdownCallback) voidpropagateFailure(@NotNull Throwable cause) Propagate a failure from the Kafka consumer to this StreamPublisher.voidshutdown()Shutdown this StreamPublisher.Methods inherited from class io.deephaven.kafka.StreamPublisherBase
flush, getChunksToFill, registerMethods 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
flush, register
-
Field Details
-
NULL_COLUMN_INDEX
public static final int NULL_COLUMN_INDEX- See Also:
-
-
Method Details
-
make
public static ConsumerRecordToStreamPublisherAdapter make(@NotNull @NotNull KafkaStreamPublisher.Parameters parameters, @NotNull @NotNull Runnable shutdownCallback) -
propagateFailure
Description copied from interface:ConsumerRecordToStreamPublisherAdapterPropagate a failure from the Kafka consumer to this StreamPublisher.- Specified by:
propagateFailurein interfaceConsumerRecordToStreamPublisherAdapter- Parameters:
cause- The failure to propagate
-
consumeRecords
public long consumeRecords(long receiveTime, @NotNull @NotNull List<? extends org.apache.kafka.clients.consumer.ConsumerRecord<?, ?>> records) Description copied from interface:ConsumerRecordToStreamPublisherAdapterConsume a List of Kafka records, producing zero or more rows in the output.- Specified by:
consumeRecordsin interfaceConsumerRecordToStreamPublisherAdapter- Parameters:
receiveTime- the time, in nanoseconds since the epoch, the records were received in this processrecords- the records received fromKafkaConsumer.poll(Duration).- Returns:
- the number of bytes processed
-
shutdown
public void shutdown()Description copied from interface:StreamPublisherShutdown this StreamPublisher. Implementations should stop publishing new data and release any related resources as soon as practicable.- Specified by:
shutdownin interfaceStreamPublisher
-