Skip to content

Commit

Permalink
Remove getPartitionSyncTool method, create inline
Browse files Browse the repository at this point in the history
  • Loading branch information
Vamsi committed Feb 19, 2025
1 parent 95f0329 commit 887aab8
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

import com.google.common.annotations.VisibleForTesting;

import org.apache.xtable.catalog.CatalogPartitionSyncOperations;
import org.apache.xtable.catalog.CatalogPartitionSyncTool;
import org.apache.xtable.catalog.CatalogTableBuilder;
import org.apache.xtable.catalog.CatalogUtils;
Expand Down Expand Up @@ -85,17 +84,6 @@ public HMSCatalogSyncClient(
this.partitionSyncTool = partitionSyncTool;
}

private Optional<CatalogPartitionSyncTool> getPartitionSyncTool(String tableFormat) {
String partitionValueExtractorClass = hmsCatalogConfig.getPartitionExtractorClass();
CatalogPartitionSyncOperations hmsCatalogPartitionSyncOperations =
new HMSCatalogPartitionSyncOperations(metaStoreClient, hmsCatalogConfig);
return CatalogUtils.getPartitionSyncTool(
tableFormat,
partitionValueExtractorClass,
hmsCatalogPartitionSyncOperations,
configuration);
}

@Override
public String getCatalogId() {
return catalogConfig.getCatalogId();
Expand Down Expand Up @@ -219,7 +207,12 @@ private void _init(
this.tableBuilder =
HMSCatalogTableBuilderFactory.getTableBuilder(
tableFormat, hmsCatalogConfig, this.configuration);
this.partitionSyncTool = getPartitionSyncTool(tableFormat);
this.partitionSyncTool =
CatalogUtils.getPartitionSyncTool(
tableFormat,
hmsCatalogConfig.getPartitionExtractorClass(),
new HMSCatalogPartitionSyncOperations(metaStoreClient, hmsCatalogConfig),
configuration);
}

/**
Expand Down

0 comments on commit 887aab8

Please sign in to comment.