Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mchades committed Jun 26, 2024
1 parent 4b9d0b1 commit b580687
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 17 deletions.
39 changes: 39 additions & 0 deletions api/src/main/java/com/datastrato/gravitino/Catalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,33 @@ enum Type {
UNSUPPORTED
}

/** The cloud that the catalog is running on. Used by the catalog property `cloud.name`. */
enum CloudName {
/** Amazon Web Services */
AWS,

/** Microsoft Azure */
AZURE,

/** Google Cloud Platform */
GCP,

/** Alibaba Cloud */
ALIBABA_CLOUD,

/** Tencent Cloud */
TENCENT_CLOUD,

/** Huawei Cloud */
HUAWEI_CLOUD,

/** Not running on cloud */
ON_PREMISE,

/** Other cloud providers */
OTHER
}

/**
* A reserved property to specify the package location of the catalog. The "package" is a string
* of path to the folder where all the catalog related dependencies is located. The dependencies
Expand All @@ -44,6 +71,18 @@ enum Type {
*/
String PROPERTY_PACKAGE = "package";

/**
* The property to specify the cloud that the catalog is running on. The value should be one of
* the {@link CloudName}.
*/
String CLOUD_NAME = "cloud.name";

/**
* The property to specify the region code of the cloud that the catalog is running on. The value
* should be the region code of the cloud provider.
*/
String CLOUD_REGION_CODE = "cloud.region-code";

/** @return The name of the catalog. */
String name();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@

package com.datastrato.gravitino.connector;

import static com.datastrato.gravitino.Catalog.CLOUD_NAME;
import static com.datastrato.gravitino.Catalog.CLOUD_REGION_CODE;
import static com.datastrato.gravitino.Catalog.PROPERTY_PACKAGE;

import com.datastrato.gravitino.Catalog;
import com.datastrato.gravitino.annotation.Evolving;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import java.util.Map;

@Evolving
public abstract class BaseCatalogPropertiesMetadata extends BasePropertiesMetadata {

public static final String CLOUD_NAME = "cloud.name";
public static final String CLOUD_REGION_CODE = "cloud.region-code";

protected static final Map<String, PropertyEntry<?>> BASIC_CATALOG_PROPERTY_ENTRIES =
Maps.uniqueIndex(
ImmutableList.of(
Expand All @@ -40,7 +39,7 @@ public abstract class BaseCatalogPropertiesMetadata extends BasePropertiesMetada
"The cloud that the catalog is running on",
false /* required */,
true /* immutable */,
CloudName.class,
Catalog.CloudName.class,
null /* The default value does not work because if the user does not set it, this property will not be displayed */,
false /* hidden */,
false /* reserved */),
Expand All @@ -51,15 +50,4 @@ public abstract class BaseCatalogPropertiesMetadata extends BasePropertiesMetada
null /* The default value does not work because if the user does not set it, this property will not be displayed */,
false /* hidden */)),
PropertyEntry::getName);

enum CloudName {
AWS,
AZURE,
GCP,
ALIBABA_CLOUD,
TENCENT_CLOUD,
HUAWEI_CLOUD,
ON_PREMISE,
OTHER
}
}
2 changes: 2 additions & 0 deletions docs/apache-hive-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ The Hive catalog supports creating, updating, and deleting databases and tables

### Catalog properties

