Package-level declarations

Types

Link copied to clipboard

Represents the state of a batch of records as it moves through processing. These are generic stages for bookkeeping, which CDK interface devs can assign to processing stages as they see fit. The only significant values are

Link copied to clipboard
abstract class ChannelMessage<T> : Message<T>
Link copied to clipboard
open class ChannelMessageQueue<T>(val channel: Channel<T>) : MessageQueue<T>
Link copied to clipboard

State.

Link copied to clipboard

A single-channel queue for checkpoint messages. This is so updating the checkpoint manager never blocks reading from stdin.

Link copied to clipboard
sealed interface CheckpointMessageWrapped
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed interface DestinationMessage

Internal representation of destination messages. These are intended to be specialized for usability. Data should be unmarshalled to these from front-line deserialized objects.

Link copied to clipboard
@Singleton
class DestinationMessageFactory(catalog: DestinationCatalog, @Value(value = "${airbyte.destination.core.file-transfer.enabled}") fileTransferEnabled: Boolean, @Named(value = "requireCheckpointIdOnRecordAndKeyOnState") requireCheckpointIdOnRecordAndKeyOnState: Boolean = false, namespaceMapper: NamespaceMapper, uuidGenerator: UUIDGenerator)
Link copied to clipboard
data class DestinationRecord(val stream: DestinationStream, val message: DestinationRecordSource, val serializedSizeBytes: Long, val checkpointId: CheckpointId? = null, val airbyteRawId: UUID) : DestinationRecordDomainMessage
Link copied to clipboard
data class DestinationRecordAirbyteValue(val stream: DestinationStream, val data: AirbyteValue, val emittedAtMs: Long, val meta: Meta?, val serializedSizeBytes: Long = 0)

Represents a record both deserialized AND marshaled to airbyte value. The marshaling

Link copied to clipboard
value class DestinationRecordJsonSource(val source: AirbyteMessage) : DestinationRecordSource
Link copied to clipboard
value class DestinationRecordProtobufSource(val source: AirbyteMessage.AirbyteMessageProtobuf) : DestinationRecordSource
Link copied to clipboard
data class DestinationRecordRaw(val stream: DestinationStream, val rawData: DestinationRecordSource, val serializedSizeBytes: Long, val checkpointId: CheckpointId? = null, val airbyteRawId: UUID)
Link copied to clipboard
data class DestinationRecordSerialized(val stream: DestinationStream, val serialized: String)

Represents a record already in its serialized state. The intended use is for conveying records from stdin to the spill file, where reserialization is not necessary.

Link copied to clipboard
sealed interface DestinationRecordSource

A serialization-format agnostic wrapper for incoming DestinationRecord's. The record-level corollary to io.airbyte.cdk.load.data.AirbyteValueProxy, providing uniform access to both client data and metadata.

Link copied to clipboard
Link copied to clipboard
data class EnrichedDestinationRecordAirbyteValue(val stream: DestinationStream, val declaredFields: LinkedHashMap<String, EnrichedAirbyteValue>, val undeclaredFields: LinkedHashMap<String, JsonNode>, val emittedAtMs: Long, val sourceMeta: Meta, val serializedSizeBytes: Long = 0, extractedAtAsTimestampWithTimezone: Boolean = false, val airbyteRawId: UUID)
Link copied to clipboard
data class FileReference(val stagingFileUrl: String, val sourceFileRelativePath: String, val fileSizeBytes: Long)
Link copied to clipboard
sealed interface FileTransferQueueMessage
Link copied to clipboard
data class FileTransferQueueRecord(val stream: DestinationStream, val file: DestinationFile, val index: Long, val checkpointId: CheckpointId) : FileTransferQueueMessage
Link copied to clipboard
data class GlobalCheckpoint(val state: JsonNode?, val sourceStats: CheckpointMessage.Stats?, var destinationStats: CheckpointMessage.Stats? = null, val checkpoints: List<CheckpointMessage.Checkpoint> = emptyList(), val additionalProperties: Map<String, Any>, val originalTypeField: AirbyteStateMessage.AirbyteStateType? = AirbyteStateMessage.AirbyteStateType.GLOBAL, val serializedSizeBytes: Long, val checkpointKey: CheckpointKey? = null, var totalRecords: Long? = null, var totalBytes: Long? = null, var totalRejectedRecords: Long? = null, var additionalStats: MutableMap<String, Double> = mutableMapOf()) : CheckpointMessage
Link copied to clipboard
data class GlobalCheckpointWrapped(val checkpointKey: CheckpointKey, val checkpoint: CheckpointMessage) : CheckpointMessageWrapped
Link copied to clipboard
data class GlobalSnapshotCheckpoint(val state: JsonNode?, val sourceStats: CheckpointMessage.Stats?, var destinationStats: CheckpointMessage.Stats? = null, val checkpoints: List<CheckpointMessage.Checkpoint> = emptyList(), val additionalProperties: Map<String, Any>, val originalTypeField: AirbyteStateMessage.AirbyteStateType? = AirbyteStateMessage.AirbyteStateType.GLOBAL, val serializedSizeBytes: Long, val checkpointKey: CheckpointKey? = null, var totalRecords: Long? = null, var totalBytes: Long? = null, var totalRejectedRecords: Long? = null, var additionalStats: MutableMap<String, Double> = mutableMapOf(), val streamCheckpoints: Map<DestinationStream.Descriptor, CheckpointKey>) : CheckpointMessage
Link copied to clipboard
Link copied to clipboard

