gravitino.client.gravitino_client.GravitinoClient

class gravitino.client.gravitino_client.GravitinoClient(uri: str, metalake_name: str, check_version: bool = True, auth_data_provider: AuthDataProvider | None = None)

Bases: GravitinoClientBase

Gravitino Client for a user to interact with the Gravitino API, allowing the client to list, load, create, and alter Catalog.

It uses an underlying {@link RESTClient} to send HTTP requests and receive responses from the API.

__init__(uri: str, metalake_name: str, check_version: bool = True, auth_data_provider: AuthDataProvider | None = None)

Constructs a new GravitinoClient with the given URI, authenticator and AuthDataProvider.

Args:

uri: The base URI for the Gravitino API. metalake_name: The specified metalake name. auth_data_provider: The provider of the data which is used for authentication.

Raises:

NoSuchMetalakeException if the metalake with specified name does not exist.

Methods

__init__(uri, metalake_name[, ...])

Constructs a new GravitinoClient with the given URI, authenticator and AuthDataProvider.

alter_catalog(name, *changes)

check_metalake_name(metalake_name)

check_version()

Check the compatibility of the client with the target server.

close()

Closes the GravitinoClient and releases any underlying resources.

create_catalog(name, catalog_type, provider, ...)

disable_catalog(name)

drop_catalog(name[, force])

enable_catalog(name)

get_client_version()

Retrieves the version of the Gravitino Python Client.

get_metalake()

Get the current metalake object

get_server_version()

Retrieves the version of the Gravitino API.

list_catalogs()

list_catalogs_info()

load_catalog(name)

load_metalake(name)

Loads a specific Metalake from the Gravitino API.

Attributes

API_METALAKES_IDENTIFIER_PATH

The REST API path prefix for load a specific metalake

API_METALAKES_LIST_PATH

The REST API path for listing metalakes

API_METALAKES_IDENTIFIER_PATH = 'api/metalakes/'

The REST API path prefix for load a specific metalake

API_METALAKES_LIST_PATH = 'api/metalakes'

The REST API path for listing metalakes

check_version()

Check the compatibility of the client with the target server.

Raises:

GravitinoRuntimeException If the client version is greater than the server version.

close()

Closes the GravitinoClient and releases any underlying resources.

get_client_version() GravitinoVersion

Retrieves the version of the Gravitino Python Client.

Returns:

A GravitinoVersion instance representing the version of the Gravitino Python Client.

get_metalake() GravitinoMetalake

Get the current metalake object

Raises:

NoSuchMetalakeException if the metalake with specified name does not exist.

Returns:

the GravitinoMetalake object

get_server_version() GravitinoVersion

Retrieves the version of the Gravitino API.

Returns:

A GravitinoVersion instance representing the version of the Gravitino API.

load_metalake(name: str) GravitinoMetalake

Loads a specific Metalake from the Gravitino API.

Args:

name: The name of the Metalake to be loaded.

Returns:

A GravitinoMetalake instance representing the loaded Metalake.

Raises:

NoSuchMetalakeException If the specified Metalake does not exist.