The constants in HdfsConstants are used by both the client side and the server side. There are two types of constants in the class:
- Constants that are used internally by the servers or not part of the APIs. These constants are free to evolve without breaking compatibilities. For example, MAX_PATH_LENGTH is used by the NN to enforce the length of the path does not go too long. Developers are free to change the name of the constants and to move it around if necessary.
- Constants that are used by the clients, but not parts of the APIs. For example, QUOTA_DONT_SET represents an unlimited quota. The value is part of the wire protocol but the value is not. Developers are free to rename the constants but are not allowed to change the value of the constants.
- Constants that are parts of the APIs. For example, SafeModeAction is used in DistributedFileSystem. Changing the name / value of the constant will break binary compatibility, but not source code compatibility.
This jira proposes to separate the above three types of constants into different classes:
- Creating a new class HdfsConstantsServer to hold the first type of constants.
- Move HdfsConstants into the hdfs-client package. The work of separating the second and the third types of constants will be postponed in a separate jira.