@PrimaryNodeOnly @TriggerSerially @InputRequirement(value=INPUT_FORBIDDEN) @Tags(value={"sql","list","jdbc","table","database"}) @CapabilityDescription(value="Generates a set of flow files, each containing attributes corresponding to metadata about a table from a database connection. Once metadata about a table has been fetched, it will not be fetched again until the Refresh Interval (if set) has elapsed, or until state has been manually cleared.") @WritesAttribute(attribute="db.table.name",description="Contains the name of a database table from the connection") @WritesAttribute(attribute="db.table.catalog",description="Contains the name of the catalog to which the table belongs (may be null)") @WritesAttribute(attribute="db.table.schema",description="Contains the name of the schema to which the table belongs (may be null)") @WritesAttribute(attribute="db.table.fullname",description="Contains the fully-qualifed table name (possibly including catalog, schema, etc.)") @WritesAttribute(attribute="db.table.type",description="Contains the type of the database table from the connection. Typical types are \"TABLE\", \"VIEW\", \"SYSTEM TABLE\", \"GLOBAL TEMPORARY\", \"LOCAL TEMPORARY\", \"ALIAS\", \"SYNONYM\"") @WritesAttribute(attribute="db.table.remarks",description="Contains the name of a database table from the connection") @WritesAttribute(attribute="db.table.count",description="Contains the number of rows in the table") @Stateful(scopes=CLUSTER, description="After performing a listing of tables, the timestamp of the query is stored. This allows the Processor to not re-list tables the next time that the Processor is run. Specifying the refresh interval in the processor properties will indicate that when the processor detects the interval has elapsed, the state will be reset and tables will be re-listed as a result. This processor is meant to be run on the primary node only.") @DefaultSchedule(strategy=TIMER_DRIVEN, period="1 min") public class ListDatabaseTables extends AbstractProcessor
| Modifier and Type | Class and Description |
|---|---|
private static class |
ListDatabaseTables.AttributeTableListingWriter |
(package private) static class |
ListDatabaseTables.RecordTableListingWriter |
(package private) static interface |
ListDatabaseTables.TableListingWriter |
| Modifier and Type | Field and Description |
|---|---|
static PropertyDescriptor |
CATALOG |
static String |
DB_TABLE_CATALOG |
static String |
DB_TABLE_COUNT |
static String |
DB_TABLE_FULLNAME |
static String |
DB_TABLE_NAME |
static String |
DB_TABLE_REMARKS |
static String |
DB_TABLE_SCHEMA |
static String |
DB_TABLE_TYPE |
static PropertyDescriptor |
DBCP_SERVICE |
static PropertyDescriptor |
INCLUDE_COUNT |
private static List<PropertyDescriptor> |
propertyDescriptors |
static PropertyDescriptor |
RECORD_WRITER |
static PropertyDescriptor |
REFRESH_INTERVAL |
static Relationship |
REL_SUCCESS |
private static Set<Relationship> |
relationships |
static PropertyDescriptor |
SCHEMA_PATTERN |
static PropertyDescriptor |
TABLE_NAME_PATTERN |
static PropertyDescriptor |
TABLE_TYPES |
| Constructor and Description |
|---|
ListDatabaseTables() |
| Modifier and Type | Method and Description |
|---|---|
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final String DB_TABLE_NAME
public static final String DB_TABLE_CATALOG
public static final String DB_TABLE_SCHEMA
public static final String DB_TABLE_FULLNAME
public static final String DB_TABLE_TYPE
public static final String DB_TABLE_REMARKS
public static final String DB_TABLE_COUNT
public static final Relationship REL_SUCCESS
public static final PropertyDescriptor DBCP_SERVICE
public static final PropertyDescriptor CATALOG
public static final PropertyDescriptor SCHEMA_PATTERN
public static final PropertyDescriptor TABLE_NAME_PATTERN
public static final PropertyDescriptor TABLE_TYPES
public static final PropertyDescriptor INCLUDE_COUNT
public static final PropertyDescriptor REFRESH_INTERVAL
public static final PropertyDescriptor RECORD_WRITER
private static final List<PropertyDescriptor> propertyDescriptors
private static final Set<Relationship> relationships
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.