Besides the [common catalog properties](./manage-relational-metadata-using-gravitino.md#catalog-properties), the Hive catalog has the following properties:

| Property Name | Description | Default Value | Required | Since Version |
|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|------------------------------|---------------|
| `metastore.uris` | The Hive metastore service URIs, separate multiple addresses with commas. Such as `thrift://127.0.0.1:9083` | (none) | Yes | 0.2.0 |
Expand Down
2 changes: 2 additions & 0 deletions docs/hadoop-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Hadoop 3. If there's any compatibility issue, please create an [issue](https://g

### Catalog properties

Besides the [common catalog properties](./manage-fileset-metadata-using-gravitino.md#catalog-properties), the Hadoop catalog has the following properties:

| Property Name | Description | Default Value | Required | Since Version |
|----------------------------------------------------|------------------------------------------------------------------------------------------------|---------------|-------------------------------------------------------------|---------------|
| `location` | The storage location managed by Hadoop catalog. | (none) | No | 0.5.0 |
Expand Down
2 changes: 1 addition & 1 deletion docs/jdbc-doris-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can check the relevant data source configuration in
[data source properties](https://commons.apache.org/proper/commons-dbcp/configuration.html) for
more details.

Here are the catalog properties defined in Gravitino for Doris catalog:
Besides the [common catalog properties](./manage-relational-metadata-using-gravitino.md#catalog-properties), the Doris catalog has the following properties:

| Configuration item | Description | Default value | Required | Since Version |
|----------------------|-------------------------------------------------------------------------------------|---------------|----------|---------------|
Expand Down
1 change: 1 addition & 0 deletions docs/jdbc-mysql-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Check the relevant data source configuration in [data source properties](https:/
When you use the Gravitino with Trino. You can pass the Trino MySQL connector configuration using prefix `trino.bypass.`. For example, using `trino.bypass.join-pushdown.strategy` to pass the `join-pushdown.strategy` to the Gravitino MySQL catalog in Trino runtime.

If you use a JDBC catalog, you must provide `jdbc-url`, `jdbc-driver`, `jdbc-user` and `jdbc-password` to catalog properties.
Besides the [common catalog properties](./manage-relational-metadata-using-gravitino.md#catalog-properties), the MySQL catalog has the following properties:

| Configuration item | Description | Default value | Required | Since Version |
|----------------------|--------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
Expand Down
1 change: 1 addition & 0 deletions docs/jdbc-postgresql-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ You can check the relevant data source configuration in [data source properties]
When you use the Gravitino with Trino. You can pass the Trino PostgreSQL connector configuration using prefix `trino.bypass.`. For example, using `trino.bypass.join-pushdown.strategy` to pass the `join-pushdown.strategy` to the Gravitino PostgreSQL catalog in Trino runtime.

If you use JDBC catalog, you must provide `jdbc-url`, `jdbc-driver`, `jdbc-database`, `jdbc-user` and `jdbc-password` to catalog properties.
Besides the [common catalog properties](./manage-relational-metadata-using-gravitino.md#catalog-properties), the PostgreSQL catalog has the following properties:

| Configuration item | Description | Default value | Required | Since Version |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
Expand Down
2 changes: 2 additions & 0 deletions docs/kafka-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ One Kafka catalog corresponds to one Kafka cluster.

### Catalog properties

Besides the [common catalog properties](./manage-messaging-metadata-using-gravitino.md#catalog-properties), the Kafka catalog has the following properties:

| Property Name | Description | Default Value | Required | Since Version |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
| `bootstrap.servers` | The Kafka broker(s) to connect to, allowing for multiple brokers by comma-separating them. | (none) | Yes | 0.5.0 |
Expand Down
9 changes: 9 additions & 0 deletions docs/manage-fileset-metadata-using-gravitino.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ To use fileset, please make sure that:
- Gravitino server has started, and the host and port is [http://localhost:8090](http://localhost:8090).
- A metalake has been created.

## Catalog properties

The following are the common properties for all fileset catalogs:

| Property Name | Description | Default Value | Required | Since Version |
|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
| `cloud.name` | The property to specify the cloud that the catalog is running on. The valid values are `aws`, `azure`, `gcp`, `alibaba_cloud`, `tencent_cloud`, `huawei_cloud`, `on_premise` and `other`. | (none) | No | 0.6.0 |
| `cloud.region-code` | The property to specify the region code of the cloud that the caatlog is running on. | (none) | No | 0.6.0 |

## Catalog operations

### Create a catalog
Expand Down
9 changes: 9 additions & 0 deletions docs/manage-messaging-metadata-using-gravitino.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ To use messaging catalog, please make sure that:
- Gravitino server has started, and the host and port is [http://localhost:8090](http://localhost:8090).
- A metalake has been created.

## Catalog properties

The following are the common catalog properties for all messaging catalogs:

| Property Name | Description | Default Value | Required | Since Version |
|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
| `cloud.name` | The property to specify the cloud that the catalog is running on. The valid values are `aws`, `azure`, `gcp`, `alibaba_cloud`, `tencent_cloud`, `huawei_cloud`, `on_premise` and `other`. | (none) | No | 0.6.0 |
| `cloud.region-code` | The property to specify the region code of the cloud that the caatlog is running on. | (none) | No | 0.6.0 |

## Catalog operations

### Create a catalog
Expand Down
9 changes: 9 additions & 0 deletions docs/manage-relational-metadata-using-gravitino.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ Assuming:
- Gravitino has just started, and the host and port is [http://localhost:8090](http://localhost:8090).
- Metalake has been created.

## Catalog properties

The following are the common catalog properties for all relational catalogs:

| Property Name | Description | Default Value | Required | Since Version |
|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
| `cloud.name` | The property to specify the cloud that the catalog is running on. The valid values are `aws`, `azure`, `gcp`, `alibaba_cloud`, `tencent_cloud`, `huawei_cloud`, `on_premise` and `other`. | (none) | No | 0.6.0 |
| `cloud.region-code` | The property to specify the region code of the cloud that the caatlog is running on. | (none) | No | 0.6.0 |

## Catalog operations

### Create a catalog
Expand Down

0 comments on commit b580687

Please sign in to comment.