Skip to content

Commit

Permalink
(#6626) imporvement: Invoke open and close through realCatalog in Bas…
Browse files Browse the repository at this point in the history
…eCatalog (#6627)

### What changes were proposed in this pull request?
 Invoke open and close through realCatalog in BaseCatalog 
Fix #6626
  • Loading branch information
hdygxsj authored Mar 8, 2025
1 parent 1297713 commit 0616fbc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ protected BaseCatalog(
protected abstract AbstractCatalog realCatalog();

@Override
public void open() throws CatalogException {}
public void open() throws CatalogException {
realCatalog().open();
}

@Override
public void close() throws CatalogException {}
public void close() throws CatalogException {
realCatalog().close();
}

@Override
public List<String> listDatabases() throws CatalogException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Optional;
import javax.annotation.Nullable;
import org.apache.flink.table.catalog.AbstractCatalog;
import org.apache.flink.table.catalog.exceptions.CatalogException;
import org.apache.flink.table.catalog.hive.HiveCatalog;
import org.apache.flink.table.factories.Factory;
import org.apache.gravitino.flink.connector.PartitionConverter;
Expand All @@ -48,18 +47,6 @@ public class GravitinoHiveCatalog extends BaseCatalog {
this.hiveCatalog = new HiveCatalog(catalogName, defaultDatabase, hiveConf, hiveVersion);
}

@Override
public void open() throws CatalogException {
super.open();
hiveCatalog.open();
}

@Override
public void close() throws CatalogException {
super.close();
hiveCatalog.close();
}

public HiveConf getHiveConf() {
return hiveCatalog.getHiveConf();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Map;
import java.util.Optional;
import org.apache.flink.table.catalog.AbstractCatalog;
import org.apache.flink.table.catalog.exceptions.CatalogException;
import org.apache.flink.table.factories.Factory;
import org.apache.gravitino.flink.connector.PartitionConverter;
import org.apache.gravitino.flink.connector.PropertiesConverter;
Expand All @@ -45,16 +44,6 @@ protected GravitinoIcebergCatalog(
this.icebergCatalog = (FlinkCatalog) flinkCatalogFactory.createCatalog(catalogName, properties);
}

@Override
public void open() throws CatalogException {
icebergCatalog.open();
}

@Override
public void close() throws CatalogException {
icebergCatalog.close();
}

@Override
public Optional<Factory> getFactory() {
return icebergCatalog.getFactory();
Expand Down

0 comments on commit 0616fbc

Please sign in to comment.