@Tags(value={"db","jdbc","database","connection","record"}) @CapabilityDescription(value="Provides a service to write records using a configured database connection.") public class DatabaseRecordSink extends AbstractControllerService implements RecordSinkService
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DatabaseRecordSink.ColumnDescription |
private static class |
DatabaseRecordSink.DMLSettings |
(package private) static class |
DatabaseRecordSink.SqlAndIncludedColumns
A holder class for a SQL prepared statement and a BitSet indicating which columns are being inserted (to determine which values from the record to set on the statement)
A value of null for getIncludedColumns indicates that all columns/fields should be included.
|
(package private) static class |
DatabaseRecordSink.TableSchema |
RECORD_WRITER_FACTORY| Constructor and Description |
|---|
DatabaseRecordSink() |
| Modifier and Type | Method and Description |
|---|---|
private DatabaseRecordSink.SqlAndIncludedColumns |
generateInsert(RecordSchema recordSchema,
String tableName,
DatabaseRecordSink.TableSchema tableSchema,
DatabaseRecordSink.DMLSettings settings) |
private Set<String> |
getNormalizedColumnNames(RecordSchema schema,
boolean translateFieldNames) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ControllerServiceInitializationContext context) |
private static String |
normalizeColumnName(String colName,
boolean translateColumnNames) |
void |
onEnabled(ConfigurationContext context) |
WriteResult |
sendData(RecordSet recordSet,
Map<String,String> attributes,
boolean sendZeroResults) |
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, initialize, isEnabledcustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitresetinitialize, isStatefulgetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final AllowableValue IGNORE_UNMATCHED_FIELD
static final AllowableValue FAIL_UNMATCHED_FIELD
static final AllowableValue IGNORE_UNMATCHED_COLUMN
static final AllowableValue WARNING_UNMATCHED_COLUMN
static final AllowableValue FAIL_UNMATCHED_COLUMN
static final PropertyDescriptor DBCP_SERVICE
static final PropertyDescriptor CATALOG_NAME
static final PropertyDescriptor SCHEMA_NAME
static final PropertyDescriptor TABLE_NAME
static final PropertyDescriptor TRANSLATE_FIELD_NAMES
static final PropertyDescriptor UNMATCHED_FIELD_BEHAVIOR
static final PropertyDescriptor UNMATCHED_COLUMN_BEHAVIOR
static final PropertyDescriptor QUOTED_IDENTIFIERS
static final PropertyDescriptor QUOTED_TABLE_IDENTIFIER
static final PropertyDescriptor QUERY_TIMEOUT
private List<PropertyDescriptor> properties
private volatile ConfigurationContext context
private volatile DBCPService dbcpService
protected void init(ControllerServiceInitializationContext context)
init in class AbstractControllerServiceprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponent@OnEnabled public void onEnabled(ConfigurationContext context)
public WriteResult sendData(RecordSet recordSet, Map<String,String> attributes, boolean sendZeroResults) throws IOException
sendData in interface RecordSinkServiceIOExceptionprivate static String normalizeColumnName(String colName, boolean translateColumnNames)
private Set<String> getNormalizedColumnNames(RecordSchema schema, boolean translateFieldNames)
private DatabaseRecordSink.SqlAndIncludedColumns generateInsert(RecordSchema recordSchema, String tableName, DatabaseRecordSink.TableSchema tableSchema, DatabaseRecordSink.DMLSettings settings) throws IllegalArgumentException, SQLException
IllegalArgumentExceptionSQLExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.