@SystemResourceConsideration(resource=MEMORY) @EventDriven @SupportsBatching @RequiresInstanceClassLoading @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"put","database","NoSQL","kudu","HDFS","record"}) @CapabilityDescription(value="Reads records from an incoming FlowFile using the provided Record Reader, and writes those records to the specified Kudu\'s table. The schema for the Kudu table is inferred from the schema of the Record Reader. If any error occurs while reading records from the input, or writing records to Kudu, the FlowFile will be routed to failure") @WritesAttribute(attribute="record.count", description="Number of records written to Kudu") public class PutKudu extends AbstractKuduProcessor
| Modifier and Type | Class and Description |
|---|---|
private static class |
PutKudu.RecordPathOperationType |
KERBEROS_CREDENTIALS_SERVICE, KERBEROS_PASSWORD, KERBEROS_PRINCIPAL, KERBEROS_USER_SERVICE, KUDU_KEEP_ALIVE_PERIOD_TIMEOUT_MS, KUDU_MASTERS, KUDU_OPERATION_TIMEOUT_MS, KUDU_SASL_PROTOCOL_NAME, WORKER_COUNT| Constructor and Description |
|---|
PutKudu() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.kudu.client.Operation |
createKuduOperation(OperationType operationType,
Record record,
List<String> fieldNames,
boolean ignoreNull,
boolean lowercaseFields,
org.apache.kudu.client.KuduTable kuduTable) |
protected org.apache.kudu.client.KuduSession |
createKuduSession(org.apache.kudu.client.KuduClient client) |
private String |
getEvaluatedProperty(PropertyDescriptor property,
ProcessContext context,
FlowFile flowFile) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
private boolean |
handleSchemaDrift(org.apache.kudu.client.KuduTable kuduTable,
org.apache.kudu.client.KuduClient kuduClient,
FlowFile flowFile,
Record record,
boolean lowercaseFields) |
private boolean |
isRollbackOnFailure() |
private void |
logFailures(List<org.apache.kudu.client.RowError> pendingRowErrors,
Map<org.apache.kudu.client.Operation,FlowFile> operationFlowFileMap) |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
private void |
processFlowFiles(ProcessContext context,
ProcessSession session,
List<FlowFile> flowFiles,
org.apache.kudu.client.KuduClient kuduClient) |
private void |
processRecords(List<FlowFile> flowFiles,
Map<FlowFile,Integer> processedRecords,
Map<FlowFile,Object> flowFileFailures,
Map<org.apache.kudu.client.Operation,FlowFile> operationFlowFileMap,
List<org.apache.kudu.client.RowError> pendingRowErrors,
ProcessSession session,
ProcessContext context,
org.apache.kudu.client.KuduClient kuduClient,
org.apache.kudu.client.KuduSession kuduSession) |
private void |
transferFlowFiles(List<FlowFile> flowFiles,
Map<FlowFile,Integer> processedRecords,
Map<FlowFile,Object> flowFileFailures,
Map<org.apache.kudu.client.Operation,FlowFile> operationFlowFileMap,
List<org.apache.kudu.client.RowError> pendingRowErrors,
ProcessSession session) |
buildClient, buildPartialRow, createKerberosKeytabUser, createKerberosPasswordUser, createKerberosUserAndOrKuduClient, createKuduClient, customValidate, executeOnKuduClient, flushKuduSession, getAddNullableColumnStatement, getKerberosUser, shutdown, supportsIgnoreOperationsonTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final AllowableValue FAILURE_STRATEGY_ROUTE
static final AllowableValue FAILURE_STRATEGY_ROLLBACK
protected static final PropertyDescriptor TABLE_NAME
public static final PropertyDescriptor RECORD_READER
static final PropertyDescriptor FAILURE_STRATEGY
protected static final PropertyDescriptor SKIP_HEAD_LINE
protected static final PropertyDescriptor LOWERCASE_FIELD_NAMES
protected static final PropertyDescriptor HANDLE_SCHEMA_DRIFT
static final PropertyDescriptor DATA_RECORD_PATH
static final PropertyDescriptor OPERATION_RECORD_PATH
protected static final Validator OperationTypeValidator
protected static final PropertyDescriptor INSERT_OPERATION
protected static final PropertyDescriptor FLUSH_MODE
protected static final PropertyDescriptor FLOWFILE_BATCH_SIZE
protected static final PropertyDescriptor BATCH_SIZE
protected static final PropertyDescriptor IGNORE_NULL
protected static final Relationship REL_SUCCESS
protected static final Relationship REL_FAILURE
public static final String RECORD_COUNT_ATTR
private volatile int batchSize
private volatile int ffbatch
private volatile org.apache.kudu.client.SessionConfiguration.FlushMode flushMode
private volatile Function<Record,OperationType> recordPathOperationType
private volatile RecordPath dataRecordPath
private volatile String failureStrategy
private volatile boolean supportsInsertIgnoreOp
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessor@OnScheduled public void onScheduled(ProcessContext context) throws LoginException
LoginExceptionprivate boolean isRollbackOnFailure()
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionprivate void processFlowFiles(ProcessContext context, ProcessSession session, List<FlowFile> flowFiles, org.apache.kudu.client.KuduClient kuduClient)
private void processRecords(List<FlowFile> flowFiles, Map<FlowFile,Integer> processedRecords, Map<FlowFile,Object> flowFileFailures, Map<org.apache.kudu.client.Operation,FlowFile> operationFlowFileMap, List<org.apache.kudu.client.RowError> pendingRowErrors, ProcessSession session, ProcessContext context, org.apache.kudu.client.KuduClient kuduClient, org.apache.kudu.client.KuduSession kuduSession)
private boolean handleSchemaDrift(org.apache.kudu.client.KuduTable kuduTable,
org.apache.kudu.client.KuduClient kuduClient,
FlowFile flowFile,
Record record,
boolean lowercaseFields)
private void transferFlowFiles(List<FlowFile> flowFiles, Map<FlowFile,Integer> processedRecords, Map<FlowFile,Object> flowFileFailures, Map<org.apache.kudu.client.Operation,FlowFile> operationFlowFileMap, List<org.apache.kudu.client.RowError> pendingRowErrors, ProcessSession session)
private void logFailures(List<org.apache.kudu.client.RowError> pendingRowErrors, Map<org.apache.kudu.client.Operation,FlowFile> operationFlowFileMap)
private String getEvaluatedProperty(PropertyDescriptor property, ProcessContext context, FlowFile flowFile)
protected org.apache.kudu.client.KuduSession createKuduSession(org.apache.kudu.client.KuduClient client)
protected org.apache.kudu.client.Operation createKuduOperation(OperationType operationType, Record record, List<String> fieldNames, boolean ignoreNull, boolean lowercaseFields, org.apache.kudu.client.KuduTable kuduTable)
Copyright © 2023 Apache NiFi Project. All rights reserved.