Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#3483] refactor(API): separate API for client using: SupportsSchemas #3419

Merged
merged 28 commits into from
May 22, 2024

Conversation

shaofengshi
Copy link
Contributor

@shaofengshi shaofengshi commented May 17, 2024

What changes were proposed in this pull request?

Today Gravitino java client and server sides share the same interfaces, like SupportsMetalakes, SupportsCatalogs, SupportsSchemas, etc. These interfaces are good for server side, but not good for client side. After some discussion with Jerry and others, if we want to make it easier to use, and still keep server side code stable, the only way is to separate the APIs: create individual APIs for the java client.

This PR will introduce the simplified API for client: SupportsSchemas. The interface for serverside has been moved into core module with package name "com.datastrato.gravitino.schema"; The current one in api module with package name "com.datastrato.gravitino.rel" is for client side, whose method signatures have been changed, so the client code will be clear.

Besides, the "Catalog.asSchema()", "Catalog.asTableCatalog()" should only be implemented on the client side, not server side (as server side we can use the subclasses of "CatalogOperations"). I updated the occurrances of such usages, mainly in some integration tests.

The integration tests which uses Java client to manipulate metadata also be updated.

Why are the changes needed?

To make the client API simple and easy to use.

Fix: #3483

Does this PR introduce any user-facing change?

Will change the Java client API, mainly on the method signatures; for example, "listSchemas()" won't need an input parameter, "schemaExists()" will use a String value as the input parameter instead of a NameIdentifier object, etc.

How was this patch tested?

All existing integration tests will cover the API change.

@shaofengshi shaofengshi marked this pull request as draft May 17, 2024 02:04
@shaofengshi shaofengshi changed the title [WIP] Client interface schema [#2479] refactor: separate API for client using: Catalog and SupportsSchemas May 20, 2024
@shaofengshi shaofengshi self-assigned this May 20, 2024
@shaofengshi shaofengshi marked this pull request as ready for review May 20, 2024 06:48
@jerryshao
Copy link
Contributor

@shaofengshi can you use a separate issue to track this work?

@shaofengshi
Copy link
Contributor Author

@shaofengshi can you use a separate issue to track this work?

I see; the issue has been closed with the previous PR. OK let me create another.

@shaofengshi shaofengshi changed the title [#2479] refactor: separate API for client using: Catalog and SupportsSchemas [#3483] refactor: separate API for client using: Catalog and SupportsSchemas May 21, 2024
@shaofengshi shaofengshi changed the title [#3483] refactor: separate API for client using: Catalog and SupportsSchemas [#3483] refactor: separate API for client using: SupportsSchemas May 22, 2024
@jerryshao jerryshao changed the title [#3483] refactor: separate API for client using: SupportsSchemas [#3483] refactor(API): separate API for client using: SupportsSchemas May 22, 2024
@shaofengshi shaofengshi merged commit 2687f1a into apache:main May 22, 2024
22 checks passed
@shaofengshi shaofengshi deleted the client_interface_schema2 branch May 22, 2024 11:11
diqiu50 pushed a commit to diqiu50/gravitino that referenced this pull request Jun 13, 2024
…chemas (apache#3419)

### What changes were proposed in this pull request?

Today Gravitino java client and server sides share the same interfaces,
like SupportsMetalakes, SupportsCatalogs, SupportsSchemas, etc. These
interfaces are good for server side, but not good for client side. After
some discussion with Jerry and others, if we want to make it easier to
use, and still keep server side code stable, the only way is to separate
the APIs: create individual APIs for the java client.

This PR will introduce the simplified API for client: SupportsSchemas.
The interface for serverside has been moved into core module with
package name "com.datastrato.gravitino.schema"; The current one in api
module with package name "com.datastrato.gravitino.rel" is for client
side, whose method signatures have been changed, so the client code will
be clear.

Besides, the "Catalog.asSchema()", "Catalog.asTableCatalog()" should
only be implemented on the client side, not server side (as server side
we can use the subclasses of "CatalogOperations"). I updated the
occurrances of such usages, mainly in some integration tests.

The integration tests which uses Java client to manipulate metadata also
be updated.

### Why are the changes needed?

To make the client API simple and easy to use.

Fix: apache#3483

### Does this PR introduce _any_ user-facing change?

Will change the Java client API, mainly on the method signatures; for
example, "listSchemas()" won't need an input parameter, "schemaExists()"
will use a String value as the input parameter instead of a
NameIdentifier object, etc.

### How was this patch tested?

All existing integration tests will cover the API change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Subtask] Separate API for client using: SupportsSchemas
3 participants