Package io.pravega.connectors.flink
Class FlinkPravegaTableSource.BuilderBase<T extends FlinkPravegaTableSource,B extends io.pravega.connectors.flink.AbstractStreamingReaderBuilder>
- java.lang.Object
-
- io.pravega.connectors.flink.AbstractReaderBuilder<B>
-
- io.pravega.connectors.flink.FlinkPravegaTableSource.BuilderBase<T,B>
-
- Type Parameters:
T
- the table source type.B
- the builder type.
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
FlinkPravegaJsonTableSource.Builder
- Enclosing class:
- FlinkPravegaTableSource
public abstract static class FlinkPravegaTableSource.BuilderBase<T extends FlinkPravegaTableSource,B extends io.pravega.connectors.flink.AbstractStreamingReaderBuilder> extends AbstractReaderBuilder<B>
A base builder forFlinkPravegaTableSource
to read Pravega streams using the Flink Table API.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.flink.api.common.time.Time
checkpointInitiateTimeout
protected org.apache.flink.api.common.time.Time
eventReadTimeout
protected int
maxOutstandingCheckpointRequest
protected java.lang.String
readerGroupName
protected org.apache.flink.api.common.time.Time
readerGroupRefreshTime
protected java.lang.String
readerGroupScope
protected java.lang.String
uid
-
Constructor Summary
Constructors Constructor Description BuilderBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
configureTableSource(T source)
Applies a configuration to the table source.protected abstract org.apache.flink.util.SerializedValue<AssignerWithTimeWindows<T>>
getAssignerWithTimeWindows()
protected abstract org.apache.flink.api.common.serialization.DeserializationSchema<T>
getDeserializationSchema()
protected org.apache.flink.table.api.TableSchema
getTableSchema()
Returns the configured table schema.B
uid(java.lang.String uid)
Configures the source uid to identify the checkpoint state of this source.B
withCheckpointInitiateTimeout(org.apache.flink.api.common.time.Time checkpointInitiateTimeout)
Sets the timeout for initiating a checkpoint in Pravega.B
withEventReadTimeout(org.apache.flink.api.common.time.Time eventReadTimeout)
Sets the timeout for the call to read events from Pravega.B
withMaxOutstandingCheckpointRequest(int maxOutstandingCheckpointRequest)
Configures the maximum outstanding checkpoint requests to Pravega (default=3).B
withProctimeAttribute(java.lang.String proctimeAttribute)
Configures a field of the table to be a processing time attribute.B
withReaderGroupName(java.lang.String readerGroupName)
Configures the reader group name.B
withReaderGroupRefreshTime(org.apache.flink.api.common.time.Time groupRefreshTime)
Sets the group refresh time, with a default of 1 second.B
withReaderGroupScope(java.lang.String scope)
Configures the reader group scope for synchronization purposes.B
withRowtimeAttribute(java.lang.String rowtimeAttribute, org.apache.flink.table.sources.tsextractors.TimestampExtractor timestampExtractor, org.apache.flink.table.sources.wmstrategies.WatermarkStrategy watermarkStrategy)
Configures a field of the table to be a rowtime attribute.B
withSchema(org.apache.flink.table.api.TableSchema schema)
Sets the schema of the produced table.-
Methods inherited from class io.pravega.connectors.flink.AbstractReaderBuilder
builder, enableMetrics, forStream, forStream, forStream, forStream, forStream, forStream, getPravegaConfig, isMetricsEnabled, resolveStreams, withPravegaConfig
-
-
-
-
Field Detail
-
uid
protected java.lang.String uid
-
readerGroupScope
protected java.lang.String readerGroupScope
-
readerGroupName
protected java.lang.String readerGroupName
-
readerGroupRefreshTime
protected org.apache.flink.api.common.time.Time readerGroupRefreshTime
-
checkpointInitiateTimeout
protected org.apache.flink.api.common.time.Time checkpointInitiateTimeout
-
eventReadTimeout
protected org.apache.flink.api.common.time.Time eventReadTimeout
-
maxOutstandingCheckpointRequest
protected int maxOutstandingCheckpointRequest
-
-
Method Detail
-
withSchema
public B withSchema(org.apache.flink.table.api.TableSchema schema)
Sets the schema of the produced table.- Parameters:
schema
- The schema of the produced table.- Returns:
- The builder.
-
withProctimeAttribute
public B withProctimeAttribute(java.lang.String proctimeAttribute)
Configures a field of the table to be a processing time attribute. The configured field must be present in the table schema and of typeTypes.SQL_TIMESTAMP()
.- Parameters:
proctimeAttribute
- The name of the processing time attribute in the table schema.- Returns:
- The builder.
-
withRowtimeAttribute
public B withRowtimeAttribute(java.lang.String rowtimeAttribute, org.apache.flink.table.sources.tsextractors.TimestampExtractor timestampExtractor, org.apache.flink.table.sources.wmstrategies.WatermarkStrategy watermarkStrategy)
Configures a field of the table to be a rowtime attribute. The configured field must be present in the table schema and of typeTypes.SQL_TIMESTAMP()
.- Parameters:
rowtimeAttribute
- The name of the rowtime attribute in the table schema.timestampExtractor
- TheTimestampExtractor
to extract the rowtime attribute from the physical type.watermarkStrategy
- TheWatermarkStrategy
to generate watermarks for the rowtime attribute.- Returns:
- The builder.
-
getTableSchema
protected org.apache.flink.table.api.TableSchema getTableSchema()
Returns the configured table schema.- Returns:
- the configured table schema.
-
configureTableSource
protected void configureTableSource(T source)
Applies a configuration to the table source.- Parameters:
source
- the table source.
-
uid
public B uid(java.lang.String uid)
Configures the source uid to identify the checkpoint state of this source.The default value is generated based on other inputs.
- Parameters:
uid
- the uid to use.
-
withReaderGroupScope
public B withReaderGroupScope(java.lang.String scope)
Configures the reader group scope for synchronization purposes.The default value is taken from the
PravegaConfig
defaultScope
property.- Parameters:
scope
- the scope name.
-
withReaderGroupName
public B withReaderGroupName(java.lang.String readerGroupName)
Configures the reader group name.- Parameters:
readerGroupName
- the reader group name.
-
withReaderGroupRefreshTime
public B withReaderGroupRefreshTime(org.apache.flink.api.common.time.Time groupRefreshTime)
Sets the group refresh time, with a default of 1 second.- Parameters:
groupRefreshTime
- The group refresh time
-
withCheckpointInitiateTimeout
public B withCheckpointInitiateTimeout(org.apache.flink.api.common.time.Time checkpointInitiateTimeout)
Sets the timeout for initiating a checkpoint in Pravega.- Parameters:
checkpointInitiateTimeout
- The timeout
-
withEventReadTimeout
public B withEventReadTimeout(org.apache.flink.api.common.time.Time eventReadTimeout)
Sets the timeout for the call to read events from Pravega. After the timeout expires (without an event being returned), another call will be made.- Parameters:
eventReadTimeout
- The timeout
-
withMaxOutstandingCheckpointRequest
public B withMaxOutstandingCheckpointRequest(int maxOutstandingCheckpointRequest)
Configures the maximum outstanding checkpoint requests to Pravega (default=3). Upon requesting more checkpoints than the specified maximum, (say a checkpoint request times out on the ReaderCheckpointHook but Pravega is still working on it), this configurations allows Pravega to limit any further checkpoint request being made to the ReaderGroup. This configuration is particularly relevant when multiple checkpoint requests need to be honored (e.g., frequent savepoint requests being triggered concurrently).- Parameters:
maxOutstandingCheckpointRequest
- maximum outstanding checkpoint request.
-
getDeserializationSchema
protected abstract org.apache.flink.api.common.serialization.DeserializationSchema<T> getDeserializationSchema()
-
getAssignerWithTimeWindows
protected abstract org.apache.flink.util.SerializedValue<AssignerWithTimeWindows<T>> getAssignerWithTimeWindows()
-
-