public abstract class AbstractKuduProcessor extends AbstractProcessor
| Modifier and Type | Class and Description |
|---|---|
private static class |
AbstractKuduProcessor.ClientThreadFactory |
| Constructor and Description |
|---|
AbstractKuduProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.kudu.client.KuduClient |
buildClient(ProcessContext context) |
protected void |
buildPartialRow(org.apache.kudu.Schema schema,
org.apache.kudu.client.PartialRow row,
Record record,
List<String> fieldNames,
boolean ignoreNull,
boolean lowercaseFields) |
protected KerberosUser |
createKerberosKeytabUser(String principal,
String keytab,
ProcessContext context) |
protected KerberosUser |
createKerberosPasswordUser(String principal,
String password,
ProcessContext context) |
protected void |
createKerberosUserAndOrKuduClient(ProcessContext context) |
protected void |
createKuduClient(ProcessContext context) |
protected Collection<ValidationResult> |
customValidate(ValidationContext context) |
protected void |
executeOnKuduClient(Consumer<org.apache.kudu.client.KuduClient> actionOnKuduClient) |
protected void |
flushKuduSession(org.apache.kudu.client.KuduSession kuduSession,
boolean close,
List<org.apache.kudu.client.RowError> rowErrors) |
protected org.apache.kudu.client.AlterTableOptions |
getAddNullableColumnStatement(String columnName,
DataType nifiType)
Based on NiFi field declaration, generates an alter statement to extend table with new column.
|
private Date |
getDate(Object value,
String recordFieldName,
String format)
Get java.sql.Date from Record Field Value with optional parsing when input value is a String
|
protected KerberosUser |
getKerberosUser() |
private org.apache.kudu.ColumnTypeAttributes |
getKuduTypeAttributes(DataType nifiType) |
private Optional<String> |
getTimestampPattern(Optional<DataType> optionalDataType)
Get Timestamp Pattern and override Timestamp Record Field pattern with optional microsecond pattern
|
void |
shutdown() |
protected boolean |
supportsIgnoreOperations() |
private org.apache.kudu.Type |
toKuduType(DataType nifiType)
Converts a NiFi DataType to it's equivalent Kudu Type.
|
onTrigger, onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getRelationships, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, getSupportedPropertyDescriptors, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final PropertyDescriptor KUDU_MASTERS
static final PropertyDescriptor KERBEROS_CREDENTIALS_SERVICE
static final PropertyDescriptor KERBEROS_USER_SERVICE
static final PropertyDescriptor KERBEROS_PRINCIPAL
static final PropertyDescriptor KERBEROS_PASSWORD
static final PropertyDescriptor KUDU_OPERATION_TIMEOUT_MS
static final PropertyDescriptor KUDU_KEEP_ALIVE_PERIOD_TIMEOUT_MS
private static final int DEFAULT_WORKER_COUNT
static final PropertyDescriptor WORKER_COUNT
static final PropertyDescriptor KUDU_SASL_PROTOCOL_NAME
private static final FieldConverter<Object,Timestamp> TIMESTAMP_FIELD_CONVERTER
private static final String MICROSECOND_TIMESTAMP_PATTERN
private volatile org.apache.kudu.client.KuduClient kuduClient
private final ReadWriteLock kuduClientReadWriteLock
private final Lock kuduClientReadLock
private final Lock kuduClientWriteLock
private volatile KerberosUser kerberosUser
protected KerberosUser getKerberosUser()
protected boolean supportsIgnoreOperations()
protected void createKerberosUserAndOrKuduClient(ProcessContext context)
protected void createKuduClient(ProcessContext context)
protected org.apache.kudu.client.KuduClient buildClient(ProcessContext context)
protected void executeOnKuduClient(Consumer<org.apache.kudu.client.KuduClient> actionOnKuduClient)
protected void flushKuduSession(org.apache.kudu.client.KuduSession kuduSession,
boolean close,
List<org.apache.kudu.client.RowError> rowErrors)
throws org.apache.kudu.client.KuduException
org.apache.kudu.client.KuduExceptionprotected KerberosUser createKerberosKeytabUser(String principal, String keytab, ProcessContext context)
protected KerberosUser createKerberosPasswordUser(String principal, String password, ProcessContext context)
protected Collection<ValidationResult> customValidate(ValidationContext context)
customValidate in class AbstractConfigurableComponent@OnStopped public void shutdown() throws Exception
Exceptionprotected void buildPartialRow(org.apache.kudu.Schema schema,
org.apache.kudu.client.PartialRow row,
Record record,
List<String> fieldNames,
boolean ignoreNull,
boolean lowercaseFields)
private Optional<String> getTimestampPattern(Optional<DataType> optionalDataType)
optionalDataType - Optional Data Typeprivate Date getDate(Object value, String recordFieldName, String format)
value - Record Field ValuerecordFieldName - Record Field Nameformat - Date Format Patternprivate org.apache.kudu.Type toKuduType(DataType nifiType)
private org.apache.kudu.ColumnTypeAttributes getKuduTypeAttributes(DataType nifiType)
protected org.apache.kudu.client.AlterTableOptions getAddNullableColumnStatement(String columnName, DataType nifiType)
AlterTableOptions.addNullableColumn(String, Type) is not sufficient as it does not cover BigDecimal scale and precision handling.columnName - Name of the new table column.nifiType - Type of the field.Copyright © 2024 Apache NiFi Project. All rights reserved.