I help teams fix systemic engineering issues: processes, architecture, and clarity.
→ See how I work with teams.
Extended Attributes (XAttr), familiar from UNIX-like filesystems, allow HDFS to store custom metadata alongside files and directories. Modern data platforms use these attributes for encryption tagging, data classification, backup markers, application metadata and security frameworks.
How HDFS Stores Extended Attributes
HDFS supports four namespaces, aligned with Linux kernel semantics:
- user – user-defined metadata
- security – security-related attributes (superuser only)
- system – HDFS internal use (superuser only)
- trusted – for trusted services and privileged daemons
User attributes live under the user. namespace and can be defined freely.
Names are case-sensitive; HDFS interprets them exactly as provided.
Configuration Limits
The NameNode enforces limits on attribute count and size per inode. These are configured through:
dfs.namenode.fs-limits.max-xattrs-per-inodedfs.namenode.fs-limits.max-xattr-size
Typical defaults are:
- Max attributes per inode: 32
- Max size per attribute: 16384 bytes
These values may differ by Hadoop vendor but remain consistent across modern 3.x distributions.
Setting and Reading XAttr Values
Use the current hdfs dfs command set to work with attributes.
Set an attribute
hdfs dfs -setfattr -n user.enc_default -v UTF8 /user/alo/definition_table.txt
Read attributes
hdfs dfs -getfattr -d /user/alo/definition_table.txt
Example output:
# file: /user/alo/definition_table.txt
user.enc_default="UTF8"
XAttr support is enabled by default and has no performance impact unless used extensively. Most metadata is stored efficiently and loaded only when requested.
Historical Context
Extended Attributes were originally introduced under HDFS-2006 and became generally available in Hadoop 2.5.x. Today they are a stable, widely used feature and a core building block for modern security, governance and metadata tooling.
If you need help with distributed systems, backend engineering, or data platforms, check my Services.