Package org.apache.metamodel.kafka
Class KafkaDataContext<K,V>
- java.lang.Object
-
- org.apache.metamodel.AbstractDataContext
-
- org.apache.metamodel.QueryPostprocessDataContext
-
- org.apache.metamodel.kafka.KafkaDataContext<K,V>
-
- All Implemented Interfaces:
org.apache.metamodel.convert.HasReadTypeConverters,org.apache.metamodel.DataContext,org.apache.metamodel.UpdateableDataContext
@Unstable public class KafkaDataContext<K,V> extends org.apache.metamodel.QueryPostprocessDataContext implements org.apache.metamodel.UpdateableDataContext
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOLUMN_KEYstatic StringCOLUMN_OFFSETstatic StringCOLUMN_PARTITIONstatic StringCOLUMN_TIMESTAMPstatic StringCOLUMN_VALUEstatic StringSYSTEM_PROPERTY_CONSUMER_POLL_TIMEOUT
-
Constructor Summary
Constructors Constructor Description KafkaDataContext(Class<K> keyClass, Class<V> valueClass, String bootstrapServers, Collection<String> topics)KafkaDataContext(Class<K> keyClass, Class<V> valueClass, ConsumerAndProducerFactory consumerAndProducerFactory, Supplier<Collection<String>> topicSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.metamodel.UpdateSummaryexecuteUpdate(org.apache.metamodel.UpdateScript update)protected org.apache.metamodel.schema.SchemagetMainSchema()protected StringgetMainSchemaName()protected org.apache.metamodel.data.DataSetmaterializeMainSchemaTable(org.apache.metamodel.schema.Table table, List<org.apache.metamodel.query.SelectItem> selectItems, List<org.apache.metamodel.query.FilterItem> whereItems, int firstRow, int maxRows)protected org.apache.metamodel.data.DataSetmaterializeMainSchemaTable(org.apache.metamodel.schema.Table table, List<org.apache.metamodel.schema.Column> columns, int maxRows)protected org.apache.metamodel.data.DataSetmaterializeMainSchemaTableFromConsumer(org.apache.kafka.clients.consumer.Consumer<K,V> consumer, List<org.apache.metamodel.query.SelectItem> selectItems, int offset, int maxRows)-
Methods inherited from class org.apache.metamodel.QueryPostprocessDataContext
addConverter, executeCountQuery, executePrimaryKeyLookupQuery, executeQuery, getDefaultSchemaName, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, isScalarFunctionMaterialized, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTableSelect, materializeTable
-
Methods inherited from class org.apache.metamodel.AbstractDataContext
compileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, onSchemaCacheRefreshed, parseQuery, query, refreshSchemas
-
-
-
-
Field Detail
-
SYSTEM_PROPERTY_CONSUMER_POLL_TIMEOUT
public static final String SYSTEM_PROPERTY_CONSUMER_POLL_TIMEOUT
- See Also:
- Constant Field Values
-
COLUMN_PARTITION
public static final String COLUMN_PARTITION
- See Also:
- Constant Field Values
-
COLUMN_OFFSET
public static final String COLUMN_OFFSET
- See Also:
- Constant Field Values
-
COLUMN_TIMESTAMP
public static final String COLUMN_TIMESTAMP
- See Also:
- Constant Field Values
-
COLUMN_KEY
public static final String COLUMN_KEY
- See Also:
- Constant Field Values
-
COLUMN_VALUE
public static final String COLUMN_VALUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KafkaDataContext
public KafkaDataContext(Class<K> keyClass, Class<V> valueClass, String bootstrapServers, Collection<String> topics)
-
KafkaDataContext
public KafkaDataContext(Class<K> keyClass, Class<V> valueClass, ConsumerAndProducerFactory consumerAndProducerFactory, Supplier<Collection<String>> topicSupplier)
-
-
Method Detail
-
getMainSchema
protected org.apache.metamodel.schema.Schema getMainSchema() throws org.apache.metamodel.MetaModelException- Specified by:
getMainSchemain classorg.apache.metamodel.QueryPostprocessDataContext- Throws:
org.apache.metamodel.MetaModelException
-
getMainSchemaName
protected String getMainSchemaName() throws org.apache.metamodel.MetaModelException
- Specified by:
getMainSchemaNamein classorg.apache.metamodel.QueryPostprocessDataContext- Throws:
org.apache.metamodel.MetaModelException
-
materializeMainSchemaTable
protected org.apache.metamodel.data.DataSet materializeMainSchemaTable(org.apache.metamodel.schema.Table table, List<org.apache.metamodel.schema.Column> columns, int maxRows)- Specified by:
materializeMainSchemaTablein classorg.apache.metamodel.QueryPostprocessDataContext
-
materializeMainSchemaTableFromConsumer
protected org.apache.metamodel.data.DataSet materializeMainSchemaTableFromConsumer(org.apache.kafka.clients.consumer.Consumer<K,V> consumer, List<org.apache.metamodel.query.SelectItem> selectItems, int offset, int maxRows)
-
materializeMainSchemaTable
protected org.apache.metamodel.data.DataSet materializeMainSchemaTable(org.apache.metamodel.schema.Table table, List<org.apache.metamodel.query.SelectItem> selectItems, List<org.apache.metamodel.query.FilterItem> whereItems, int firstRow, int maxRows)- Overrides:
materializeMainSchemaTablein classorg.apache.metamodel.QueryPostprocessDataContext
-
executeUpdate
public org.apache.metamodel.UpdateSummary executeUpdate(org.apache.metamodel.UpdateScript update)
- Specified by:
executeUpdatein interfaceorg.apache.metamodel.UpdateableDataContext
-
-