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.
  • Field Details

    • BUFFER_SIZE_KEY

      protected static final String 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

      public static final String DEFAULT_APPEND_MODE
      See Also:
    • AVRO_APPEND_MODE

      public static final String AVRO_APPEND_MODE
      See Also:
    • REPLACE_RESOLUTION

      protected static final String REPLACE_RESOLUTION
      See Also:
    • IGNORE_RESOLUTION

      protected static final String IGNORE_RESOLUTION
      See Also:
    • FAIL_RESOLUTION

      protected static final String FAIL_RESOLUTION
      See Also:
    • APPEND_RESOLUTION

      protected static final String APPEND_RESOLUTION
      See Also:
    • WRITE_AND_RENAME

      protected static final String WRITE_AND_RENAME
      See Also:
    • SIMPLE_WRITE

      protected static final String 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

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
  • Constructor Details

    • PutHDFS

      public PutHDFS()
  • Method Details

    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class AbstractHadoopProcessor
    • customValidate

      protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext)
      Overrides:
      customValidate in class AbstractHadoopProcessor
    • preProcessConfiguration

      protected void preProcessConfiguration(org.apache.hadoop.conf.Configuration config, org.apache.nifi.processor.ProcessContext context)
      Overrides:
      preProcessConfiguration in class AbstractHadoopProcessor
    • 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:
      onTrigger in class org.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)