wuchong commented on code in PR #2016:
URL: https://github.com/apache/fluss/pull/2016#discussion_r2567497891
##########
fluss-common/src/main/java/org/apache/fluss/cluster/Cluster.java:
##########
@@ -234,26 +237,8 @@ public Optional<Long> getPartitionId(PhysicalTablePath
physicalTablePath) {
return Optional.ofNullable(partitionsIdByPath.get(physicalTablePath));
}
- /** Return whether the cluster contains the given physical table path or
not. */
- public boolean contains(PhysicalTablePath physicalTablePath) {
- if (physicalTablePath.getPartitionName() == null) {
- return getTable(physicalTablePath.getTablePath()).isPresent();
- } else {
- return getPartitionId(physicalTablePath).isPresent();
- }
- }
-
- public TableInfo getTableOrElseThrow(TablePath tablePath) {
- return getTable(tablePath)
- .orElseThrow(
- () ->
- new IllegalArgumentException(
- String.format(
- "table: %s not found in
cluster", tablePath)));
- }
-
- public TableBucket getTableBucket(PhysicalTablePath physicalTablePath, int
bucketId) {
- TableInfo tableInfo =
getTableOrElseThrow(physicalTablePath.getTablePath());
+ public TableBucket getTableBucket(
+ TableInfo tableInfo, PhysicalTablePath physicalTablePath, int
bucketId) {
Review Comment:
Replace the parameter `TableInfo tableInfo` with `long tableId`. Only the
table ID is needed, the full `TableInfo` object is unnecessarily large for this
method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]