Class 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
    A TableSource to read Pravega streams using the Flink Table API. Supports both stream and batch environments.
    • 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 Pravega TableSource.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.flink.table.sources.TableSource

        explainSource
    • 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 Pravega TableSource.
        Parameters:
        sourceFunctionFactory - a factory for the FlinkPravegaReader to implement StreamTableSource
        inputFormatFactory - a factory for the FlinkPravegaInputFormat to implement BatchTableSource
        schema - the table schema
        returnType - 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 interface org.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 interface org.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 interface org.apache.flink.table.sources.TableSource<org.apache.flink.types.Row>
      • getTableSchema

        public org.apache.flink.table.api.TableSchema getTableSchema()
        Specified by:
        getTableSchema in interface org.apache.flink.table.sources.TableSource<org.apache.flink.types.Row>
      • getProctimeAttribute

        public java.lang.String getProctimeAttribute()
        Specified by:
        getProctimeAttribute in interface org.apache.flink.table.sources.DefinedProctimeAttribute
      • getRowtimeAttributeDescriptors

        public java.util.List<org.apache.flink.table.sources.RowtimeAttributeDescriptor> getRowtimeAttributeDescriptors()
        Specified by:
        getRowtimeAttributeDescriptors in interface org.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.