public abstract class GravitinoClientBase
extends java.lang.Object
implements java.io.Closeable
It uses an underlying RESTClient
to send HTTP requests and receive responses from the
API.
Modifier and Type | Class and Description |
---|---|
static class |
GravitinoClientBase.Builder<T>
Builder class for constructing a GravitinoClient.
|
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
API_METALAKES_IDENTIFIER_PATH
The REST API path prefix for load a specific metalake
|
protected static java.lang.String |
API_METALAKES_LIST_PATH
The REST API path for listing metalakes
|
protected RESTClient |
restClient
The REST client to communicate with the REST server
|
Modifier | Constructor and Description |
---|---|
protected |
GravitinoClientBase(java.lang.String uri,
org.apache.gravitino.client.AuthDataProvider authDataProvider,
boolean checkVersion,
java.util.Map<java.lang.String,java.lang.String> headers)
Constructs a new GravitinoClient with the given URI, authenticator and AuthDataProvider.
|
Modifier and Type | Method and Description |
---|---|
void |
checkMetalakeName(java.lang.String metalakeName)
Checks the validity of the Metalake name.
|
void |
checkVersion()
Check the compatibility of the client with the target server.
|
GravitinoVersion |
clientVersion()
Retrieves the version of the Gravitino client.
|
void |
close()
Closes the GravitinoClient and releases any underlying resources.
|
GravitinoVersion |
getVersion()
Deprecated.
This method is deprecated because it is a duplicate of
serverVersion() .
Use serverVersion() instead for clarity and consistency. |
GravitinoMetalake |
loadMetalake(java.lang.String metalakeName)
Loads a specific Metalake from the Gravitino API.
|
GravitinoVersion |
serverVersion()
Retrieves the server version of the Gravitino server.
|
protected final RESTClient restClient
protected static final java.lang.String API_METALAKES_LIST_PATH
protected static final java.lang.String API_METALAKES_IDENTIFIER_PATH
protected GravitinoClientBase(java.lang.String uri, org.apache.gravitino.client.AuthDataProvider authDataProvider, boolean checkVersion, java.util.Map<java.lang.String,java.lang.String> headers)
uri
- The base URI for the Gravitino API.authDataProvider
- The provider of the data which is used for authentication.checkVersion
- Whether to check the version of the Gravitino server.headers
- The base header of the Gravitino API.public void checkVersion()
GravitinoRuntimeException
- If the client version is greater than the server version.public GravitinoVersion clientVersion()
public GravitinoMetalake loadMetalake(java.lang.String metalakeName) throws NoSuchMetalakeException
metalakeName
- The name of the Metalake to be loaded.NoSuchMetalakeException
- If the specified Metalake does not exist.public void checkMetalakeName(java.lang.String metalakeName)
metalakeName
- the name of the Metalake to be checked.IllegalNameIdentifierException
- If the Metalake name is invalid.@Deprecated @InlineMe(replacement="this.serverVersion()") public final GravitinoVersion getVersion()
serverVersion()
.
Use serverVersion()
instead for clarity and consistency.public GravitinoVersion serverVersion()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable