Class ServiceConfig.HdfsNative

java.lang.Object
org.apache.opendal.ServiceConfig.HdfsNative
All Implemented Interfaces:
ServiceConfig
Enclosing interface:
ServiceConfig

public static class ServiceConfig.HdfsNative extends Object implements ServiceConfig
Configuration for service hdfs-native.
  • Field Details

    • configDir

      public final String configDir

      Directory that contains the Hadoop configuration files.

      The client reads core-site.xml, hdfs-site.xml, yarn-site.xml, and mapred-site.xml from one directory: config_dir when it is set, otherwise HADOOP_CONF_DIR, otherwise $HADOOP_HOME/etc/hadoop. Setting config_dir stops the client from reading the files in HADOOP_CONF_DIR and HADOOP_HOME. Properties in options override the values from these files.

      Building the service fails with ConfigInvalid when config_dir is not a directory.

    • enableAppend

      public final Boolean enableAppend
      Deprecated.
      HDFS Native append capability is enabled by default and this option is no longer needed.

      Deprecated: HDFS Native append capability is enabled by default.

    • kerberosCache

      public final String kerberosCache

      Kerberos credential cache that the client reads tickets from.

      Requires kerberos_principal. With kerberos_keytab, the client also stores the tickets it obtains from the keytab in this cache.

    • kerberosKeytab

      public final String kerberosKeytab

      Path to the keytab that the client obtains Kerberos tickets from.

      Requires kerberos_principal. The client keeps the tickets in an in-memory credential cache that belongs to this service, unless kerberos_cache is set.

    • kerberosPrincipal

      public final String kerberosPrincipal

      Kerberos principal that the client authenticates as.

      Set hadoop.security.authentication to kerberos in options or in the Hadoop configuration files. With any kerberos_* option, building the service, for example through Operator::new, fails with ConfigInvalid when the effective value is unset or exactly simple, because the client would ignore the Kerberos settings and connect with simple authentication. Other values pass this check, and building does not connect to the cluster, so other authentication problems surface on the first operation.

      Without kerberos_keytab or kerberos_cache, the client looks up this principal's tickets in the default credential cache. When no kerberos_* option is set, a client with Kerberos authentication uses the default principal of the default credential cache.

    • nameNode

      public final String nameNode

      NameNode or cluster that the client connects to.

      • default: use fs.defaultFS from the Hadoop configuration or options.
      • hdfs://mycluster: use a logical nameservice configured in Hadoop.
      • hdfs://127.0.0.1:9000: connect to a single NameNode.
      • hdfs://namenode1:9000,namenode2:9000: connect to an HDFS HA cluster by its addresses.
      • viewfs://mycluster: use the ViewFS mount table fs.viewfs.mounttable.mycluster.* from the Hadoop configuration.
    • options

      public final Map<String,String> options

      Hadoop configuration properties for the client, such as dfs.client.socket-timeout.

      These properties override the values from the Hadoop configuration files. See config_dir for the files the client reads.

    • root

      public final String root

      work dir of this backend

    • user

      public final String user

      HDFS user that the client acts as.

      Without Kerberos, the NameNode accepts this name as the caller. When user is unset, the client uses HADOOP_USER_NAME, then the operating system user.

      With Kerberos, the authenticated principal impersonates this user. The cluster must allow the impersonation through its hadoop.proxyuser.* settings. When user is unset, the client uses HADOOP_PROXY_USER; when that is also unset, it acts as the principal.

  • Constructor Details

    • HdfsNative

      public HdfsNative()
  • Method Details

    • scheme

      public String scheme()
      Description copied from interface: ServiceConfig
      The scheme of the service.
      Specified by:
      scheme in interface ServiceConfig
      Returns:
      the scheme
    • configMap

      public Map<String,String> configMap()
      Description copied from interface: ServiceConfig
      Convert the structured config to a type erased config map.

      A map-valued field becomes one entry, under the field's option name, whose value is a JSON object string, such as assume_role_session_tags = {"Team":"data"}. The map's entries are not flattened into top-level entries. Its keys are sorted, an empty map becomes {}, and an unset field has no entry.

      Specified by:
      configMap in interface ServiceConfig
      Returns:
      the config map