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 Classes
    Modifier and Type
    Class
    Description
    private static class 
     
    (package private) static class 
     
    (package private) static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<org.apache.nifi.processor.Relationship>
     
    protected List<org.apache.nifi.components.PropertyDescriptor>
     
    void
    onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
     

    Methods inherited from class org.apache.nifi.processor.AbstractProcessor

    onTrigger

    Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor

    getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue

    Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent

    customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.nifi.components.ConfigurableComponent

    getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate

    Methods inherited from interface org.apache.nifi.processor.Processor

    isStateful, migrateProperties, migrateRelationships
  • Field Details

    • DB_TABLE_NAME

      public static final String DB_TABLE_NAME
      See Also:
    • DB_TABLE_CATALOG

      public static final String DB_TABLE_CATALOG
      See Also:
    • DB_TABLE_SCHEMA

      public static final String DB_TABLE_SCHEMA
      See Also:
    • DB_TABLE_FULLNAME

      public static final String DB_TABLE_FULLNAME
      See Also:
    • DB_TABLE_TYPE

      public static final String DB_TABLE_TYPE
      See Also:
    • DB_TABLE_REMARKS

      public static final String DB_TABLE_REMARKS
      See Also:
    • DB_TABLE_COUNT

      public static final String 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

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
    • REL_SUCCESS

      public static final org.apache.nifi.processor.Relationship REL_SUCCESS
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
  • Constructor Details

    • ListDatabaseTables

      public ListDatabaseTables()
  • Method Details

    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.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:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException