public abstract class AbstractDatabaseFetchProcessor extends AbstractSessionFactoryProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
COLUMN_NAMES |
protected Map<String,Integer> |
columnTypeMap |
static PropertyDescriptor |
DB_TYPE |
protected static Map<String,DatabaseAdapter> |
dbAdapters |
static PropertyDescriptor |
DBCP_SERVICE |
static String |
FRAGMENT_COUNT |
static String |
FRAGMENT_ID |
static String |
FRAGMENT_INDEX |
static String |
INITIAL_MAX_VALUE_PROP_START |
protected boolean |
isDynamicMaxValues |
protected boolean |
isDynamicTableName |
static PropertyDescriptor |
MAX_VALUE_COLUMN_NAMES |
protected Map<String,String> |
maxValueProperties |
protected static String |
NAMESPACE_DELIMITER |
protected List<PropertyDescriptor> |
propDescriptors |
static PropertyDescriptor |
QUERY_TIMEOUT |
static Relationship |
REL_SUCCESS |
protected Set<Relationship> |
relationships |
protected AtomicBoolean |
setupComplete |
static PropertyDescriptor |
SQL_QUERY |
static PropertyDescriptor |
TABLE_NAME |
private static SimpleDateFormat |
TIME_TYPE_FORMAT |
static PropertyDescriptor |
WHERE_CLAUSE |
Constructor and Description |
---|
AbstractDatabaseFetchProcessor() |
Modifier and Type | Method and Description |
---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
protected Map<String,String> |
getDefaultMaxValueProperties(ProcessContext context,
FlowFile flowFile) |
protected static String |
getLiteralByType(int type,
String value,
String databaseType)
Returns a SQL literal for the given value based on its type.
|
protected static String |
getMaxValueFromRow(ResultSet resultSet,
int columnIndex,
Integer type,
String maxValueString,
String databaseType) |
protected static String |
getStateKey(String prefix,
String columnName,
DatabaseAdapter adapter)
Construct a key string for a corresponding state value.
|
protected static StringBuilder |
getWrappedQuery(DatabaseAdapter dbAdapter,
String sqlQuery,
String tableName) |
void |
setup(ProcessContext context) |
void |
setup(ProcessContext context,
boolean shouldCleanCache,
FlowFile flowFile) |
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getRelationships, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, getSupportedPropertyDescriptors, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final String INITIAL_MAX_VALUE_PROP_START
public static final String FRAGMENT_ID
public static final String FRAGMENT_INDEX
public static final String FRAGMENT_COUNT
public static final Relationship REL_SUCCESS
protected Set<Relationship> relationships
public static final PropertyDescriptor DBCP_SERVICE
public static final PropertyDescriptor TABLE_NAME
public static final PropertyDescriptor COLUMN_NAMES
public static final PropertyDescriptor MAX_VALUE_COLUMN_NAMES
public static final PropertyDescriptor QUERY_TIMEOUT
public static final PropertyDescriptor WHERE_CLAUSE
public static final PropertyDescriptor SQL_QUERY
protected List<PropertyDescriptor> propDescriptors
protected static final String NAMESPACE_DELIMITER
public static final PropertyDescriptor DB_TYPE
protected static final Map<String,DatabaseAdapter> dbAdapters
protected volatile boolean isDynamicTableName
protected volatile boolean isDynamicMaxValues
protected final AtomicBoolean setupComplete
private static SimpleDateFormat TIME_TYPE_FORMAT
protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate
in class AbstractConfigurableComponent
public void setup(ProcessContext context)
public void setup(ProcessContext context, boolean shouldCleanCache, FlowFile flowFile)
protected static StringBuilder getWrappedQuery(DatabaseAdapter dbAdapter, String sqlQuery, String tableName)
protected static String getMaxValueFromRow(ResultSet resultSet, int columnIndex, Integer type, String maxValueString, String databaseType) throws ParseException, IOException, SQLException
ParseException
IOException
SQLException
protected static String getLiteralByType(int type, String value, String databaseType)
type
- The JDBC type for the desired literalvalue
- The value to be converted to a SQL literalprotected static String getStateKey(String prefix, String columnName, DatabaseAdapter adapter)
prefix
- A prefix may contain database and table name, or just table name, this can be nullcolumnName
- A column nameadapter
- DatabaseAdapter is used to unwrap identifiersprotected Map<String,String> getDefaultMaxValueProperties(ProcessContext context, FlowFile flowFile)
Copyright © 2020 Apache NiFi Project. All rights reserved.