@InterfaceStability.Unstable public class KafkaDataContext<K,V> extends QueryPostprocessDataContext implements UpdateableDataContext
| Modifier and Type | Field and Description |
|---|---|
static String |
COLUMN_KEY |
static String |
COLUMN_OFFSET |
static String |
COLUMN_PARTITION |
static String |
COLUMN_TIMESTAMP |
static String |
COLUMN_VALUE |
static String |
SYSTEM_PROPERTY_CONSUMER_POLL_TIMEOUT |
INFORMATION_SCHEMA_NAME, SYSTEM_PROPERTY_CREATE_DEFAULT_TABLE_ALIAS| Constructor and Description |
|---|
KafkaDataContext(Class<K> keyClass,
Class<V> valueClass,
ConsumerAndProducerFactory consumerAndProducerFactory,
Supplier<Collection<String>> topicSupplier) |
KafkaDataContext(Class<K> keyClass,
Class<V> valueClass,
String bootstrapServers,
Collection<String> topics) |
| Modifier and Type | Method and Description |
|---|---|
UpdateSummary |
executeUpdate(UpdateScript update)
Submits an
UpdateScript for execution on the DataContext. |
protected Schema |
getMainSchema() |
protected String |
getMainSchemaName() |
protected DataSet |
materializeMainSchemaTable(Table table,
List<Column> columns,
int maxRows)
Executes a simple one-table query against a table in the main schema of the subclasses of this class.
|
protected DataSet |
materializeMainSchemaTable(Table table,
List<SelectItem> selectItems,
List<FilterItem> whereItems,
int firstRow,
int maxRows)
Execute a simple one-table query against a table in the main schema of the subclasses of this class.
|
protected DataSet |
materializeMainSchemaTableFromConsumer(org.apache.kafka.clients.consumer.Consumer<K,V> consumer,
List<SelectItem> selectItems,
int offset,
int maxRows) |
addConverter, executeCountQuery, executePrimaryKeyLookupQuery, executeQuery, getDefaultSchemaName, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, isScalarFunctionMaterialized, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTableSelect, materializeTablecompileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, onSchemaCacheRefreshed, parseQuery, query, refreshSchemasclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompileQuery, executeQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, parseQuery, query, refreshSchemaspublic static final String SYSTEM_PROPERTY_CONSUMER_POLL_TIMEOUT
public static final String COLUMN_PARTITION
public static final String COLUMN_OFFSET
public static final String COLUMN_TIMESTAMP
public static final String COLUMN_KEY
public static final String COLUMN_VALUE
public KafkaDataContext(Class<K> keyClass, Class<V> valueClass, String bootstrapServers, Collection<String> topics)
public KafkaDataContext(Class<K> keyClass, Class<V> valueClass, ConsumerAndProducerFactory consumerAndProducerFactory, Supplier<Collection<String>> topicSupplier)
protected Schema getMainSchema() throws MetaModelException
getMainSchema in class QueryPostprocessDataContextMetaModelExceptionprotected String getMainSchemaName() throws MetaModelException
getMainSchemaName in class QueryPostprocessDataContextMetaModelExceptionprotected DataSet materializeMainSchemaTable(Table table, List<Column> columns, int maxRows)
QueryPostprocessDataContextmaterializeMainSchemaTable in class QueryPostprocessDataContexttable - the table to querycolumns - the columns of the table to querymaxRows - the maximum amount of rows needed or -1 if all rows are wanted.protected DataSet materializeMainSchemaTableFromConsumer(org.apache.kafka.clients.consumer.Consumer<K,V> consumer, List<SelectItem> selectItems, int offset, int maxRows)
protected DataSet materializeMainSchemaTable(Table table, List<SelectItem> selectItems, List<FilterItem> whereItems, int firstRow, int maxRows)
QueryPostprocessDataContextQueryPostprocessDataContext.materializeMainSchemaTable(Table, List, int, int) and apply WHERE item
filtering afterwards.materializeMainSchemaTable in class QueryPostprocessDataContextpublic UpdateSummary executeUpdate(UpdateScript update)
UpdateableDataContextUpdateScript for execution on the DataContext.
Since implementations of the DataContext vary quite a lot, there
is no golden rule as to how an update script will be executed. But the
implementors should strive towards handling an UpdateScript as a
single transactional change to the data store.executeUpdate in interface UpdateableDataContextupdate - the update script to executeCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.