For messages, we recognize but do not want to process. Different from Undefined mainly in that we don't log a warning.

Link copied to clipboard
sealed interface InputCheckpoint : InputMessage
Link copied to clipboard
data class InputFile(val file: DestinationFile) : InputMessage
Link copied to clipboard
data class InputGlobalCheckpoint(val sharedState: JsonNode?, val checkpointKey: CheckpointKey? = null, val streamStates: List<CheckpointMessage.Checkpoint> = emptyList(), val sourceRecordCount: Long? = null) : InputCheckpoint
Link copied to clipboard
sealed interface InputMessage
Link copied to clipboard
data class InputMessageOther(val airbyteMessage: AirbyteMessage) : InputMessage
Link copied to clipboard
data class InputRecord(val stream: DestinationStream, val data: AirbyteValue, val emittedAtMs: Long, val meta: Meta?, val serialized: String, val fileReference: AirbyteRecordMessageFileReference? = null, val checkpointId: CheckpointId? = null, val unknownFieldNames: Set<String> = emptySet()) : InputMessage
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface MessageReader<T>
Link copied to clipboard
interface MessageSupplier<K, T>
Link copied to clipboard
Link copied to clipboard
data class Meta(val changes: List<Meta.Change> = mutableListOf())
Link copied to clipboard
class MultiProducerChannel<T>(producerCount: Long, channel: Channel<T>, name: String) : ChannelMessageQueue<T>

A channel designed for use with a fixed amount of producers. Close will be called on the underlying channel, when there are no remaining registered producers.

Link copied to clipboard
Link copied to clipboard
data class PipelineContext(var parentCheckpointCounts: Map<CheckpointId, CheckpointValue>?, var parentRecord: DestinationRecordRaw?)

Contextual pass through data.

Link copied to clipboard

Broadcast at end-of-stream to all partitions to signal that the stream has ended.

Link copied to clipboard
sealed interface PipelineEvent<K : WithStream, T>

Used internally by the CDK to pass messages between steps in the loader pipeline.

Link copied to clipboard

Timed recurring event to keep the pipeline alive if no data is coming.

Link copied to clipboard
data class PipelineMessage<K : WithStream, T>(val checkpointCounts: Map<CheckpointId, CheckpointValue>, val key: K, val value: T, val postProcessingCallback: suspend () -> Unit? = null, var context: PipelineContext? = null) : PipelineEvent<K, T>

A message that contains a keyed payload. The key is used to manage the state of the payload's corresponding io.airbyte.cdk.load.pipeline.BatchAccumulator. checkpointCounts is used by the CDK to perform state message bookkeeping. postProcessingCallback is for releasing resources associated with the message.

Link copied to clipboard
Link copied to clipboard
@Singleton
class ProtocolMessageDeserializer(destinationMessageFactory: DestinationMessageFactory)

Converts the internal @AirbyteMessage to the internal @DestinationMessage Ideally, this would not use protocol messages at all, but rather a specialized deserializer for routing.

Link copied to clipboard
interface QueueReader<T>
Link copied to clipboard
Link copied to clipboard
class ResourceReservingPartitionedQueue<T>(val reservationManager: ReservationManager, val ratioOfTotalMemoryToReserve: Double, val numConsumers: Int, val numProducers: Int, val expectedResourceUsagePerUnit: Long) : PartitionedQueue<T>
Link copied to clipboard
data class StreamCheckpoint(val checkpoint: CheckpointMessage.Checkpoint, val sourceStats: CheckpointMessage.Stats?, var destinationStats: CheckpointMessage.Stats? = null, val additionalProperties: Map<String, Any> = emptyMap(), val serializedSizeBytes: Long, val checkpointKey: CheckpointKey? = null, var totalRecords: Long? = null, var totalBytes: Long? = null, var totalRejectedRecords: Long? = null, var additionalStats: MutableMap<String, Double> = mutableMapOf()) : CheckpointMessage
Link copied to clipboard
Link copied to clipboard

The default key: partitioned by stream.

Link copied to clipboard
Link copied to clipboard

Catchall for anything unimplemented.

Link copied to clipboard
interface WithBatchState

Used internally by the CDK to implement Loaders. It is added to outputs of io.airbyte.cdk.load.pipeline.BatchAccumulator that can ack or complete record batches. This is done when stitching the dev interface to the pipeline, so the dev does not have to think about internal state.

Link copied to clipboard
interface WithStream

Used internally by the CDK to keep track of streams while still allowing for partitioning on key.