Skip to main content

Fileset Catalog

Overview

A fileset catalog manages filesets over a Hadoop Compatible File System. Gravitino owns the catalog rather than federating an external one, so no provider is needed when creating it, and the same catalog, schema, and fileset model works over HDFS, a local filesystem, or object storage.

What changes per storage system is small: a bundle jar on the classpath, the URI scheme in the location, and a few credential properties. Creating and managing the objects is covered in Manage Fileset Metadata, and reading and writing the files in How to Use GVFS. Neither changes because the data sits in S3 rather than HDFS, which is the point of the indirection described in Filesets.

The catalog is built against Hadoop 3 but uses no Hadoop 3 features, so Hadoop 2.x should also work. Report any incompatibility as an issue.

Catalog Properties

These apply in addition to the common catalog properties.

Property NameDescriptionDefault Value
locationBase storage location, named unknown. Always a directory or path prefix, never a single file(none)
location-Prefix for named locations, as location-{name}={path}(none)
credential-providersCredential provider types, separated by commas(none)
config.resourcesConfiguration files to load, separated by commas, such as hdfs-site.xml,core-site.xml(none)
filesystem-conn-timeout-secsTimeout when obtaining a filesystem client, in seconds6
disable-filesystem-opsStops the server creating and removing directories when schemas and filesets are created and droppedfalse
fileset-cache-eviction-interval-msFileset cache eviction interval, where -1 never evicts3600000
fileset-cache-max-sizeMaximum filesets held in the cache, where -1 is unlimited200000
fs.path.config.<n>A logical location entry set to a base URI such as hdfs://cluster1/. Keys sharing the prefix are forwarded to that filesystem client(none)

default-filesystem-provider and filesystem-providers are deprecated and no longer needed. The catalog loads filesystem providers from the classpath, including cloud providers whenever the matching bundle jar is present.

Storage Backends

HDFS and local filesystems need no bundle jar and no credential properties. Object storage needs a jar in ${GRAVITINO_HOME}/catalogs/fileset/libs/ and a server restart, plus the properties below.

Storage SystemBundle JarURI SchemeCredential Providers
Amazon S3gravitino-aws-bundles3a://s3-token, s3-secret-key
Google Cloud Storagegravitino-gcp-bundlegs://gcs-token
Azure Data Lake Storagegravitino-azure-bundleabfss://adls-token, azure-account-key
Alibaba Cloud OSSgravitino-aliyun-bundleoss://oss-token, oss-secret-key
Tencent Cloud COSgravitino-tencent-bundlecosn://cos-secret-key
HDFS and localNone, built inhdfs://, file://None

Bundle jars are published on Maven Central and versioned with the server.

The GVFS client takes the same property names as the catalog, so a client reading an S3 fileset sets s3-endpoint, s3-access-key-id, and s3-secret-access-key alongside its base GVFS configuration. Setting credential-providers on the catalog removes that requirement, since Gravitino then issues short-lived credentials per request and the client holds no cloud keys at all. See Credential Vending.

Amazon S3

Property NameDescriptionRequired
s3-endpointEndpoint of the S3 serviceYes
s3-access-key-idAccess keyYes
s3-secret-access-keySecret keyYes

S3-compatible storage such as MinIO uses the same properties with its own endpoint.

curl -X POST -H "Content-Type: application/json" \
-d '{
"name": "{catalog_name}",
"type": "FILESET",
"comment": "",
"properties": {
"location": "s3a://{bucket}/{prefix}",
"s3-endpoint": "{endpoint}",
"s3-access-key-id": "{access_key_id}",
"s3-secret-access-key": "{secret_access_key}"
}
}' \
http://localhost:8090/api/metalakes/{metalake}/catalogs

Google Cloud Storage

Property NameDescriptionRequired
gcs-service-account-filePath to the service account JSON fileYes

The path is read wherever it is configured, so the file must exist on the server for the catalog, and on the client machine for a client not using vended credentials.

Azure Data Lake Storage

Property NameDescriptionRequired
azure-storage-account-nameStorage account nameYes
azure-storage-account-keyStorage account keyYes

Alibaba Cloud OSS

Property NameDescriptionRequired
oss-endpointEndpoint of the OSS serviceYes
oss-access-key-idAccess keyYes
oss-secret-access-keySecret keyYes

Tencent Cloud COS

Property NameDescriptionRequired
cos-regionBucket region, for example ap-guangzhouYes
cos-access-key-idAccess key, the Tencent Cloud SecretIdYes
cos-secret-access-keySecret key, the Tencent Cloud SecretKeyYes
cos-endpointEndpoint host suffix, only for non-public endpointsNo

cos-endpoint is a host suffix rather than a URL, so it takes cos.ap-guangzhou.myqcloud.com and not https://cos.ap-guangzhou.myqcloud.com. When unset it is derived from cos-region, which is what you want unless you are pointing at an internal or VPC endpoint.

Multiple Storage Systems

One catalog can carry the properties for several storage systems at once, and Gravitino selects among them by the URI scheme of the object being accessed.

HDFS and Kerberos

A secured HDFS cluster needs these on the catalog, and they can be narrowed on a schema or fileset.

Property NameDescriptionDefault Value
authentication.typesimple or kerberossimple
authentication.impersonation-enableWhether the catalog impersonates the calling userfalse
authentication.kerberos.principalKerberos principal, required when the type is kerberos(none)
authentication.kerberos.keytab-uriURI of the keytab, required when the type is kerberos(none)
authentication.kerberos.check-interval-secCredential check interval60
authentication.kerberos.keytab-fetch-timeout-secTimeout when retrieving the keytab60

The HDFS client itself is configured through the files named in config.resources, where Gravitino recognizes three additional keys: hadoop.security.authentication.kerberos.principal, hadoop.security.authentication.kerberos.keytab, and hadoop.security.authentication.kerberos.krb5.conf.

Schema Properties

Schemas inherit every catalog property and can override these.

Property NameDescriptionDefault Value
locationBase storage location for the schema, named unknown(none)
location-Prefix for named locations(none)
credential-providersCredential provider types, separated by commas(none)
config.resourcesConfiguration files to load(none)
authentication.typesimple or kerberosCatalog value
authentication.impersonation-enableWhether to impersonate the calling userCatalog value
authentication.kerberos.principalKerberos principal for this schemaCatalog value
authentication.kerberos.keytab-uriKeytab URI for this schemaCatalog value

Creating or dropping a schema creates or removes the matching directories, except when disable-filesystem-ops is true or the location contains placeholders.

Fileset Properties

Filesets inherit every schema property, including those the schema inherited from the catalog.

Property NameDescriptionDefault ValueImmutable
locationStorage location for the fileset, named unknown(none)No
default-location-nameWhich location GVFS uses when none is named. Required with severalThe only location, when there is oneYes
placeholder-Values substituted into placeholders in the location(none)Yes
credential-providersCredential provider types, separated by commas(none)No
config.resourcesConfiguration files to load(none)No
authentication.typesimple or kerberosSchema valueNo
authentication.impersonation-enableWhether to impersonate the calling userSchema valueYes
authentication.kerberos.principalKerberos principal for this filesetSchema valueNo
authentication.kerberos.keytab-uriKeytab URI for this filesetSchema valueNo

Three placeholders are supplied by Gravitino and cannot be set: placeholder-catalog, placeholder-schema, and placeholder-fileset, which resolve to the names of the objects themselves.

Property Inheritance

Authentication and credential settings resolve from the nearest level outward, so a fileset value beats a schema value, which beats a catalog value. A catalog can therefore set a default that individual filesets override without repeating the rest of the configuration.

Implementing a Custom Filesystem Provider

A storage system Gravitino does not ship support for can be added by implementing FileSystemProvider from gravitino-hadoop-common:

// Build a FileSystem from the properties set when the catalog was created.
FileSystem getFileSystem(@Nonnull Path path, @Nonnull Map<String, String> config)
throws IOException;

// URI scheme, such as 'file', 'hdfs', 's3a', 'gs', 'oss', or 'cosn'.
String scheme();

// Provider name, such as 'builtin-local', 'builtin-hdfs', 's3', 'gcs', 'oss', or 'cos'.
String name();

The provider is discovered through Java SPI, so the jar needs a META-INF/services/org.apache.gravitino.catalog.hadoop.fs.FileSystemProvider file naming the implementing class. Place the jar in ${GRAVITINO_HOME}/catalogs/fileset/libs/ and restart the server.

Further Reading