@EventDriven @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"hadoop","hbase","put","record"}) @CapabilityDescription(value="Adds rows to HBase based on the contents of a flowfile using a configured record reader.") @ReadsAttribute(attribute="restart.index", description="Reads restart.index when it needs to replay part of a record set that did not get into HBase.") @WritesAttribute(attribute="restart.index", description="Writes restart.index when a batch fails to be insert into HBase") public class PutHBaseRecord extends AbstractPutHBase
Modifier and Type | Field and Description |
---|---|
protected static PropertyDescriptor |
BATCH_SIZE |
protected static AllowableValue |
COMPLEX_FIELD_FAIL |
protected static AllowableValue |
COMPLEX_FIELD_IGNORE |
protected static PropertyDescriptor |
COMPLEX_FIELD_STRATEGY |
protected static AllowableValue |
COMPLEX_FIELD_TEXT |
protected static AllowableValue |
COMPLEX_FIELD_WARN |
protected static java.lang.String |
FAIL_VALUE |
protected static AllowableValue |
FIELD_ENCODING_BYTES |
protected static PropertyDescriptor |
FIELD_ENCODING_STRATEGY |
protected static AllowableValue |
FIELD_ENCODING_STRING |
protected static java.lang.String |
IGNORE_VALUE |
protected static PropertyDescriptor |
ROW_FIELD_NAME |
protected static java.lang.String |
TEXT_VALUE |
protected static PropertyDescriptor |
TIMESTAMP_FIELD_NAME |
protected static java.lang.String |
WARN_VALUE |
clientService, COLUMN_FAMILY, COLUMN_QUALIFIER, HBASE_CLIENT_SERVICE, REL_FAILURE, REL_SUCCESS, ROW_ID, ROW_ID_ENCODING_BINARY, ROW_ID_ENCODING_STRING, TABLE_NAME, TIMESTAMP
Constructor and Description |
---|
PutHBaseRecord() |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
asBytes(java.lang.String field,
RecordFieldType fieldType,
Record record,
boolean asString,
java.lang.String complexFieldStrategy) |
protected PutFlowFile |
createPut(ProcessContext context,
Record record,
RecordSchema schema,
FlowFile flowFile,
java.lang.String rowFieldName,
java.lang.String columnFamily,
java.lang.String timestampFieldName,
java.lang.String fieldEncodingStrategy,
java.lang.String rowEncodingStrategy,
java.lang.String complexFieldStrategy) |
protected PutFlowFile |
createPut(ProcessSession session,
ProcessContext context,
FlowFile flowFile)
Sub-classes provide the implementation to create a put from a FlowFile.
|
java.util.Set<Relationship> |
getRelationships() |
java.util.List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Allows subclasses to register which property descriptor objects are
supported.
|
protected java.lang.String |
getTransitUri(PutFlowFile putFlowFile) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
getRow, onScheduled
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
protected static final PropertyDescriptor ROW_FIELD_NAME
protected static final PropertyDescriptor TIMESTAMP_FIELD_NAME
protected static final java.lang.String FAIL_VALUE
protected static final java.lang.String WARN_VALUE
protected static final java.lang.String IGNORE_VALUE
protected static final java.lang.String TEXT_VALUE
protected static final AllowableValue COMPLEX_FIELD_FAIL
protected static final AllowableValue COMPLEX_FIELD_WARN
protected static final AllowableValue COMPLEX_FIELD_IGNORE
protected static final AllowableValue COMPLEX_FIELD_TEXT
protected static final PropertyDescriptor COMPLEX_FIELD_STRATEGY
protected static final AllowableValue FIELD_ENCODING_STRING
protected static final AllowableValue FIELD_ENCODING_BYTES
protected static final PropertyDescriptor FIELD_ENCODING_STRATEGY
protected static final PropertyDescriptor BATCH_SIZE
public final java.util.List<PropertyDescriptor> getSupportedPropertyDescriptors()
AbstractConfigurableComponent
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public java.util.Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractPutHBase
ProcessException
protected java.lang.String getTransitUri(PutFlowFile putFlowFile)
getTransitUri
in class AbstractPutHBase
protected PutFlowFile createPut(ProcessSession session, ProcessContext context, FlowFile flowFile)
AbstractPutHBase
createPut
in class AbstractPutHBase
session
- the current sessioncontext
- the current contextflowFile
- the FlowFile to create a Put fromprotected byte[] asBytes(java.lang.String field, RecordFieldType fieldType, Record record, boolean asString, java.lang.String complexFieldStrategy) throws org.apache.nifi.hbase.PutHBaseRecord.PutCreationFailedInvokedException
org.apache.nifi.hbase.PutHBaseRecord.PutCreationFailedInvokedException
protected PutFlowFile createPut(ProcessContext context, Record record, RecordSchema schema, FlowFile flowFile, java.lang.String rowFieldName, java.lang.String columnFamily, java.lang.String timestampFieldName, java.lang.String fieldEncodingStrategy, java.lang.String rowEncodingStrategy, java.lang.String complexFieldStrategy) throws org.apache.nifi.hbase.PutHBaseRecord.PutCreationFailedInvokedException
org.apache.nifi.hbase.PutHBaseRecord.PutCreationFailedInvokedException