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] Support TableScan resources clean #2123

Closed
wants to merge 2 commits into from

Conversation

schnappi17
Copy link
Contributor

Purpose

Linked issue: close #2122

@@ -47,4 +47,7 @@ public interface TableScan {
interface Plan {
List<Split> splits();
}

/** Close this scan, clean resources here. */
void close();
Copy link
Contributor

Choose a reason for hiding this comment

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

TableScan is a @Public interface, do we really need to add a close() method here?

@@ -187,6 +187,11 @@ protected StartingScanner createStartingScanner(boolean isStreaming) {
}
}

@Override
public void close() {
// do nothing yet
Copy link
Contributor

Choose a reason for hiding this comment

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

All the close() methods in AbstractInnerTableScan and ReadOnceTableScan are empty, why do we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the close() methods in AbstractInnerTableScan and ReadOnceTableScan are empty, why do we need it?

@FangYongs This is a base pr, the scan metrics will rebase this pr and do substantial metrics resource clean in the close method.

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

Hi @schnappi17

I think we should avoid adding close for metrics only.

  1. This may lead to lots of closes in our codes, looks very tricky.
  2. This breaks back Backwards Compatibility.

We may need to revisit Metrics design. I know Hudi also use static Metrics field to maintain all metrics, but when I take a look to its implementation. It is very tricky. It never delete metrics, and the shutdown of metrics is very casualness.

When I take a look to the metrics of Flink: https://issues.apache.org/jira/browse/FLINK-7876 It looks very good, Paimon, may not need to manage metrics ourselves, just register metrics externally through an interface.
For example, registering with the metrics system of a computing engine, or injecting users into their own metrics system.

The interface can just be a class like MetricRegistry.

@schnappi17
Copy link
Contributor Author

Thanks @JingsongLi and @FangYongs for reviewing and suggestions, I'll take a look at this and thinking about the metrics interfaces design.

@schnappi17 schnappi17 closed this Oct 20, 2023
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.

[Feature] Support TableScan.close to clean scan resources
3 participants