Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
**/scalastyle-output.xml
docs/**
**/dependency-reduced-pom.xml
**/arctic_krb_conf/**
**/amoro_krb_conf/**
**/metastore_db/**
**/gen-antlr/**
**/unit_test_base_tmp/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.amoro.table.ArcticTable;
import org.apache.amoro.table.MixedTable;
import org.apache.amoro.table.TableProperties;
import org.apache.amoro.utils.CompatiblePropertyUtil;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -115,7 +115,7 @@ public DataExpirationConfig(
this.baseOnRule = baseOnRule;
}

public DataExpirationConfig(ArcticTable table) {
public DataExpirationConfig(MixedTable table) {
Map<String, String> properties = table.properties();
expirationField =
CompatiblePropertyUtil.propertyAsString(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import org.apache.amoro.server.table.TableService;
import org.apache.amoro.server.table.internal.InternalTableCreator;
import org.apache.amoro.server.table.internal.InternalTableHandler;
import org.apache.amoro.utils.ArcticCatalogUtil;
import org.apache.amoro.utils.MixedCatalogUtil;
import org.apache.amoro.utils.TablePropertyUtil;
import org.apache.iceberg.TableMetadata;
import org.apache.iceberg.TableOperations;
Expand Down Expand Up @@ -435,7 +435,7 @@ private InternalCatalog getCatalog(String catalog) {
ServerCatalog internalCatalog = tableService.getServerCatalog(catalog);
Preconditions.checkArgument(
internalCatalog instanceof InternalCatalog, "The catalog is not an iceberg rest catalog");
Set<TableFormat> tableFormats = ArcticCatalogUtil.tableFormats(internalCatalog.getMetadata());
Set<TableFormat> tableFormats = MixedCatalogUtil.tableFormats(internalCatalog.getMetadata());
Preconditions.checkArgument(
tableFormats.size() == 1
&& (tableFormats.contains(TableFormat.ICEBERG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.amoro.api.config.Configurations;
import org.apache.amoro.properties.CatalogMetaProperties;
import org.apache.amoro.server.ArcticManagementConf;
import org.apache.amoro.utils.ArcticCatalogUtil;
import org.apache.amoro.utils.MixedCatalogUtil;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
import org.apache.iceberg.relocated.com.google.common.collect.Sets;
Expand Down Expand Up @@ -63,7 +63,7 @@ private static String getAmsURI(Configurations serviceConfig) {
public static ServerCatalog buildServerCatalog(
CatalogMeta catalogMeta, Configurations serverConfiguration) {
String type = catalogMeta.getCatalogType();
Set<TableFormat> tableFormats = ArcticCatalogUtil.tableFormats(catalogMeta);
Set<TableFormat> tableFormats = MixedCatalogUtil.tableFormats(catalogMeta);

Preconditions.checkState(
formatSupportedMatrix.containsKey(type), "unsupported catalog type: %s", type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.apache.amoro.properties.CatalogMetaProperties;
import org.apache.amoro.server.persistence.mapper.TableMetaMapper;
import org.apache.amoro.table.TableMetaStore;
import org.apache.amoro.utils.ArcticCatalogUtil;
import org.apache.amoro.utils.MixedCatalogUtil;
import org.apache.iceberg.relocated.com.google.common.collect.Maps;

import java.util.ArrayList;
Expand All @@ -46,7 +46,7 @@ public class ExternalCatalog extends ServerCatalog {

protected ExternalCatalog(CatalogMeta metadata) {
super(metadata);
this.tableMetaStore = ArcticCatalogUtil.buildMetaStore(metadata);
this.tableMetaStore = MixedCatalogUtil.buildMetaStore(metadata);
this.unifiedCatalog =
this.tableMetaStore.doAs(
() -> new CommonUnifiedCatalog(this::getMetadata, Maps.newHashMap()));
Expand Down Expand Up @@ -76,7 +76,7 @@ public void disposeTable(String database, String tableName) {
@Override
public void updateMetadata(CatalogMeta metadata) {
super.updateMetadata(metadata);
this.tableMetaStore = ArcticCatalogUtil.buildMetaStore(metadata);
this.tableMetaStore = MixedCatalogUtil.buildMetaStore(metadata);
this.unifiedCatalog.refresh();
updateDatabaseFilter(metadata);
updateTableFilter(metadata);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.amoro.api.CatalogMeta;
import org.apache.amoro.api.config.Configurations;
import org.apache.amoro.formats.iceberg.IcebergTable;
import org.apache.amoro.io.ArcticFileIO;
import org.apache.amoro.io.AuthenticatedFileIO;
import org.apache.amoro.server.ArcticManagementConf;
import org.apache.amoro.server.RestCatalogService;
import org.apache.amoro.server.exception.ObjectNotExistsException;
Expand All @@ -33,7 +33,7 @@
import org.apache.amoro.server.table.internal.InternalTableCreator;
import org.apache.amoro.server.table.internal.InternalTableHandler;
import org.apache.amoro.server.utils.InternalTableUtil;
import org.apache.amoro.utils.ArcticCatalogUtil;
import org.apache.amoro.utils.MixedCatalogUtil;
import org.apache.iceberg.BaseTable;
import org.apache.iceberg.CatalogProperties;
import org.apache.iceberg.TableOperations;
Expand Down Expand Up @@ -100,11 +100,11 @@ public AmoroTable<?> loadTable(String database, String tableName) {
return IcebergTable.newIcebergTable(
tableIdentifier,
table,
ArcticCatalogUtil.buildMetaStore(getMetadata()),
MixedCatalogUtil.buildMetaStore(getMetadata()),
getMetadata().getCatalogProperties());
}

protected ArcticFileIO fileIO(CatalogMeta catalogMeta) {
protected AuthenticatedFileIO fileIO(CatalogMeta catalogMeta) {
return InternalTableUtil.newIcebergFileIo(catalogMeta);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
import org.apache.amoro.TableFormat;
import org.apache.amoro.api.CatalogMeta;
import org.apache.amoro.api.config.Configurations;
import org.apache.amoro.formats.mixed.MixedTable;
import org.apache.amoro.io.ArcticFileIO;
import org.apache.amoro.io.AuthenticatedFileIO;
import org.apache.amoro.mixed.InternalMixedIcebergCatalog;
import org.apache.amoro.server.persistence.mapper.TableMetaMapper;
import org.apache.amoro.server.table.TableMetadata;
Expand All @@ -34,9 +33,9 @@
import org.apache.amoro.server.table.internal.InternalTableCreator;
import org.apache.amoro.server.table.internal.InternalTableHandler;
import org.apache.amoro.server.utils.InternalTableUtil;
import org.apache.amoro.table.ArcticTable;
import org.apache.amoro.table.BasicKeyedTable;
import org.apache.amoro.table.BasicUnkeyedTable;
import org.apache.amoro.table.MixedTable;
import org.apache.amoro.table.PrimaryKeySpec;
import org.apache.iceberg.BaseTable;
import org.apache.iceberg.TableOperations;
Expand Down Expand Up @@ -118,8 +117,8 @@ public AmoroTable<?> loadTable(String database, String tableName) {

org.apache.amoro.table.TableIdentifier tableIdentifier =
org.apache.amoro.table.TableIdentifier.of(name(), database, tableName);
ArcticFileIO fileIO = InternalTableUtil.newIcebergFileIo(getMetadata());
ArcticTable mixedIcebergTable;
AuthenticatedFileIO fileIO = InternalTableUtil.newIcebergFileIo(getMetadata());
MixedTable mixedIcebergTable;

BaseTable baseTable = loadTableStore(tableMetadata, false);
if (InternalTableUtil.isKeyedMixedTable(tableMetadata)) {
Expand All @@ -144,7 +143,8 @@ tableIdentifier, baseTable, fileIO, getMetadata().getCatalogProperties()),
tableIdentifier, baseTable, fileIO, getMetadata().getCatalogProperties());
}

return new MixedTable(mixedIcebergTable, TableFormat.MIXED_ICEBERG);
return new org.apache.amoro.formats.mixed.MixedTable(
mixedIcebergTable, TableFormat.MIXED_ICEBERG);
}

protected TableFormat format() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.amoro.server.table.TableMetadata;
import org.apache.amoro.server.table.internal.InternalTableCreator;
import org.apache.amoro.server.table.internal.InternalTableHandler;
import org.apache.amoro.utils.ArcticCatalogUtil;
import org.apache.amoro.utils.MixedCatalogUtil;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.iceberg.rest.requests.CreateTableRequest;
import org.apache.thrift.TException;
Expand All @@ -44,7 +44,7 @@ protected MixedHiveCatalogImpl(CatalogMeta catalogMeta) {
super(catalogMeta);
this.tables =
new MixedHiveTables(
catalogMeta.getCatalogProperties(), ArcticCatalogUtil.buildMetaStore(catalogMeta));
catalogMeta.getCatalogProperties(), MixedCatalogUtil.buildMetaStore(catalogMeta));
hiveClientPool = ((MixedHiveTables) tables()).getHiveClientPool();
}

Expand All @@ -54,7 +54,7 @@ public void updateMetadata(CatalogMeta metadata) {
hiveClientPool = ((MixedHiveTables) tables()).getHiveClientPool();
this.tables =
new MixedHiveTables(
metadata.getCatalogProperties(), ArcticCatalogUtil.buildMetaStore(metadata));
metadata.getCatalogProperties(), MixedCatalogUtil.buildMetaStore(metadata));
}

@Override
Expand Down
Loading