public abstract static class SparkReceiverIO.Read<V> extends PTransform<PBegin,PCollection<V>>
PTransform
to read from Spark Receiver
.name, resourceHints
Constructor and Description |
---|
Read() |
Modifier and Type | Method and Description |
---|---|
PCollection<V> |
expand(PBegin input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
void |
validateTransform() |
SparkReceiverIO.Read<V> |
withGetOffsetFn(SerializableFunction<V,java.lang.Long> getOffsetFn)
A function to get offset in order to start
Receiver from it. |
SparkReceiverIO.Read<V> |
withPullFrequencySec(java.lang.Long pullFrequencySec)
Delay in seconds between polling for new records updates.
|
SparkReceiverIO.Read<V> |
withSparkReceiverBuilder(ReceiverBuilder<V,? extends org.apache.spark.streaming.receiver.Receiver<V>> sparkReceiverBuilder)
Sets
ReceiverBuilder with value and custom Spark Receiver class. |
SparkReceiverIO.Read<V> |
withStartOffset(java.lang.Long startOffset)
Inclusive start offset from which the reading should be started.
|
SparkReceiverIO.Read<V> |
withTimestampFn(SerializableFunction<V,Instant> timestampFn)
A function to calculate timestamp for a record.
|
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate, validate
public SparkReceiverIO.Read<V> withSparkReceiverBuilder(ReceiverBuilder<V,? extends org.apache.spark.streaming.receiver.Receiver<V>> sparkReceiverBuilder)
ReceiverBuilder
with value and custom Spark Receiver
class.public SparkReceiverIO.Read<V> withGetOffsetFn(SerializableFunction<V,java.lang.Long> getOffsetFn)
Receiver
from it.public SparkReceiverIO.Read<V> withTimestampFn(SerializableFunction<V,Instant> timestampFn)
public SparkReceiverIO.Read<V> withPullFrequencySec(java.lang.Long pullFrequencySec)
public SparkReceiverIO.Read<V> withStartOffset(java.lang.Long startOffset)
public PCollection<V> expand(PBegin input)
PTransform
PTransform
should be expanded on the given
InputT
.
NOTE: This method should not be called directly. Instead apply the PTransform
should
be applied to the InputT
using the apply
method.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
expand
in class PTransform<PBegin,PCollection<V>>
public void validateTransform()