Skip to content

Commit

Permalink
Remove CallContext and its ThreadLocal usage (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra authored Jan 14, 2025
1 parent 0a2f9df commit b84f462
Show file tree
Hide file tree
Showing 96 changed files with 3,714 additions and 4,472 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.nio.file.Path;
import java.time.Clock;
import org.apache.polaris.core.PolarisConfigurationStore;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.context.RealmContext;
import org.apache.polaris.core.persistence.LocalPolarisMetaStoreManagerFactory;
Expand All @@ -40,8 +42,24 @@
public class EclipseLinkPolarisMetaStoreManagerFactory
extends LocalPolarisMetaStoreManagerFactory<PolarisEclipseLinkStore> {

@Inject EclipseLinkConfiguration eclipseLinkConfiguration;
@Inject PolarisStorageIntegrationProvider storageIntegrationProvider;
private final EclipseLinkConfiguration eclipseLinkConfiguration;
private final PolarisStorageIntegrationProvider storageIntegrationProvider;

public EclipseLinkPolarisMetaStoreManagerFactory() {
this(null, null, null, null, null);
}

@Inject
public EclipseLinkPolarisMetaStoreManagerFactory(
EclipseLinkConfiguration eclipseLinkConfiguration,
PolarisStorageIntegrationProvider storageIntegrationProvider,
PolarisConfigurationStore configurationStore,
PolarisDiagnostics diagnostics,
Clock clock) {
super(configurationStore, diagnostics, clock);
this.eclipseLinkConfiguration = eclipseLinkConfiguration;
this.storageIntegrationProvider = storageIntegrationProvider;
}

@Override
protected PolarisEclipseLinkStore createBackingStore(@Nonnull PolarisDiagnostics diagnostics) {
Expand All @@ -50,14 +68,17 @@ protected PolarisEclipseLinkStore createBackingStore(@Nonnull PolarisDiagnostics

@Override
protected PolarisMetaStoreSession createMetaStoreSession(
@Nonnull PolarisEclipseLinkStore store, @Nonnull RealmContext realmContext) {
@Nonnull PolarisEclipseLinkStore store,
@Nonnull RealmContext realmContext,
@Nonnull PolarisDiagnostics diagnostics) {
return new PolarisEclipseLinkMetaStoreSessionImpl(
store,
storageIntegrationProvider,
realmContext,
configurationFile(),
persistenceUnitName(),
secretsGenerator(realmContext));
secretsGenerator(realmContext),
diagnostics);
}

private String configurationFile() {
Expand Down
Loading

0 comments on commit b84f462

Please sign in to comment.