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

[core] Introduce CachingCatalog #3829

Merged
merged 4 commits into from
Jul 30, 2024
Merged

Conversation

JingsongLi
Copy link
Contributor

@JingsongLi JingsongLi commented Jul 29, 2024

Purpose

Introduce a caching catalog, it is enabled by default, and its expiration interval is 30 s.

This can effectively reduce interaction with the metastore and lower the pressure on the metastore.

This is based on #3824

Tests

API and Format

Documentation

}
}

private void invalidateTable(Identifier identifier) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can expose the method. For example, Spark TableCatalog has an interface which should uses it

  /**
   * Invalidate cached table metadata for an {@link Identifier identifier}.
   * <p>
   * If the table is already loaded or cached, drop cached data. If the table does not exist or is
   * not cached, do nothing. Calling this method should not query remote services.
   *
   * @param ident a table identifier
   */
  default void invalidateTable(Identifier ident) {
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, fixed.

Copy link
Contributor

@Zouxxyy Zouxxyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me! just wonder whether 30s is a bit short

.booleanType()
.defaultValue(true)
.withDescription(
"Controls whether the catalog will cache table entries upon load.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entries should be more detailed. CacheCatalog caches tables and databases.

@JingsongLi JingsongLi merged commit 4a665e6 into apache:master Jul 30, 2024
10 checks passed
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.

3 participants