Class PutHDFS
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.hadoop.AbstractHadoopProcessor
org.apache.nifi.processors.hadoop.PutHDFS
- All Implemented Interfaces:
org.apache.nifi.components.ClassloaderIsolationKeyProvider,org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@InputRequirement(INPUT_REQUIRED)
@Tags({"hadoop","HCFS","HDFS","put","copy","filesystem"})
@CapabilityDescription("Write FlowFile data to Hadoop Distributed File System (HDFS)")
@ReadsAttribute(attribute="filename",
description="The name of the file written to HDFS comes from the value of this attribute.")
@WritesAttribute(attribute="filename",description="The name of the file written to HDFS is stored in this attribute.") @WritesAttribute(attribute="absolute.hdfs.path",description="The absolute path to the file on HDFS is stored in this attribute.") @WritesAttribute(attribute="hadoop.file.url",description="The hadoop url for the file is stored in this attribute.") @WritesAttribute(attribute="target.dir.created",description="The result(true/false) indicates if the folder is created by the processor.")
@SeeAlso(GetHDFS.class)
@Restricted(restrictions=@Restriction(requiredPermission=WRITE_DISTRIBUTED_FILESYSTEM,explanation="Provides operator the ability to delete any file that NiFi has access to in HDFS or the local filesystem."))
public class PutHDFS
extends AbstractHadoopProcessor
This processor copies FlowFiles to HDFS.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.nifi.processors.hadoop.AbstractHadoopProcessor
AbstractHadoopProcessor.ValidationResources -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.github.benmanes.caffeine.cache.Cache<org.apache.hadoop.fs.Path, org.apache.hadoop.fs.permission.AclStatus> static final org.apache.nifi.components.PropertyDescriptorprotected static final Stringprotected static final org.apache.nifi.components.AllowableValuestatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprotected static final intprotected static final Stringprotected static final org.apache.nifi.components.PropertyDescriptorstatic final Stringprotected static final Stringprotected static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorprotected static final Stringprotected static final org.apache.nifi.components.AllowableValueprivate static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprotected static final Stringprotected static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorprotected static final Stringprotected static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorprotected static final Stringprotected static final org.apache.nifi.components.AllowableValueprotected static final org.apache.nifi.components.PropertyDescriptorFields inherited from class org.apache.nifi.processors.hadoop.AbstractHadoopProcessor
ABSOLUTE_HDFS_PATH_ATTRIBUTE, ADDITIONAL_CLASSPATH_RESOURCES, COMPRESSION_CODEC, DIRECTORY, HADOOP_CONFIGURATION_RESOURCES, HADOOP_FILE_URL_ATTRIBUTE, hdfsResources, KERBEROS_USER_SERVICE, TARGET_HDFS_DIR_CREATED_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchangeOwner(org.apache.nifi.processor.ProcessContext context, org.apache.hadoop.fs.FileSystem hdfs, org.apache.hadoop.fs.Path name, org.apache.nifi.flowfile.FlowFile flowFile) protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) protected longgetBlockSize(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.hadoop.fs.Path dirPath) protected intgetBufferSize(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile) protected org.apache.nifi.processor.Relationshipprotected StringgetGroup(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) protected StringgetOwner(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) Set<org.apache.nifi.processor.Relationship> protected shortgetReplication(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.hadoop.fs.Path dirPath) protected org.apache.nifi.processor.Relationshipprotected List<org.apache.nifi.components.PropertyDescriptor> voidonScheduled(org.apache.nifi.processor.ProcessContext context) voidvoidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) protected voidpreProcessConfiguration(org.apache.hadoop.conf.Configuration config, org.apache.nifi.processor.ProcessContext context) protected booleanshouldIgnoreLocality(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processors.hadoop.AbstractHadoopProcessor
abstractOnScheduled, abstractOnStopped, checkHdfsUriForTimeout, findCause, getClassloaderIsolationKey, getCommonPropertyDescriptors, getCompressionCodec, getConfigLocations, getConfiguration, getFileSystem, getFileSystem, getFileSystemAsUser, getHadoopConfigurationForValidation, getNormalizedPath, getNormalizedPath, getNormalizedPath, getPathDifference, getUserGroupInformation, handleAuthErrors, init, isFileSystemAccessDenied, isLocalFileSystemAccessDenied, migrateProperties, resetHDFSResources, validateFileSystemMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateRelationships
-
Field Details
-
BUFFER_SIZE_KEY
- See Also:
-
BUFFER_SIZE_DEFAULT
protected static final int BUFFER_SIZE_DEFAULT- See Also:
-
aclCache
private com.github.benmanes.caffeine.cache.Cache<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.permission.AclStatus> aclCache -
REL_SUCCESS
public static final org.apache.nifi.processor.Relationship REL_SUCCESS -
REL_FAILURE
public static final org.apache.nifi.processor.Relationship REL_FAILURE -
DEFAULT_APPEND_MODE
- See Also:
-
AVRO_APPEND_MODE
- See Also:
-
REPLACE_RESOLUTION
- See Also:
-
IGNORE_RESOLUTION
- See Also:
-
FAIL_RESOLUTION
- See Also:
-
APPEND_RESOLUTION
- See Also:
-
WRITE_AND_RENAME
- See Also:
-
SIMPLE_WRITE
- See Also:
-
REPLACE_RESOLUTION_AV
protected static final org.apache.nifi.components.AllowableValue REPLACE_RESOLUTION_AV -
IGNORE_RESOLUTION_AV
protected static final org.apache.nifi.components.AllowableValue IGNORE_RESOLUTION_AV -
FAIL_RESOLUTION_AV
protected static final org.apache.nifi.components.AllowableValue FAIL_RESOLUTION_AV -
APPEND_RESOLUTION_AV
protected static final org.apache.nifi.components.AllowableValue APPEND_RESOLUTION_AV -
WRITE_AND_RENAME_AV
protected static final org.apache.nifi.components.AllowableValue WRITE_AND_RENAME_AV -
SIMPLE_WRITE_AV
protected static final org.apache.nifi.components.AllowableValue SIMPLE_WRITE_AV -
CONFLICT_RESOLUTION
protected static final org.apache.nifi.components.PropertyDescriptor CONFLICT_RESOLUTION -
WRITING_STRATEGY
protected static final org.apache.nifi.components.PropertyDescriptor WRITING_STRATEGY -
APPEND_MODE
public static final org.apache.nifi.components.PropertyDescriptor APPEND_MODE -
BLOCK_SIZE
public static final org.apache.nifi.components.PropertyDescriptor BLOCK_SIZE -
BUFFER_SIZE
public static final org.apache.nifi.components.PropertyDescriptor BUFFER_SIZE -
REPLICATION_FACTOR
public static final org.apache.nifi.components.PropertyDescriptor REPLICATION_FACTOR -
UMASK
public static final org.apache.nifi.components.PropertyDescriptor UMASK -
REMOTE_OWNER
public static final org.apache.nifi.components.PropertyDescriptor REMOTE_OWNER -
REMOTE_GROUP
public static final org.apache.nifi.components.PropertyDescriptor REMOTE_GROUP -
IGNORE_LOCALITY
public static final org.apache.nifi.components.PropertyDescriptor IGNORE_LOCALITY -
RELATIONSHIPS
-
PROPERTY_DESCRIPTORS
-
-
Constructor Details
-
PutHDFS
public PutHDFS()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classAbstractHadoopProcessor
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) - Overrides:
customValidatein classAbstractHadoopProcessor
-
preProcessConfiguration
protected void preProcessConfiguration(org.apache.hadoop.conf.Configuration config, org.apache.nifi.processor.ProcessContext context) - Overrides:
preProcessConfigurationin classAbstractHadoopProcessor
-
onScheduled
@OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context) -
onStopped
@OnStopped public void onStopped() -
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
getSuccessRelationship
protected org.apache.nifi.processor.Relationship getSuccessRelationship() -
getFailureRelationship
protected org.apache.nifi.processor.Relationship getFailureRelationship() -
getBlockSize
protected long getBlockSize(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.hadoop.fs.Path dirPath) -
getBufferSize
protected int getBufferSize(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile) -
getReplication
protected short getReplication(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.hadoop.fs.Path dirPath) -
shouldIgnoreLocality
protected boolean shouldIgnoreLocality(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) -
getOwner
protected String getOwner(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) -
getGroup
protected String getGroup(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) -
changeOwner
protected void changeOwner(org.apache.nifi.processor.ProcessContext context, org.apache.hadoop.fs.FileSystem hdfs, org.apache.hadoop.fs.Path name, org.apache.nifi.flowfile.FlowFile flowFile)
-