Class AbstractDatabaseFetchProcessor
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processors.standard.AbstractDatabaseFetchProcessor
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
- Direct Known Subclasses:
AbstractQueryDatabaseTable,GenerateTableFetch
public abstract class AbstractDatabaseFetchProcessor
extends org.apache.nifi.processor.AbstractSessionFactoryProcessor
A base class for common code shared by processors that fetch RDBMS data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected booleanprotected booleanstatic final org.apache.nifi.components.PropertyDescriptorprotected static final Stringprotected List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.processor.Relationshipprotected Set<org.apache.nifi.processor.Relationship> protected final AtomicBooleanstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate static final DateTimeFormatterstatic final org.apache.nifi.components.PropertyDescriptorprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) protected DatabaseDialectServicegetDatabaseDialectService(org.apache.nifi.context.PropertyContext context) getDefaultMaxValueProperties(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) protected static StringgetLiteralByType(int type, String value, String databaseType) Returns a SQL literal for the given value based on its type.protected static StringgetMaxValueFromRow(ResultSet resultSet, int columnIndex, Integer type, String maxValueString) private QueryStatementRequestgetMaxValueStatementRequest(String tableName, String maxValueColumnNames, String derivedTableQuery) protected static StringgetStateKey(String prefix, String columnName) Construct a key string for a corresponding state value.voidsetup(org.apache.nifi.processor.ProcessContext context) voidsetup(org.apache.nifi.processor.ProcessContext context, boolean shouldCleanCache, org.apache.nifi.flowfile.FlowFile flowFile) Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getRelationships, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, getSupportedPropertyDescriptors, 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, onTrigger
-
Field Details
-
INITIAL_MAX_VALUE_PROP_START
- See Also:
-
FRAGMENT_ID
-
FRAGMENT_INDEX
-
FRAGMENT_COUNT
-
REL_SUCCESS
public static final org.apache.nifi.processor.Relationship REL_SUCCESS -
relationships
-
DBCP_SERVICE
public static final org.apache.nifi.components.PropertyDescriptor DBCP_SERVICE -
TABLE_NAME
public static final org.apache.nifi.components.PropertyDescriptor TABLE_NAME -
COLUMN_NAMES
public static final org.apache.nifi.components.PropertyDescriptor COLUMN_NAMES -
MAX_VALUE_COLUMN_NAMES
public static final org.apache.nifi.components.PropertyDescriptor MAX_VALUE_COLUMN_NAMES -
QUERY_TIMEOUT
public static final org.apache.nifi.components.PropertyDescriptor QUERY_TIMEOUT -
WHERE_CLAUSE
public static final org.apache.nifi.components.PropertyDescriptor WHERE_CLAUSE -
SQL_QUERY
public static final org.apache.nifi.components.PropertyDescriptor SQL_QUERY -
propDescriptors
-
NAMESPACE_DELIMITER
- See Also:
-
DB_TYPE
public static final org.apache.nifi.components.PropertyDescriptor DB_TYPE -
DATABASE_DIALECT_SERVICE
static final org.apache.nifi.components.PropertyDescriptor DATABASE_DIALECT_SERVICE -
columnTypeMap
-
isDynamicTableName
protected volatile boolean isDynamicTableName -
isDynamicMaxValues
protected volatile boolean isDynamicMaxValues -
setupComplete
-
TIME_TYPE_FORMAT
-
ZERO_RESULT_WHERE_CLAUSE
- See Also:
-
maxValueProperties
-
-
Constructor Details
-
AbstractDatabaseFetchProcessor
public AbstractDatabaseFetchProcessor()
-
-
Method Details
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
setup
public void setup(org.apache.nifi.processor.ProcessContext context) -
setup
public void setup(org.apache.nifi.processor.ProcessContext context, boolean shouldCleanCache, org.apache.nifi.flowfile.FlowFile flowFile) -
getDatabaseDialectService
protected DatabaseDialectService getDatabaseDialectService(org.apache.nifi.context.PropertyContext context) -
getMaxValueStatementRequest
private QueryStatementRequest getMaxValueStatementRequest(String tableName, String maxValueColumnNames, String derivedTableQuery) -
getMaxValueFromRow
protected static String getMaxValueFromRow(ResultSet resultSet, int columnIndex, Integer type, String maxValueString) throws ParseException, IOException, SQLException - Throws:
ParseExceptionIOExceptionSQLException
-
getLiteralByType
Returns a SQL literal for the given value based on its type. For example, values of character type need to be enclosed in single quotes, whereas values of numeric type should not be.- Parameters:
type- The JDBC type for the desired literalvalue- The value to be converted to a SQL literal- Returns:
- A String representing the given value as a literal of the given type
-
getStateKey
Construct a key string for a corresponding state value.- Parameters:
prefix- A prefix may contain database and table name, or just table name, this can be nullcolumnName- A column name- Returns:
- a state key string
-
getDefaultMaxValueProperties
-