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,
com.datastrato.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 |
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.
|
GravitinoMetalake |
loadMetalake(NameIdentifier ident)
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, com.datastrato.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(NameIdentifier ident) throws NoSuchMetalakeException
ident
- The identifier of the Metalake to be loaded.NoSuchMetalakeException
- If the specified Metalake does not exist.@Deprecated @InlineMe(replacement="this.serverVersion()") public final GravitinoVersion getVersion()
public GravitinoVersion serverVersion()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable