Skip to content

[Feature] Optimize CachingCatalog#getTable #7484

@tbpure

Description

@tbpure

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

In CachingCatalog, when multi thread calls the getTable with the same Identifier ,if them all find cache miss, they will call the wrapped.getTable(identifier) multiple times concurrently, which is very expensive. And actually, we just need to call the wrapped.getTable(identifier) once, and return the result for all calls.

Solution

Only allow the first cache-missing thread to call wrapped.getTable(identifier). Other concurrent threads requesting the same Identifier should wait for and reuse the result. This can be implemented by introducing a lock or a Future-based coordination mechanism.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions