@Private
@Evolving
public class RegistryPathUtils
extends java.lang.Object
| Constructor | Description |
|---|---|
RegistryPathUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.String |
createFullPath(java.lang.String base,
java.lang.String path) |
Create a full path from the registry root and the supplied subdir
|
static java.lang.String |
encodeForRegistry(java.lang.String element) |
Perform any formatting for the registry needed to convert
non-simple-DNS elements
|
static java.lang.String |
encodeYarnID(java.lang.String yarnId) |
Perform whatever transforms are needed to get a YARN ID into
a DNS-compatible name
|
static java.lang.String |
getUsername(java.lang.String recPath) |
Return the username found in the ZK path.
|
static java.lang.String |
join(java.lang.String base,
java.lang.String path) |
Join two paths, guaranteeing that there will not be exactly
one separator between the two, and exactly one at the front
of the path.
|
static java.lang.String |
lastPathEntry(java.lang.String path) |
Get the last entry in a path; for an empty path
returns "".
|
static java.lang.String |
parentOf(java.lang.String path) |
Get the parent of a path
|
static java.util.List<java.lang.String> |
split(java.lang.String path) |
split a path into elements, stripping empty elements
|
static java.lang.String |
validateElementsAsDNS(java.lang.String path) |
Validate ZK path as valid for a DNS hostname.
|
static java.lang.String |
validateZKPath(java.lang.String path) |
Validate ZK path with the path itself included in
the exception text
|
public static java.lang.String validateZKPath(java.lang.String path)
throws InvalidPathnameException
path - path to validateInvalidPathnameException - if the pathname is invalid.public static java.lang.String validateElementsAsDNS(java.lang.String path)
throws InvalidPathnameException
path - path to validateInvalidPathnameException - if the pathname is invalid.public static java.lang.String createFullPath(java.lang.String base,
java.lang.String path)
throws InvalidPathnameException
path - path of operationInvalidPathnameException - if the path is invalidpublic static java.lang.String join(java.lang.String base,
java.lang.String path)
base - base pathpath - second path to addpublic static java.util.List<java.lang.String> split(java.lang.String path)
path - the pathpublic static java.lang.String lastPathEntry(java.lang.String path)
split(String)path - path of operationpublic static java.lang.String parentOf(java.lang.String path)
throws org.apache.hadoop.fs.PathNotFoundException
path - path to look atorg.apache.hadoop.fs.PathNotFoundException - if the path was at root.public static java.lang.String encodeForRegistry(java.lang.String element)
element - element to encodepublic static java.lang.String encodeYarnID(java.lang.String yarnId)
yarnId - ID as string of YARN application, instance or containerpublic static java.lang.String getUsername(java.lang.String recPath)
recPath - the ZK recPath.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.