Class HDFSExternalResourceProvider

java.lang.Object
org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider
All Implemented Interfaces:
org.apache.nifi.flow.resource.ExternalResourceProvider

@RequiresInstanceClassLoading(cloneAncestorResources=true) public class HDFSExternalResourceProvider extends Object implements org.apache.nifi.flow.resource.ExternalResourceProvider
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • RESOURCES_PARAMETER

      private static final String RESOURCES_PARAMETER
      See Also:
    • SOURCE_DIRECTORY_PARAMETER

      private static final String SOURCE_DIRECTORY_PARAMETER
      See Also:
    • STORAGE_LOCATION

      private static final String STORAGE_LOCATION
      See Also:
    • KERBEROS_PRINCIPAL_PARAMETER

      private static final String KERBEROS_PRINCIPAL_PARAMETER
      See Also:
    • KERBEROS_KEYTAB_PARAMETER

      private static final String KERBEROS_KEYTAB_PARAMETER
      See Also:
    • KERBEROS_PASSWORD_PARAMETER

      private static final String KERBEROS_PASSWORD_PARAMETER
      See Also:
    • RESOURCES_LOCK

      private static final Object RESOURCES_LOCK
    • STORAGE_LOCATION_PROPERTY

      private static final String STORAGE_LOCATION_PROPERTY
      See Also:
    • BUFFER_SIZE_DEFAULT

      private static final int BUFFER_SIZE_DEFAULT
      See Also:
    • DELIMITER

      private static final String DELIMITER
      See Also:
    • resources

      private volatile List<String> resources
    • sourceDirectory

      private volatile org.apache.hadoop.fs.Path sourceDirectory
    • storageLocation

      private volatile String storageLocation
    • context

      private volatile org.apache.nifi.flow.resource.ExternalResourceProviderInitializationContext context
    • initialized

      private volatile boolean initialized
  • Constructor Details

    • HDFSExternalResourceProvider

      public HDFSExternalResourceProvider()
  • Method Details

    • initialize

      public void initialize(org.apache.nifi.flow.resource.ExternalResourceProviderInitializationContext context)
      Specified by:
      initialize in interface org.apache.nifi.flow.resource.ExternalResourceProvider
    • listResources

      public Collection<org.apache.nifi.flow.resource.ExternalResourceDescriptor> listResources() throws IOException
      Specified by:
      listResources in interface org.apache.nifi.flow.resource.ExternalResourceProvider
      Throws:
      IOException
    • convertStatusToDescriptor

      private static org.apache.nifi.flow.resource.ExternalResourceDescriptor convertStatusToDescriptor(org.apache.hadoop.fs.FileStatus fileStatus)
    • fetchExternalResource

      public InputStream fetchExternalResource(org.apache.nifi.flow.resource.ExternalResourceDescriptor descriptor) throws IOException
      Specified by:
      fetchExternalResource in interface org.apache.nifi.flow.resource.ExternalResourceProvider
      Throws:
      IOException
    • getLocation

      private org.apache.hadoop.fs.Path getLocation(String location)
    • getHdfsResources

      private HdfsResources getHdfsResources() throws IOException
      Throws:
      IOException
    • checkHdfsUriForTimeout

      private void checkHdfsUriForTimeout(org.apache.hadoop.conf.Configuration config) throws IOException
      Throws:
      IOException
    • getFileSystemAsUser

      private org.apache.hadoop.fs.FileSystem getFileSystemAsUser(org.apache.hadoop.conf.Configuration config, org.apache.hadoop.security.UserGroupInformation ugi) throws IOException
      Throws:
      IOException