Package io.pravega.connectors.flink
Class FlinkPravegaTableSource
- java.lang.Object
-
- io.pravega.connectors.flink.FlinkPravegaTableSource
-
- All Implemented Interfaces:
org.apache.flink.table.sources.BatchTableSource<org.apache.flink.types.Row>
,org.apache.flink.table.sources.DefinedProctimeAttribute
,org.apache.flink.table.sources.DefinedRowtimeAttributes
,org.apache.flink.table.sources.StreamTableSource<org.apache.flink.types.Row>
,org.apache.flink.table.sources.TableSource<org.apache.flink.types.Row>
- Direct Known Subclasses:
FlinkPravegaJsonTableSource
,FlinkPravegaTableFactoryBase.FlinkPravegaTableSourceImpl
public abstract class FlinkPravegaTableSource extends java.lang.Object implements org.apache.flink.table.sources.StreamTableSource<org.apache.flink.types.Row>, org.apache.flink.table.sources.BatchTableSource<org.apache.flink.types.Row>, org.apache.flink.table.sources.DefinedProctimeAttribute, org.apache.flink.table.sources.DefinedRowtimeAttributes
ATableSource
to read Pravega streams using the Flink Table API. Supports both stream and batch environments.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlinkPravegaTableSource.BuilderBase<T extends FlinkPravegaTableSource,B extends io.pravega.connectors.flink.AbstractStreamingReaderBuilder>
A base builder forFlinkPravegaTableSource
to read Pravega streams using the Flink Table API.
-
Constructor Summary
Constructors Modifier Constructor Description protected
FlinkPravegaTableSource(java.util.function.Supplier<FlinkPravegaReader<org.apache.flink.types.Row>> sourceFunctionFactory, java.util.function.Supplier<FlinkPravegaInputFormat<org.apache.flink.types.Row>> inputFormatFactory, org.apache.flink.table.api.TableSchema schema, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> returnType)
Creates a PravegaTableSource
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.api.java.DataSet<org.apache.flink.types.Row>
getDataSet(org.apache.flink.api.java.ExecutionEnvironment env)
NOTE: This method is for internal use only for defining a TableSource.org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row>
getDataStream(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment env)
NOTE: This method is for internal use only for defining a TableSource.java.lang.String
getProctimeAttribute()
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row>
getReturnType()
java.util.List<org.apache.flink.table.sources.RowtimeAttributeDescriptor>
getRowtimeAttributeDescriptors()
org.apache.flink.table.api.TableSchema
getTableSchema()
protected void
setProctimeAttribute(java.lang.String proctimeAttribute)
Declares a field of the schema to be the processing time attribute.protected void
setRowtimeAttributeDescriptors(java.util.List<org.apache.flink.table.sources.RowtimeAttributeDescriptor> rowtimeAttributeDescriptors)
Declares a list of fields to be rowtime attributes.
-
-
-
Constructor Detail
-
FlinkPravegaTableSource
protected FlinkPravegaTableSource(java.util.function.Supplier<FlinkPravegaReader<org.apache.flink.types.Row>> sourceFunctionFactory, java.util.function.Supplier<FlinkPravegaInputFormat<org.apache.flink.types.Row>> inputFormatFactory, org.apache.flink.table.api.TableSchema schema, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> returnType)
Creates a PravegaTableSource
.- Parameters:
sourceFunctionFactory
- a factory for theFlinkPravegaReader
to implementStreamTableSource
inputFormatFactory
- a factory for theFlinkPravegaInputFormat
to implementBatchTableSource
schema
- the table schemareturnType
- the return type based on the table schema
-
-
Method Detail
-
getDataStream
public org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> getDataStream(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment env)
NOTE: This method is for internal use only for defining a TableSource. Do not use it in Table API programs.- Specified by:
getDataStream
in interfaceorg.apache.flink.table.sources.StreamTableSource<org.apache.flink.types.Row>
-
getDataSet
public org.apache.flink.api.java.DataSet<org.apache.flink.types.Row> getDataSet(org.apache.flink.api.java.ExecutionEnvironment env)
NOTE: This method is for internal use only for defining a TableSource. Do not use it in Table API programs.- Specified by:
getDataSet
in interfaceorg.apache.flink.table.sources.BatchTableSource<org.apache.flink.types.Row>
-
getReturnType
public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> getReturnType()
- Specified by:
getReturnType
in interfaceorg.apache.flink.table.sources.TableSource<org.apache.flink.types.Row>
-
getTableSchema
public org.apache.flink.table.api.TableSchema getTableSchema()
- Specified by:
getTableSchema
in interfaceorg.apache.flink.table.sources.TableSource<org.apache.flink.types.Row>
-
getProctimeAttribute
public java.lang.String getProctimeAttribute()
- Specified by:
getProctimeAttribute
in interfaceorg.apache.flink.table.sources.DefinedProctimeAttribute
-
getRowtimeAttributeDescriptors
public java.util.List<org.apache.flink.table.sources.RowtimeAttributeDescriptor> getRowtimeAttributeDescriptors()
- Specified by:
getRowtimeAttributeDescriptors
in interfaceorg.apache.flink.table.sources.DefinedRowtimeAttributes
-
setProctimeAttribute
protected void setProctimeAttribute(java.lang.String proctimeAttribute)
Declares a field of the schema to be the processing time attribute.- Parameters:
proctimeAttribute
- The name of the field that becomes the processing time field.
-
setRowtimeAttributeDescriptors
protected void setRowtimeAttributeDescriptors(java.util.List<org.apache.flink.table.sources.RowtimeAttributeDescriptor> rowtimeAttributeDescriptors)
Declares a list of fields to be rowtime attributes.- Parameters:
rowtimeAttributeDescriptors
- The descriptors of the rowtime attributes.
-
-