Class ListDatabaseTables
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.ListDatabaseTables
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@PrimaryNodeOnly
@TriggerSerially
@InputRequirement(INPUT_FORBIDDEN)
@Tags({"sql","list","jdbc","table","database"})
@CapabilityDescription("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")
@MultiProcessorUseCase(description="Perform a full load of a database, retrieving all rows from all tables, or a specific set of tables.",keywords={"full load","rdbms","jdbc","database"},configurations={@ProcessorConfiguration(processorClass=ListDatabaseTables.class,configuration="Configure the \"Database Connection Pooling Service\" property to specify a Connection Pool that is applicable for interacting with your database.\nLeave the RecordWriter property unset.\n\nSet the \"Catalog\" property to the name of the database Catalog; leave it empty to include all catalogs.\nSet the \"Schema Pattern\" property to a Java Regular Expression that matches all database Schemas that should be included; leave it empty to include all Schemas.\nSet the \"Table Name Pattern\" property to a Java Regular Expression that matches the names of all tables that should be included; leave it empty to include all Tables.\n\nConnect the \"success\" relationship to GenerateTableFetch.\n"),@ProcessorConfiguration(processorClass=GenerateTableFetch.class,configuration="Configure the \"Database Connection Pooling Service\" property to specify the same Connection Pool that was used in ListDatabaseTables.\nSet the \"Database Type\" property to match the appropriate value for your RDBMS vendor.\nSet \"Table Name\" to `${db.table.fullname}`\nLeave the RecordWriter property unset.\n\nConnect the \"success\" relationship to ExecuteSQLRecord.\n"),@ProcessorConfiguration(processorClass=ExecuteSQLRecord.class,configuration="Configure the \"Database Connection Pooling Service\" property to specify the same Connection Pool that was used in ListDatabaseTables.\nConfigure the \"Record Writer\" property to specify a Record Writer that is appropriate for the desired output data type.\nLeave the \"SQL select query\" unset.\n\nConnect the \"success\" relationship to the next Processor in the flow.\n")})
public class ListDatabaseTables
extends org.apache.nifi.processor.AbstractProcessor
A processor to retrieve a list of tables (and their metadata) from a database connection
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class(package private) static class(package private) static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptor -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
DB_TABLE_NAME
- See Also:
-
DB_TABLE_CATALOG
- See Also:
-
DB_TABLE_SCHEMA
- See Also:
-
DB_TABLE_FULLNAME
- See Also:
-
DB_TABLE_TYPE
- See Also:
-
DB_TABLE_REMARKS
- See Also:
-
DB_TABLE_COUNT
- See Also:
-
DBCP_SERVICE
public static final org.apache.nifi.components.PropertyDescriptor DBCP_SERVICE -
CATALOG
public static final org.apache.nifi.components.PropertyDescriptor CATALOG -
SCHEMA_PATTERN
public static final org.apache.nifi.components.PropertyDescriptor SCHEMA_PATTERN -
TABLE_NAME_PATTERN
public static final org.apache.nifi.components.PropertyDescriptor TABLE_NAME_PATTERN -
TABLE_TYPES
public static final org.apache.nifi.components.PropertyDescriptor TABLE_TYPES -
INCLUDE_COUNT
public static final org.apache.nifi.components.PropertyDescriptor INCLUDE_COUNT -
REFRESH_INTERVAL
public static final org.apache.nifi.components.PropertyDescriptor REFRESH_INTERVAL -
RECORD_WRITER
public static final org.apache.nifi.components.PropertyDescriptor RECORD_WRITER -
PROPERTY_DESCRIPTORS
-
REL_SUCCESS
public static final org.apache.nifi.processor.Relationship REL_SUCCESS -
RELATIONSHIPS
-
-
Constructor Details
-
ListDatabaseTables
public ListDatabaseTables()
-
-
Method Details
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-