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

Remove the obsolete SqlliteCallContextCatalogFactory #143

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove the obsolete SqlliteCallContextCatalogFactory
This earlier vestigial option only works without any of the authz-aware layers,
and for now there's no way to short-circuit through the authz-aware layers to
delegate to any underlying Catalog implementation that doesn't cooperate with
the main Polaris metadata.

If we want to support this pattern in the future it'll require a more explicit
delegator/wrapper pattern where either the authz hooks are simulated in some way
or else there's a cooperative multi-phase commit protocol.

In the meantime, this defunct option may just cause confusion and dependency-bloat.
  • Loading branch information
dennishuo committed Aug 12, 2024
commit 0cc42c2db02b522869f6878e329104ff64bc03fc
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 57,6 @@ prometheus-metrics-exporter-servlet-jakarta = { module = "io.prometheus:promethe
s3mock-testcontainers = { module = "com.adobe.testing:s3mock-testcontainers", version = "3.9.1" }
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version = "4.8.5" }
sqllite-jdbc = { module = "org.xerial:sqlite-jdbc", version = "3.45.1.0" }
swagger-annotations = { module = "io.swagger:swagger-annotations", version.ref = "swagger" }
swagger-jaxrs = { module = "io.swagger:swagger-jaxrs", version.ref = "swagger" }
testcontainers-bom = { module = "org.testcontainers:testcontainers-bom", version = "1.20.0" }
Expand Down
3 changes: 0 additions & 3 deletions polaris-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 62,6 @@ server:
# Enable archiving if the request log entries go to the their own file
archive: true

# Either 'jdbc' or 'polaris'; specifies the underlying delegate catalog
baseCatalogType: "polaris"

featureConfiguration:
ENFORCE_PRINCIPAL_CREDENTIAL_ROTATION_REQUIRED_CHECKING: false
DISABLE_TOKEN_GENERATION_FOR_USER_PRINCIPALS: true
Expand Down
1 change: 0 additions & 1 deletion polaris-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 54,6 @@ dependencies {

implementation(libs.hadoop.client.api)

implementation(libs.sqllite.jdbc)
implementation(libs.auth0.jwt)

implementation(libs.logback.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 68,6 @@
import io.polaris.service.context.CallContextResolver;
import io.polaris.service.context.PolarisCallContextCatalogFactory;
import io.polaris.service.context.RealmContextResolver;
import io.polaris.service.context.SqlliteCallContextCatalogFactory;
import io.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory;
import io.polaris.service.storage.PolarisStorageIntegrationProviderImpl;
import io.polaris.service.task.ManifestFileCleanupTaskHandler;
Expand Down Expand Up @@ -152,8 151,6 @@ public void initialize(Bootstrap<PolarisApplicationConfig> bootstrap) {

@Override
public void run(PolarisApplicationConfig configuration, Environment environment) {
// PolarisEntityManager will be used for Management APIs and optionally the core Catalog APIs
// depending on the value of the baseCatalogType config.
MetaStoreManagerFactory metaStoreManagerFactory = configuration.getMetaStoreManagerFactory();
StsClientBuilder stsClientBuilder = StsClient.builder();
AwsCredentialsProvider awsCredentialsProvider = configuration.credentialsProvider();
Expand Down Expand Up @@ -201,22 198,11 @@ public void run(PolarisApplicationConfig configuration, Environment environment)
new ManifestFileCleanupTaskHandler(
fileIOSupplier, Executors.newVirtualThreadPerTaskExecutor()));

CallContextCatalogFactory catalogFactory;
if ("polaris".equals(configuration.getBaseCatalogType())) {
LOGGER.info(
"Initializing PolarisCallContextCatalogFactory for baseCatalogType {}, metaStoreManagerType {}",
configuration.getBaseCatalogType(),
metaStoreManagerFactory);
catalogFactory = new PolarisCallContextCatalogFactory(entityManagerFactory, taskExecutor);
} else if ("jdbc".equals(configuration.getBaseCatalogType())) {
LOGGER.info(
"Initializing SqlliteCallContextCatalogFactory for baseCatalogType {}",
configuration.getBaseCatalogType());
catalogFactory = new SqlliteCallContextCatalogFactory(configuration.getSqlLiteCatalogDirs());
} else {
LOGGER.error("Unrecognized baseCatalogType: {}", configuration.getBaseCatalogType());
throw new RuntimeException("Invalid baseCatalogType: " configuration.getBaseCatalogType());
}
LOGGER.info(
"Initializing PolarisCallContextCatalogFactory for metaStoreManagerType {}",
metaStoreManagerFactory);
CallContextCatalogFactory catalogFactory =
new PolarisCallContextCatalogFactory(entityManagerFactory, taskExecutor);

PolarisAuthorizer authorizer = new PolarisAuthorizer(configurationStore);
IcebergCatalogAdapter catalogAdapter =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 37,6 @@
* be picked up, i.e. `iceberg-rest-server.yml`
*/
public class PolarisApplicationConfig extends Configuration {
private Map<String, String> sqlLiteCatalogDirs = new HashMap<>();

private String baseCatalogType;
private MetaStoreManagerFactory metaStoreManagerFactory;
private String defaultRealm = "default-realm";
private RealmContextResolver realmContextResolver;
Expand All @@ -53,24 50,6 @@ public class PolarisApplicationConfig extends Configuration {
private String awsAccessKey;
private String awsSecretKey;

public Map<String, String> getSqlLiteCatalogDirs() {
return sqlLiteCatalogDirs;
}

public void setSqlLiteCatalogDirs(Map<String, String> sqlLiteCatalogDirs) {
this.sqlLiteCatalogDirs = sqlLiteCatalogDirs;
}

@JsonProperty("baseCatalogType")
public void setBaseCatalogType(String baseCatalogType) {
this.baseCatalogType = baseCatalogType;
}

@JsonProperty("baseCatalogType")
public String getBaseCatalogType() {
return baseCatalogType;
}

@JsonProperty("metaStoreManager")
public void setMetaStoreManagerFactory(MetaStoreManagerFactory metaStoreManagerFactory) {
this.metaStoreManagerFactory = metaStoreManagerFactory;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -63,9 63,6 @@ server:
# Enable archiving if the request log entries go to the their own file
archive: true

# Either 'jdbc' or 'polaris'; specifies the underlying delegate catalog
baseCatalogType: "polaris"

featureConfiguration:
ENFORCE_PRINCIPAL_CREDENTIAL_ROTATION_REQUIRED_CHECKING: true
DISABLE_TOKEN_GENERATION_FOR_USER_PRINCIPALS: true
Expand All @@ -78,9 75,6 @@ featureConfiguration:
- GCS
- AZURE

sqlLiteCatalogDirs:
default-realm: ./build/test_data/iceberg

metaStoreManager:
type: in-memory
# type: remote
Expand Down