Package org.apache.gravitino
Class Namespace
java.lang.Object
org.apache.gravitino.Namespace
A namespace is a sequence of levels separated by dots. It's used to identify a metalake, a
catalog or a schema. For example, "metalake1", "metalake1.catalog1" and
"metalake1.catalog1.schema1" are all valid namespaces.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Check the given condition is true.static Namespace
empty()
Get an empty namespace.boolean
static Namespace
fromString
(String namespace) Create a namespace with the given string with levels separated by dots.int
hashCode()
boolean
isEmpty()
Check if the namespace is empty.int
length()
Get the length of the namespace.level
(int pos) Get the level at the given position.String[]
levels()
Get the levels of the namespace.static Namespace
Create a namespace with the given levels.toString()
-
Method Details
-
empty
Get an empty namespace.- Returns:
- An empty namespace
-
of
Create a namespace with the given levels.- Parameters:
levels
- The levels of the namespace- Returns:
- A namespace with the given levels
-
fromString
Create a namespace with the given string with levels separated by dots.- Parameters:
namespace
- The namespace string- Returns:
- A namespace with the given levels
-
levels
Get the levels of the namespace.- Returns:
- The levels of the namespace
-
level
Get the level at the given position.- Parameters:
pos
- The position of the level- Returns:
- The level at the given position
-
length
public int length()Get the length of the namespace.- Returns:
- The length of the namespace.
-
isEmpty
public boolean isEmpty()Check if the namespace is empty.- Returns:
- True if the namespace is empty, false otherwise.
-
equals
-
hashCode
public int hashCode() -
toString
-
check
@FormatMethod public static void check(boolean expression, @FormatString String message, Object... args) Check the given condition is true. Throw anIllegalNamespaceException
if it's not.- Parameters:
expression
- The expression to check.message
- The message to throw.args
- The arguments to the message.
-