class DeltaWriter[IN] extends SinkWriter[IN, DeltaCommittable, DeltaWriterBucketState] with ProcessingTimeCallback
A SinkWriter implementation for io.delta.flink.sink.DeltaSink.
It writes data to and manages the different active buckets in the
io.delta.flink.sink.DeltaSink.
Most of the logic for this class was sourced from FileWriter as the behaviour is very
similar. The main differences are use of custom implementations for some member classes and also
managing io.delta.standalone.DeltaLog transactional ids: DeltaWriter#appId and
DeltaWriter#nextCheckpointId.
Lifecycle of instances of this class is as follows:
- Every instance is being created via
io.delta.flink.sink.DeltaSink#createWritermethod - Writers' life span is the same as the application's (unless the worker node gets unresponding and the job manager needs to create a new instance to satisfy the parallelism)
- Number of instances are managed globally by a job manager and this number is equal to the parallelism of the sink.
- See also
- Alphabetic
- By Inheritance
- DeltaWriter
- ProcessingTimeCallback
- SinkWriter
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new DeltaWriter(basePath: Path, bucketAssigner: BucketAssigner[IN, String], bucketWriter: DeltaBulkBucketWriter[IN, String], rollingPolicy: CheckpointRollingPolicy[IN, String], outputFileConfig: OutputFileConfig, processingTimeService: ProcessingTimeService, metricGroup: MetricGroup, bucketCheckInterval: Long, appId: String, nextCheckpointId: Long)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
close(): Unit
Method for closing the writer, that it to say to dispose any in progress files.
Method for closing the writer, that it to say to dispose any in progress files.
- Definition Classes
- DeltaWriter → AutoCloseable
- Annotations
- @Override()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
initializeState(bucketStates: List[DeltaWriterBucketState]): Unit
Initializes the state from snapshotted
DeltaWriterBucketState.Initializes the state from snapshotted
DeltaWriterBucketState.- bucketStates
the state holding recovered state about active buckets.
- Exceptions thrown
IOExceptionif anything goes wrong during retrieving the state or restoring/committing of any in-progress/pending part files
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
onProcessingTime(time: Long): Unit
Method for getting current processing time ahd register timers.
Method for getting current processing time ahd register timers.
This method could be used e.g. to apply custom rolling file behaviour.
- Definition Classes
- DeltaWriter → ProcessingTimeCallback
- Annotations
- @Override()
-
def
prepareCommit(flush: Boolean): List[DeltaCommittable]
This method prepares committables objects that will be passed to
io.delta.flink.sink.internal.committer.DeltaCommitterandio.delta.flink.sink.internal.committer.DeltaGlobalCommitterto finalize the checkpoint interval and commit written files.This method prepares committables objects that will be passed to
io.delta.flink.sink.internal.committer.DeltaCommitterandio.delta.flink.sink.internal.committer.DeltaGlobalCommitterto finalize the checkpoint interval and commit written files.- Definition Classes
- DeltaWriter → SinkWriter
- Annotations
- @Override()
-
def
snapshotState(): List[DeltaWriterBucketState]
Prepares the writer's state to be snapshotted between checkpoint intervals.
Prepares the writer's state to be snapshotted between checkpoint intervals.
- Definition Classes
- DeltaWriter → SinkWriter
- Annotations
- @Override()
-
def
snapshotState(arg0: Long): List[DeltaWriterBucketState]
- Definition Classes
- SinkWriter
- Annotations
- @throws( classOf[java.io.IOException] )
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
write(element: IN, context: Context): Unit
A proxy method that forwards the incoming event to the correct
DeltaWriterBucketinstance.A proxy method that forwards the incoming event to the correct
DeltaWriterBucketinstance.- element
incoming stream event
- context
context for getting additional data about input event
- Definition Classes
- DeltaWriter → SinkWriter
- Annotations
- @Override()
-
def
writeWatermark(arg0: Watermark): Unit
- Definition Classes
- SinkWriter
- Annotations
- @throws( classOf[java.io.IOException] ) @throws( ... )