You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by sn...@apache.org on 2024/11/28 13:24:43 UTC
(polaris) branch main updated: Replace Jetbrains with Jakarta annotations (#482)
This is an automated email from the ASF dual-hosted git repository.
snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 1868bbd7 Replace Jetbrains with Jakarta annotations (#482)
1868bbd7 is described below
commit 1868bbd7fac369bea9cd47cd85e478841e29c8c3
Author: Robert Stupp <sn...@snazy.de>
AuthorDate: Thu Nov 28 14:24:38 2024 +0100
Replace Jetbrains with Jakarta annotations (#482)
`org.jetbrains.annotations.NotNull`/`Nullable` -> `jakarta.annotations.Nonnull`/`Nullable`
plus Guava's `VisibleForTesting`
The Jakarta annotations are likely better supported by validation frameworks like Hibernate Validator.
---
extension/persistence/eclipselink/build.gradle.kts | 2 +-
.../EclipseLinkPolarisMetaStoreManagerFactory.java | 6 +-
.../PolarisEclipseLinkMetaStoreSessionImpl.java | 142 +++----
.../impl/eclipselink/PolarisEclipseLinkStore.java | 8 +-
polaris-core/build.gradle.kts | 2 +-
.../apache/polaris/core/PolarisCallContext.java | 12 +-
.../polaris/core/PolarisConfigurationStore.java | 16 +-
.../core/auth/AuthenticatedPolarisPrincipal.java | 4 +-
.../polaris/core/auth/PolarisAuthorizer.java | 16 +-
.../polaris/core/auth/PolarisAuthorizerImpl.java | 30 +-
.../polaris/core/auth/PolarisGrantManager.java | 58 +--
.../polaris/core/auth/PolarisSecretsManager.java | 24 +-
.../apache/polaris/core/context/CallContext.java | 4 +-
.../apache/polaris/core/entity/CatalogEntity.java | 6 +-
.../apache/polaris/core/entity/PolarisEntity.java | 4 +-
.../polaris/core/entity/PolarisEntitySubType.java | 2 +-
.../polaris/core/entity/PolarisEntityType.java | 2 +-
.../polaris/core/entity/PolarisPrivilege.java | 16 +-
.../core/monitor/PolarisMetricRegistry.java | 2 +-
.../polaris/core/persistence/BaseResult.java | 8 +-
.../LocalPolarisMetaStoreManagerFactory.java | 6 +-
.../core/persistence/PolarisEntityManager.java | 12 +-
.../core/persistence/PolarisEntityResolver.java | 26 +-
.../core/persistence/PolarisMetaStoreManager.java | 152 +++----
.../persistence/PolarisMetaStoreManagerImpl.java | 449 ++++++++++-----------
.../core/persistence/PolarisMetaStoreSession.java | 122 +++---
.../core/persistence/PolarisObjectMapperUtil.java | 2 +-
.../PolarisTreeMapMetaStoreSessionImpl.java | 132 +++---
.../core/persistence/PolarisTreeMapStore.java | 12 +-
.../persistence/PrincipalSecretsGenerator.java | 4 +-
.../core/persistence/ResolvedPolarisEntity.java | 4 +-
.../TransactionWorkspaceMetaStoreManager.java | 125 +++---
.../core/persistence/cache/EntityCache.java | 24 +-
.../core/persistence/cache/EntityCacheEntry.java | 16 +-
.../persistence/cache/EntityCacheLookupResult.java | 2 +-
.../core/persistence/cache/PolarisRemoteCache.java | 36 +-
.../core/persistence/resolver/Resolver.java | 48 +--
.../core/storage/FileStorageConfigurationInfo.java | 4 +-
.../core/storage/InMemoryStorageIntegration.java | 16 +-
.../core/storage/PolarisCredentialVendor.java | 32 +-
.../storage/PolarisStorageConfigurationInfo.java | 10 +-
.../core/storage/PolarisStorageIntegration.java | 18 +-
.../storage/PolarisStorageIntegrationProvider.java | 2 +-
.../core/storage/StorageConfigurationOverride.java | 4 +-
.../polaris/core/storage/StorageLocation.java | 6 +-
.../apache/polaris/core/storage/StorageUtil.java | 10 +-
.../aws/AwsCredentialsStorageIntegration.java | 14 +-
.../storage/aws/AwsStorageConfigurationInfo.java | 20 +-
.../azure/AzureCredentialsStorageIntegration.java | 10 +-
.../polaris/core/storage/azure/AzureLocation.java | 6 +-
.../azure/AzureStorageConfigurationInfo.java | 12 +-
.../core/storage/cache/StorageCredentialCache.java | 12 +-
.../storage/cache/StorageCredentialCacheKey.java | 2 +-
.../gcp/GcpCredentialsStorageIntegration.java | 16 +-
.../storage/gcp/GcpStorageConfigurationInfo.java | 6 +-
.../polaris/core/persistence/ResolverTest.java | 14 +-
.../storage/InMemoryStorageIntegrationTest.java | 12 +-
.../storage/cache/StorageCredentialCacheTest.java | 4 +-
.../storage/PolarisConfigurationStoreTest.java | 2 +-
.../aws/AwsCredentialsStorageIntegrationTest.java | 6 +-
.../persistence/PolarisTestMetaStoreManager.java | 12 +-
polaris-service/build.gradle.kts | 3 +-
.../service/TimedApplicationEventListener.java | 2 +-
.../polaris/service/admin/PolarisAdminService.java | 28 +-
.../apache/polaris/service/auth/TokenBroker.java | 4 +-
.../service/catalog/BasePolarisCatalog.java | 13 +-
.../service/config/DefaultConfigurationStore.java | 6 +-
.../service/exception/IcebergExceptionMapper.java | 2 +-
.../InMemoryPolarisMetaStoreManagerFactory.java | 6 +-
.../ratelimiter/RealmTokenBucketRateLimiter.java | 2 +-
.../PolarisStorageIntegrationProviderImpl.java | 20 +-
.../polaris/service/task/TaskExecutorImpl.java | 4 +-
.../service/tracing/HeadersMapAccessor.java | 2 +-
.../service/admin/PolarisAuthzTestBase.java | 6 +-
.../service/catalog/BasePolarisCatalogTest.java | 2 +-
.../catalog/BasePolarisCatalogViewTest.java | 2 +-
.../apache/polaris/service/task/TaskTestUtils.java | 4 +-
.../test/DropwizardTestEnvironmentResolver.java | 2 +-
server-templates/api.mustache | 1 +
server-templates/bodyParams.mustache | 2 +-
80 files changed, 947 insertions(+), 950 deletions(-)
diff --git a/extension/persistence/eclipselink/build.gradle.kts b/extension/persistence/eclipselink/build.gradle.kts
index 5c833321..564de93f 100644
--- a/extension/persistence/eclipselink/build.gradle.kts
+++ b/extension/persistence/eclipselink/build.gradle.kts
@@ -45,7 +45,7 @@ dependencies {
}
}
- compileOnly(libs.jetbrains.annotations)
+ compileOnly(libs.jakarta.annotation.api)
testImplementation(libs.h2)
testImplementation(testFixtures(project(":polaris-core")))
diff --git a/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java b/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java
index b18eb30b..b893c543 100644
--- a/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java
+++ b/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java
@@ -20,12 +20,12 @@ package org.apache.polaris.extension.persistence.impl.eclipselink;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
+import jakarta.annotation.Nonnull;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.context.RealmContext;
import org.apache.polaris.core.persistence.LocalPolarisMetaStoreManagerFactory;
import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
import org.apache.polaris.core.persistence.PolarisMetaStoreSession;
-import org.jetbrains.annotations.NotNull;
/**
* The implementation of Configuration interface for configuring the {@link PolarisMetaStoreManager}
@@ -42,13 +42,13 @@ public class EclipseLinkPolarisMetaStoreManagerFactory
private String persistenceUnitName;
@Override
- protected PolarisEclipseLinkStore createBackingStore(@NotNull PolarisDiagnostics diagnostics) {
+ protected PolarisEclipseLinkStore createBackingStore(@Nonnull PolarisDiagnostics diagnostics) {
return new PolarisEclipseLinkStore(diagnostics);
}
@Override
protected PolarisMetaStoreSession createMetaStoreSession(
- @NotNull PolarisEclipseLinkStore store, @NotNull RealmContext realmContext) {
+ @Nonnull PolarisEclipseLinkStore store, @Nonnull RealmContext realmContext) {
return new PolarisEclipseLinkMetaStoreSessionImpl(
store,
storageIntegration,
diff --git a/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java b/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
index 77fa0e70..22c1b07e 100644
--- a/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
+++ b/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
@@ -21,7 +21,10 @@ package org.apache.polaris.extension.persistence.impl.eclipselink;
import static org.eclipse.persistence.config.PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML;
import static org.eclipse.persistence.config.PersistenceUnitProperties.JDBC_URL;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Predicates;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.EntityTransaction;
@@ -73,9 +76,6 @@ import org.apache.polaris.core.persistence.models.ModelPrincipalSecrets;
import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
import org.apache.polaris.core.storage.PolarisStorageIntegration;
import org.apache.polaris.core.storage.PolarisStorageIntegrationProvider;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.TestOnly;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
@@ -111,12 +111,12 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
* @param persistenceUnitName Optional persistence-unit name in confFile. Default to 'polaris'.
*/
public PolarisEclipseLinkMetaStoreSessionImpl(
- @NotNull PolarisEclipseLinkStore store,
- @NotNull PolarisStorageIntegrationProvider storageIntegrationProvider,
- @NotNull RealmContext realmContext,
+ @Nonnull PolarisEclipseLinkStore store,
+ @Nonnull PolarisStorageIntegrationProvider storageIntegrationProvider,
+ @Nonnull RealmContext realmContext,
@Nullable String confFile,
@Nullable String persistenceUnitName,
- @NotNull PrincipalSecretsGenerator secretsGenerator) {
+ @Nonnull PrincipalSecretsGenerator secretsGenerator) {
LOGGER.debug(
"Creating EclipseLink Meta Store Session for realm {}", realmContext.getRealmIdentifier());
emf = createEntityManagerFactory(realmContext, confFile, persistenceUnitName);
@@ -137,7 +137,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
* realm.
*/
private EntityManagerFactory createEntityManagerFactory(
- @NotNull RealmContext realmContext,
+ @Nonnull RealmContext realmContext,
@Nullable String confFile,
@Nullable String persistenceUnitName) {
String realm = realmContext.getRealmIdentifier();
@@ -193,14 +193,14 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
}
}
- @TestOnly
+ @VisibleForTesting
static void clearEntityManagerFactories() {
realmFactories.clear();
}
/** Load the persistence unit properties from a given configuration file */
private Map<String, String> loadProperties(
- @NotNull String confFile, @NotNull String persistenceUnitName) throws IOException {
+ @Nonnull String confFile, @Nonnull String persistenceUnitName) throws IOException {
try {
InputStream input =
Thread.currentThread().getContextClassLoader().getResourceAsStream(confFile);
@@ -237,7 +237,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public <T> T runInTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Supplier<T> transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode) {
callCtx.getDiagServices().check(localSession.get() == null, "cannot nest transaction");
try (EntityManager session = emf.createEntityManager()) {
@@ -280,7 +280,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void runActionInTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Runnable transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
callCtx.getDiagServices().check(localSession.get() == null, "cannot nest transaction");
try (EntityManager session = emf.createEntityManager()) {
@@ -315,7 +315,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public <T> T runInReadTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Supplier<T> transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode) {
// EclipseLink doesn't support readOnly transaction
return runInTransaction(callCtx, transactionCode);
}
@@ -323,7 +323,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void runActionInReadTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Runnable transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
// EclipseLink doesn't support readOnly transaction
runActionInTransaction(callCtx, transactionCode);
}
@@ -332,7 +332,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
* @return new unique entity identifier
*/
@Override
- public long generateNewId(@NotNull PolarisCallContext callCtx) {
+ public long generateNewId(@Nonnull PolarisCallContext callCtx) {
// This function can be called within a transaction or out of transaction.
// If called out of transaction, create a new transaction, otherwise run in current transaction
return localSession.get() != null
@@ -343,15 +343,15 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void writeToEntities(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
this.store.writeToEntities(localSession.get(), entity);
}
/** {@inheritDoc} */
@Override
public <T extends PolarisStorageConfigurationInfo> void persistStorageIntegrationIfNeeded(
- @NotNull PolarisCallContext callContext,
- @NotNull PolarisBaseEntity entity,
+ @Nonnull PolarisCallContext callContext,
+ @Nonnull PolarisBaseEntity entity,
@Nullable PolarisStorageIntegration<T> storageIntegration) {
// not implemented for eclipselink store
}
@@ -359,7 +359,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void writeToEntitiesActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// write it
this.store.writeToEntitiesActive(localSession.get(), entity);
}
@@ -367,7 +367,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void writeToEntitiesDropped(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// write it
this.store.writeToEntitiesDropped(localSession.get(), entity);
}
@@ -375,7 +375,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void writeToEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// write it
this.store.writeToEntitiesChangeTracking(localSession.get(), entity);
}
@@ -383,7 +383,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void writeToGrantRecords(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisGrantRecord grantRec) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisGrantRecord grantRec) {
// write it
this.store.writeToGrantRecords(localSession.get(), grantRec);
}
@@ -391,7 +391,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void deleteFromEntities(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity) {
// delete it
this.store.deleteFromEntities(localSession.get(), entity.getCatalogId(), entity.getId());
@@ -400,7 +400,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void deleteFromEntitiesActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity) {
// delete it
this.store.deleteFromEntitiesActive(localSession.get(), new PolarisEntitiesActiveKey(entity));
}
@@ -408,7 +408,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void deleteFromEntitiesDropped(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// delete it
this.store.deleteFromEntitiesDropped(localSession.get(), entity.getCatalogId(), entity.getId());
}
@@ -421,7 +421,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
*/
@Override
public void deleteFromEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity) {
// delete it
this.store.deleteFromEntitiesChangeTracking(localSession.get(), entity);
}
@@ -429,36 +429,36 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void deleteFromGrantRecords(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisGrantRecord grantRec) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisGrantRecord grantRec) {
this.store.deleteFromGrantRecords(localSession.get(), grantRec);
}
/** {@inheritDoc} */
@Override
public void deleteAllEntityGrantRecords(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore entity,
- @NotNull List<PolarisGrantRecord> grantsOnGrantee,
- @NotNull List<PolarisGrantRecord> grantsOnSecurable) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore entity,
+ @Nonnull List<PolarisGrantRecord> grantsOnGrantee,
+ @Nonnull List<PolarisGrantRecord> grantsOnSecurable) {
this.store.deleteAllEntityGrantRecords(localSession.get(), entity);
}
/** {@inheritDoc} */
@Override
- public void deleteAll(@NotNull PolarisCallContext callCtx) {
+ public void deleteAll(@Nonnull PolarisCallContext callCtx) {
this.store.deleteAll(localSession.get());
}
/** {@inheritDoc} */
@Override
public @Nullable PolarisBaseEntity lookupEntity(
- @NotNull PolarisCallContext callCtx, long catalogId, long entityId) {
+ @Nonnull PolarisCallContext callCtx, long catalogId, long entityId) {
return ModelEntity.toEntity(this.store.lookupEntity(localSession.get(), catalogId, entityId));
}
@Override
- public @NotNull List<PolarisBaseEntity> lookupEntities(
- @NotNull PolarisCallContext callCtx, List<PolarisEntityId> entityIds) {
+ public @Nonnull List<PolarisBaseEntity> lookupEntities(
+ @Nonnull PolarisCallContext callCtx, List<PolarisEntityId> entityIds) {
return this.store.lookupEntities(localSession.get(), entityIds).stream()
.map(ModelEntity::toEntity)
.toList();
@@ -467,15 +467,15 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public int lookupEntityVersion(
- @NotNull PolarisCallContext callCtx, long catalogId, long entityId) {
+ @Nonnull PolarisCallContext callCtx, long catalogId, long entityId) {
ModelEntity model = this.store.lookupEntity(localSession.get(), catalogId, entityId);
return model == null ? 0 : model.getEntityVersion();
}
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisChangeTrackingVersions> lookupEntityVersions(
- @NotNull PolarisCallContext callCtx, List<PolarisEntityId> entityIds) {
+ public @Nonnull List<PolarisChangeTrackingVersions> lookupEntityVersions(
+ @Nonnull PolarisCallContext callCtx, List<PolarisEntityId> entityIds) {
Map<PolarisEntityId, ModelEntity> idToEntityMap =
this.store.lookupEntities(localSession.get(), entityIds).stream()
.collect(
@@ -498,7 +498,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
@Override
@Nullable
public PolarisEntityActiveRecord lookupEntityActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntitiesActiveKey entityActiveKey) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntitiesActiveKey entityActiveKey) {
// lookup the active entity slice
return ModelEntityActive.toEntityActive(
this.store.lookupEntityActive(localSession.get(), entityActiveKey));
@@ -506,10 +506,10 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
- @NotNull
+ @Nonnull
public List<PolarisEntityActiveRecord> lookupEntityActiveBatch(
- @NotNull PolarisCallContext callCtx,
- @NotNull List<PolarisEntitiesActiveKey> entityActiveKeys) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull List<PolarisEntitiesActiveKey> entityActiveKeys) {
// now build a list to quickly verify that nothing has changed
return entityActiveKeys.stream()
.map(entityActiveKey -> this.lookupEntityActive(callCtx, entityActiveKey))
@@ -518,21 +518,21 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisEntityActiveRecord> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull List<PolarisEntityActiveRecord> listActiveEntities(
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType) {
+ @Nonnull PolarisEntityType entityType) {
return listActiveEntities(callCtx, catalogId, parentId, entityType, Predicates.alwaysTrue());
}
@Override
- public @NotNull List<PolarisEntityActiveRecord> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull List<PolarisEntityActiveRecord> listActiveEntities(
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull Predicate<PolarisBaseEntity> entityFilter) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull Predicate<PolarisBaseEntity> entityFilter) {
// full range scan under the parent for that type
return listActiveEntities(
callCtx,
@@ -552,14 +552,14 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
}
@Override
- public @NotNull <T> List<T> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull <T> List<T> listActiveEntities(
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
int limit,
- @NotNull Predicate<PolarisBaseEntity> entityFilter,
- @NotNull Function<PolarisBaseEntity, T> transformer) {
+ @Nonnull Predicate<PolarisBaseEntity> entityFilter,
+ @Nonnull Function<PolarisBaseEntity, T> transformer) {
// full range scan under the parent for that type
return this.store
.lookupFullEntitiesActive(localSession.get(), catalogId, parentId, entityType)
@@ -574,7 +574,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public boolean hasChildren(
- @NotNull PolarisCallContext callContext,
+ @Nonnull PolarisCallContext callContext,
@Nullable PolarisEntityType entityType,
long catalogId,
long parentId) {
@@ -586,7 +586,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public int lookupEntityGrantRecordsVersion(
- @NotNull PolarisCallContext callCtx, long catalogId, long entityId) {
+ @Nonnull PolarisCallContext callCtx, long catalogId, long entityId) {
ModelEntityChangeTracking entity =
this.store.lookupEntityChangeTracking(localSession.get(), catalogId, entityId);
@@ -597,7 +597,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public @Nullable PolarisGrantRecord lookupGrantRecord(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long securableCatalogId,
long securableId,
long granteeCatalogId,
@@ -616,8 +616,8 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisGrantRecord> loadAllGrantRecordsOnSecurable(
- @NotNull PolarisCallContext callCtx, long securableCatalogId, long securableId) {
+ public @Nonnull List<PolarisGrantRecord> loadAllGrantRecordsOnSecurable(
+ @Nonnull PolarisCallContext callCtx, long securableCatalogId, long securableId) {
// now fetch all grants for this securable
return this.store
.lookupAllGrantRecordsOnSecurable(localSession.get(), securableCatalogId, securableId)
@@ -628,8 +628,8 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisGrantRecord> loadAllGrantRecordsOnGrantee(
- @NotNull PolarisCallContext callCtx, long granteeCatalogId, long granteeId) {
+ public @Nonnull List<PolarisGrantRecord> loadAllGrantRecordsOnGrantee(
+ @Nonnull PolarisCallContext callCtx, long granteeCatalogId, long granteeId) {
// now fetch all grants assigned to this grantee
return this.store
.lookupGrantRecordsOnGrantee(localSession.get(), granteeCatalogId, granteeId)
@@ -641,15 +641,15 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public @Nullable PolarisPrincipalSecrets loadPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId) {
return ModelPrincipalSecrets.toPrincipalSecrets(
this.store.lookupPrincipalSecrets(localSession.get(), clientId));
}
/** {@inheritDoc} */
@Override
- public @NotNull PolarisPrincipalSecrets generateNewPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String principalName, long principalId) {
+ public @Nonnull PolarisPrincipalSecrets generateNewPrincipalSecrets(
+ @Nonnull PolarisCallContext callCtx, @Nonnull String principalName, long principalId) {
// ensure principal client id is unique
PolarisPrincipalSecrets principalSecrets;
ModelPrincipalSecrets lookupPrincipalSecrets;
@@ -672,12 +672,12 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
- public @NotNull PolarisPrincipalSecrets rotatePrincipalSecrets(
- @NotNull PolarisCallContext callCtx,
- @NotNull String clientId,
+ public @Nonnull PolarisPrincipalSecrets rotatePrincipalSecrets(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull String clientId,
long principalId,
boolean reset,
- @NotNull String oldSecretHash) {
+ @Nonnull String oldSecretHash) {
// load the existing secrets
PolarisPrincipalSecrets principalSecrets =
@@ -720,7 +720,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
/** {@inheritDoc} */
@Override
public void deletePrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId, long principalId) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId, long principalId) {
// load the existing secrets
ModelPrincipalSecrets principalSecrets =
this.store.lookupPrincipalSecrets(localSession.get(), clientId);
@@ -753,7 +753,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
@Override
public @Nullable <T extends PolarisStorageConfigurationInfo>
PolarisStorageIntegration<T> createStorageIntegration(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
PolarisStorageConfigurationInfo polarisStorageConfigurationInfo) {
@@ -765,7 +765,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreS
@Override
public @Nullable <T extends PolarisStorageConfigurationInfo>
PolarisStorageIntegration<T> loadPolarisStorageIntegration(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
PolarisStorageConfigurationInfo storageConfig =
PolarisMetaStoreManagerImpl.readStorageConfiguration(callCtx, entity);
return storageIntegrationProvider.getStorageIntegrationForConfig(storageConfig);
diff --git a/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkStore.java b/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkStore.java
index 2958f7cc..b71adcd7 100644
--- a/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkStore.java
+++ b/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkStore.java
@@ -18,6 +18,8 @@
*/
package org.apache.polaris.extension.persistence.impl.eclipselink;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import jakarta.persistence.EntityManager;
import jakarta.persistence.TypedQuery;
import java.util.ArrayList;
@@ -39,8 +41,6 @@ import org.apache.polaris.core.persistence.models.ModelEntityChangeTracking;
import org.apache.polaris.core.persistence.models.ModelEntityDropped;
import org.apache.polaris.core.persistence.models.ModelGrantRecord;
import org.apache.polaris.core.persistence.models.ModelPrincipalSecrets;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,7 +62,7 @@ public class PolarisEclipseLinkStore {
*
* @param diagnostics diagnostic services
*/
- public PolarisEclipseLinkStore(@NotNull PolarisDiagnostics diagnostics) {
+ public PolarisEclipseLinkStore(@Nonnull PolarisDiagnostics diagnostics) {
this.diagnosticServices = diagnostics;
}
@@ -301,7 +301,7 @@ public class PolarisEclipseLinkStore {
}
List<ModelEntity> lookupFullEntitiesActive(
- EntityManager session, long catalogId, long parentId, @NotNull PolarisEntityType entityType) {
+ EntityManager session, long catalogId, long parentId, @Nonnull PolarisEntityType entityType) {
diagnosticServices.check(session != null, "session_is_null");
checkInitialized();
diff --git a/polaris-core/build.gradle.kts b/polaris-core/build.gradle.kts
index ec5b2bd3..32dd38f9 100644
--- a/polaris-core/build.gradle.kts
+++ b/polaris-core/build.gradle.kts
@@ -109,9 +109,9 @@ dependencies {
testFixturesApi("com.fasterxml.jackson.core:jackson-databind")
testFixturesApi(libs.commons.lang3)
testFixturesApi(libs.threeten.extra)
- testFixturesApi(libs.jetbrains.annotations)
testFixturesApi(platform(libs.jackson.bom))
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
+ testFixturesApi(libs.jakarta.annotation.api)
compileOnly(libs.jakarta.annotation.api)
compileOnly(libs.jakarta.persistence.api)
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java b/polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java
index 15e3683c..2b64fe66 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java
@@ -18,10 +18,10 @@
*/
package org.apache.polaris.core;
+import jakarta.annotation.Nonnull;
import java.time.Clock;
import java.time.ZoneId;
import org.apache.polaris.core.persistence.PolarisMetaStoreSession;
-import org.jetbrains.annotations.NotNull;
/**
* The Call context is allocated each time a new REST request is processed. It contains instances of
@@ -40,10 +40,10 @@ public class PolarisCallContext {
private final Clock clock;
public PolarisCallContext(
- @NotNull PolarisMetaStoreSession metaStore,
- @NotNull PolarisDiagnostics diagServices,
- @NotNull PolarisConfigurationStore configurationStore,
- @NotNull Clock clock) {
+ @Nonnull PolarisMetaStoreSession metaStore,
+ @Nonnull PolarisDiagnostics diagServices,
+ @Nonnull PolarisConfigurationStore configurationStore,
+ @Nonnull Clock clock) {
this.metaStore = metaStore;
this.diagServices = diagServices;
this.configurationStore = configurationStore;
@@ -51,7 +51,7 @@ public class PolarisCallContext {
}
public PolarisCallContext(
- @NotNull PolarisMetaStoreSession metaStore, @NotNull PolarisDiagnostics diagServices) {
+ @Nonnull PolarisMetaStoreSession metaStore, @Nonnull PolarisDiagnostics diagServices) {
this.metaStore = metaStore;
this.diagServices = diagServices;
this.configurationStore = new PolarisConfigurationStore() {};
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/PolarisConfigurationStore.java b/polaris-core/src/main/java/org/apache/polaris/core/PolarisConfigurationStore.java
index 1f8377a3..a3c90220 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/PolarisConfigurationStore.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/PolarisConfigurationStore.java
@@ -19,11 +19,11 @@
package org.apache.polaris.core;
import com.google.common.base.Preconditions;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import org.apache.polaris.core.entity.CatalogEntity;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* Dynamic configuration store used to retrieve runtime parameters, which may vary by realm or by
@@ -52,8 +52,8 @@ public interface PolarisConfigurationStore {
* @return the current value or the supplied default value
* @param <T> the type of the configuration value
*/
- default <T> @NotNull T getConfiguration(
- PolarisCallContext ctx, String configName, @NotNull T defaultValue) {
+ default <T> @Nonnull T getConfiguration(
+ PolarisCallContext ctx, String configName, @Nonnull T defaultValue) {
Preconditions.checkNotNull(defaultValue, "Cannot pass null as a default value");
T configValue = getConfiguration(ctx, configName);
return configValue != null ? configValue : defaultValue;
@@ -63,7 +63,7 @@ public interface PolarisConfigurationStore {
* In some cases, we may extract a value that doesn't match the expected type for a config. This
* method can be used to attempt to force-cast it using `String.valueOf`
*/
- private <T> @NotNull T tryCast(PolarisConfiguration<T> config, Object value) {
+ private <T> @Nonnull T tryCast(PolarisConfiguration<T> config, Object value) {
if (value == null) {
return config.defaultValue;
}
@@ -91,7 +91,7 @@ public interface PolarisConfigurationStore {
* @return the current value set for the configuration key or null if not set
* @param <T> the type of the configuration value
*/
- default <T> @NotNull T getConfiguration(PolarisCallContext ctx, PolarisConfiguration<T> config) {
+ default <T> @Nonnull T getConfiguration(PolarisCallContext ctx, PolarisConfiguration<T> config) {
T result = getConfiguration(ctx, config.key, config.defaultValue);
return tryCast(config, result);
}
@@ -106,9 +106,9 @@ public interface PolarisConfigurationStore {
* @return the current value set for the configuration key or null if not set
* @param <T> the type of the configuration value
*/
- default <T> @NotNull T getConfiguration(
+ default <T> @Nonnull T getConfiguration(
PolarisCallContext ctx,
- @NotNull CatalogEntity catalogEntity,
+ @Nonnull CatalogEntity catalogEntity,
PolarisConfiguration<T> config) {
if (config.hasCatalogConfig()
&& catalogEntity.getPropertiesAsMap().containsKey(config.catalogConfig())) {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/auth/AuthenticatedPolarisPrincipal.java b/polaris-core/src/main/java/org/apache/polaris/core/auth/AuthenticatedPolarisPrincipal.java
index 4929b8c5..0e8ccf57 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/auth/AuthenticatedPolarisPrincipal.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/auth/AuthenticatedPolarisPrincipal.java
@@ -18,11 +18,11 @@
*/
package org.apache.polaris.core.auth;
+import jakarta.annotation.Nonnull;
import java.util.List;
import java.util.Set;
import org.apache.polaris.core.entity.PolarisEntity;
import org.apache.polaris.core.entity.PrincipalRoleEntity;
-import org.jetbrains.annotations.NotNull;
/** Holds the results of request authentication. */
public class AuthenticatedPolarisPrincipal implements java.security.Principal {
@@ -33,7 +33,7 @@ public class AuthenticatedPolarisPrincipal implements java.security.Principal {
private List<PrincipalRoleEntity> activatedPrincipalRoles;
public AuthenticatedPolarisPrincipal(
- @NotNull PolarisEntity principalEntity, @NotNull Set<String> activatedPrincipalRoles) {
+ @Nonnull PolarisEntity principalEntity, @Nonnull Set<String> activatedPrincipalRoles) {
this.principalEntity = principalEntity;
this.activatedPrincipalRoleNames = activatedPrincipalRoles;
this.activatedPrincipalRoles = null;
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizer.java b/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizer.java
index 5224739d..31e69b08 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizer.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizer.java
@@ -18,27 +18,27 @@
*/
package org.apache.polaris.core.auth;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import java.util.Set;
import org.apache.polaris.core.entity.PolarisBaseEntity;
import org.apache.polaris.core.persistence.PolarisResolvedPathWrapper;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/** Interface for invoking authorization checks. */
public interface PolarisAuthorizer {
void authorizeOrThrow(
- @NotNull AuthenticatedPolarisPrincipal authenticatedPrincipal,
- @NotNull Set<PolarisBaseEntity> activatedEntities,
- @NotNull PolarisAuthorizableOperation authzOp,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPrincipal,
+ @Nonnull Set<PolarisBaseEntity> activatedEntities,
+ @Nonnull PolarisAuthorizableOperation authzOp,
@Nullable PolarisResolvedPathWrapper target,
@Nullable PolarisResolvedPathWrapper secondary);
void authorizeOrThrow(
- @NotNull AuthenticatedPolarisPrincipal authenticatedPrincipal,
- @NotNull Set<PolarisBaseEntity> activatedEntities,
- @NotNull PolarisAuthorizableOperation authzOp,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPrincipal,
+ @Nonnull Set<PolarisBaseEntity> activatedEntities,
+ @Nonnull PolarisAuthorizableOperation authzOp,
@Nullable List<PolarisResolvedPathWrapper> targets,
@Nullable List<PolarisResolvedPathWrapper> secondaries);
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizerImpl.java b/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizerImpl.java
index 3424f3bd..7b6e91e4 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizerImpl.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizerImpl.java
@@ -91,6 +91,8 @@ import static org.apache.polaris.core.entity.PolarisPrivilege.VIEW_WRITE_PROPERT
import com.google.common.base.Preconditions;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.SetMultimap;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@@ -105,8 +107,6 @@ import org.apache.polaris.core.entity.PolarisGrantRecord;
import org.apache.polaris.core.entity.PolarisPrivilege;
import org.apache.polaris.core.persistence.PolarisResolvedPathWrapper;
import org.apache.polaris.core.persistence.ResolvedPolarisEntity;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -485,9 +485,9 @@ public class PolarisAuthorizerImpl implements PolarisAuthorizer {
@Override
public void authorizeOrThrow(
- @NotNull AuthenticatedPolarisPrincipal authenticatedPrincipal,
- @NotNull Set<PolarisBaseEntity> activatedEntities,
- @NotNull PolarisAuthorizableOperation authzOp,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPrincipal,
+ @Nonnull Set<PolarisBaseEntity> activatedEntities,
+ @Nonnull PolarisAuthorizableOperation authzOp,
@Nullable PolarisResolvedPathWrapper target,
@Nullable PolarisResolvedPathWrapper secondary) {
authorizeOrThrow(
@@ -500,9 +500,9 @@ public class PolarisAuthorizerImpl implements PolarisAuthorizer {
@Override
public void authorizeOrThrow(
- @NotNull AuthenticatedPolarisPrincipal authenticatedPrincipal,
- @NotNull Set<PolarisBaseEntity> activatedEntities,
- @NotNull PolarisAuthorizableOperation authzOp,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPrincipal,
+ @Nonnull Set<PolarisBaseEntity> activatedEntities,
+ @Nonnull PolarisAuthorizableOperation authzOp,
@Nullable List<PolarisResolvedPathWrapper> targets,
@Nullable List<PolarisResolvedPathWrapper> secondaries) {
boolean enforceCredentialRotationRequiredState =
@@ -535,9 +535,9 @@ public class PolarisAuthorizerImpl implements PolarisAuthorizer {
* the operation.
*/
public boolean isAuthorized(
- @NotNull AuthenticatedPolarisPrincipal authenticatedPolarisPrincipal,
- @NotNull Set<PolarisBaseEntity> activatedEntities,
- @NotNull PolarisAuthorizableOperation authzOp,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPolarisPrincipal,
+ @Nonnull Set<PolarisBaseEntity> activatedEntities,
+ @Nonnull PolarisAuthorizableOperation authzOp,
@Nullable PolarisResolvedPathWrapper target,
@Nullable PolarisResolvedPathWrapper secondary) {
return isAuthorized(
@@ -549,9 +549,9 @@ public class PolarisAuthorizerImpl implements PolarisAuthorizer {
}
public boolean isAuthorized(
- @NotNull AuthenticatedPolarisPrincipal authenticatedPolarisPrincipal,
- @NotNull Set<PolarisBaseEntity> activatedEntities,
- @NotNull PolarisAuthorizableOperation authzOp,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPolarisPrincipal,
+ @Nonnull Set<PolarisBaseEntity> activatedEntities,
+ @Nonnull PolarisAuthorizableOperation authzOp,
@Nullable List<PolarisResolvedPathWrapper> targets,
@Nullable List<PolarisResolvedPathWrapper> secondaries) {
Set<Long> entityIdSet =
@@ -598,7 +598,7 @@ public class PolarisAuthorizerImpl implements PolarisAuthorizer {
* errors/exceptions.
*/
public boolean hasTransitivePrivilege(
- @NotNull AuthenticatedPolarisPrincipal authenticatedPolarisPrincipal,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPolarisPrincipal,
Set<Long> activatedGranteeIds,
PolarisPrivilege desiredPrivilege,
PolarisResolvedPathWrapper resolvedPath) {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisGrantManager.java b/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisGrantManager.java
index 0bc2870f..1cf52142 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisGrantManager.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisGrantManager.java
@@ -21,6 +21,8 @@ package org.apache.polaris.core.auth;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -30,8 +32,6 @@ import org.apache.polaris.core.entity.PolarisEntityCore;
import org.apache.polaris.core.entity.PolarisGrantRecord;
import org.apache.polaris.core.entity.PolarisPrivilege;
import org.apache.polaris.core.persistence.BaseResult;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/** Manage grants for Polaris entities. */
public interface PolarisGrantManager {
@@ -47,12 +47,12 @@ public interface PolarisGrantManager {
* @return the grant record we created for this grant. Will return ENTITY_NOT_FOUND if the
* specified role couldn't be found. Should be retried in that case
*/
- @NotNull
+ @Nonnull
PrivilegeResult grantUsageOnRoleToGrantee(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee);
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee);
/**
* Revoke usage on a role (a catalog or a principal role) from a grantee (e.g. a principal role or
@@ -67,12 +67,12 @@ public interface PolarisGrantManager {
* Should be retried in that case. Will return GRANT_NOT_FOUND if the grant to revoke cannot
* be found
*/
- @NotNull
+ @Nonnull
PrivilegeResult revokeUsageOnRoleFromGrantee(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee);
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee);
/**
* Grant a privilege on a catalog securable to a grantee.
@@ -86,13 +86,13 @@ public interface PolarisGrantManager {
* @return the grant record we created for this grant. Will return ENTITY_NOT_FOUND if the
* specified role couldn't be found. Should be retried in that case
*/
- @NotNull
+ @Nonnull
PrivilegeResult grantPrivilegeOnSecurableToRole(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore grantee,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisPrivilege privilege);
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisPrivilege privilege);
/**
* Revoke a privilege on a catalog securable from a grantee.
@@ -107,13 +107,13 @@ public interface PolarisGrantManager {
* Should be retried in that case. Will return GRANT_NOT_FOUND if the grant to revoke cannot
* be found
*/
- @NotNull
+ @Nonnull
PrivilegeResult revokePrivilegeOnSecurableFromRole(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore grantee,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisPrivilege privilege);
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisPrivilege privilege);
/**
* This method should be used by the Polaris app to cache all grant records on a securable.
@@ -124,9 +124,9 @@ public interface PolarisGrantManager {
* @return the list of grants and the version of the grant records. We will return
* ENTITY_NOT_FOUND if the securable cannot be found
*/
- @NotNull
+ @Nonnull
LoadGrantsResult loadGrantsOnSecurable(
- @NotNull PolarisCallContext callCtx, long securableCatalogId, long securableId);
+ @Nonnull PolarisCallContext callCtx, long securableCatalogId, long securableId);
/**
* This method should be used by the Polaris app to load all grants made to a grantee, either a
@@ -138,7 +138,7 @@ public interface PolarisGrantManager {
* @return the list of grants and the version of the grant records. We will return NULL if the
* grantee does not exist
*/
- @NotNull
+ @Nonnull
LoadGrantsResult loadGrantsToGrantee(
PolarisCallContext callCtx, long granteeCatalogId, long granteeId);
@@ -155,7 +155,7 @@ public interface PolarisGrantManager {
* @param extraInformation extra information
*/
public PrivilegeResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.grantRecord = null;
}
@@ -165,14 +165,14 @@ public interface PolarisGrantManager {
*
* @param grantRecord grant record being granted or revoked
*/
- public PrivilegeResult(@NotNull PolarisGrantRecord grantRecord) {
+ public PrivilegeResult(@Nonnull PolarisGrantRecord grantRecord) {
super(BaseResult.ReturnStatus.SUCCESS);
this.grantRecord = grantRecord;
}
@JsonCreator
private PrivilegeResult(
- @JsonProperty("returnStatus") @NotNull BaseResult.ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull BaseResult.ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@JsonProperty("grantRecord") PolarisGrantRecord grantRecord) {
super(returnStatus, extraInformation);
@@ -202,7 +202,7 @@ public interface PolarisGrantManager {
* @param extraInformation extra information
*/
public LoadGrantsResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.grantsVersion = 0;
this.grantRecords = null;
@@ -217,7 +217,7 @@ public interface PolarisGrantManager {
*/
public LoadGrantsResult(
int grantsVersion,
- @NotNull List<PolarisGrantRecord> grantRecords,
+ @Nonnull List<PolarisGrantRecord> grantRecords,
List<PolarisBaseEntity> entities) {
super(BaseResult.ReturnStatus.SUCCESS);
this.grantsVersion = grantsVersion;
@@ -227,7 +227,7 @@ public interface PolarisGrantManager {
@JsonCreator
private LoadGrantsResult(
- @JsonProperty("returnStatus") @NotNull BaseResult.ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull BaseResult.ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@JsonProperty("grantsVersion") int grantsVersion,
@JsonProperty("grantRecords") List<PolarisGrantRecord> grantRecords,
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisSecretsManager.java b/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisSecretsManager.java
index 73788208..d63368fd 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisSecretsManager.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisSecretsManager.java
@@ -20,11 +20,11 @@ package org.apache.polaris.core.auth;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
import org.apache.polaris.core.persistence.BaseResult;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/** Manages secrets for Polaris principals. */
public interface PolarisSecretsManager {
@@ -35,9 +35,9 @@ public interface PolarisSecretsManager {
* @param clientId principal client id
* @return the secrets associated to that principal, including the entity id of the principal
*/
- @NotNull
+ @Nonnull
PrincipalSecretsResult loadPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId);
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId);
/**
* Rotate secrets
@@ -51,13 +51,13 @@ public interface PolarisSecretsManager {
* @param oldSecretHash main secret hash for the principal
* @return the secrets associated to that principal amd the id of the principal
*/
- @NotNull
+ @Nonnull
PrincipalSecretsResult rotatePrincipalSecrets(
- @NotNull PolarisCallContext callCtx,
- @NotNull String clientId,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull String clientId,
long principalId,
boolean reset,
- @NotNull String oldSecretHash);
+ @Nonnull String oldSecretHash);
/** the result of load/rotate principal secrets */
class PrincipalSecretsResult extends BaseResult {
@@ -72,7 +72,7 @@ public interface PolarisSecretsManager {
* @param extraInformation extra information
*/
public PrincipalSecretsResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.principalSecrets = null;
}
@@ -82,16 +82,16 @@ public interface PolarisSecretsManager {
*
* @param principalSecrets and associated secret information
*/
- public PrincipalSecretsResult(@NotNull PolarisPrincipalSecrets principalSecrets) {
+ public PrincipalSecretsResult(@Nonnull PolarisPrincipalSecrets principalSecrets) {
super(BaseResult.ReturnStatus.SUCCESS);
this.principalSecrets = principalSecrets;
}
@JsonCreator
private PrincipalSecretsResult(
- @JsonProperty("returnStatus") @NotNull BaseResult.ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull BaseResult.ReturnStatus returnStatus,
@JsonProperty("extraInformation") @Nullable String extraInformation,
- @JsonProperty("principalSecrets") @NotNull PolarisPrincipalSecrets principalSecrets) {
+ @JsonProperty("principalSecrets") @Nonnull PolarisPrincipalSecrets principalSecrets) {
super(returnStatus, extraInformation);
this.principalSecrets = principalSecrets;
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/context/CallContext.java b/polaris-core/src/main/java/org/apache/polaris/core/context/CallContext.java
index 583ff18e..d9962f9c 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/context/CallContext.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/context/CallContext.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.core.context;
+import jakarta.annotation.Nonnull;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -26,7 +27,6 @@ import org.apache.iceberg.io.CloseableGroup;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal;
-import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -133,7 +133,7 @@ public interface CallContext extends AutoCloseable {
Map<String, Object> contextVariables();
- default @NotNull CloseableGroup closeables() {
+ default @Nonnull CloseableGroup closeables() {
return (CloseableGroup)
contextVariables().computeIfAbsent(CLOSEABLES, key -> new CloseableGroup());
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java b/polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java
index fea6b746..e64d5a40 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java
@@ -20,6 +20,8 @@ package org.apache.polaris.core.entity;
import static org.apache.polaris.core.admin.model.StorageConfigInfo.StorageTypeEnum.AZURE;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -42,8 +44,6 @@ import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo;
import org.apache.polaris.core.storage.azure.AzureStorageConfigurationInfo;
import org.apache.polaris.core.storage.gcp.GcpStorageConfigurationInfo;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* Catalog specific subclass of the {@link PolarisEntity} that handles conversion from the {@link
@@ -283,7 +283,7 @@ public class CatalogEntity extends PolarisEntity {
}
}
- protected static @NotNull String getDefaultBaseLocation(Catalog catalog) {
+ protected static @Nonnull String getDefaultBaseLocation(Catalog catalog) {
return catalog.getProperties().getDefaultBaseLocation();
}
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntity.java b/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntity.java
index d3ab781a..5f0a7ad6 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntity.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntity.java
@@ -21,6 +21,7 @@ package org.apache.polaris.core.entity;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.annotation.Nonnull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -29,7 +30,6 @@ import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
-import org.jetbrains.annotations.NotNull;
public class PolarisEntity extends PolarisBaseEntity {
@@ -171,7 +171,7 @@ public class PolarisEntity extends PolarisBaseEntity {
.orElse(null);
}
- public PolarisEntity(@NotNull PolarisBaseEntity sourceEntity) {
+ public PolarisEntity(@Nonnull PolarisBaseEntity sourceEntity) {
super(
sourceEntity.getCatalogId(),
sourceEntity.getId(),
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntitySubType.java b/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntitySubType.java
index 05d937d1..c206d078 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntitySubType.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntitySubType.java
@@ -20,7 +20,7 @@ package org.apache.polaris.core.entity;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import org.jetbrains.annotations.Nullable;
+import jakarta.annotation.Nullable;
/** Subtype for an entity */
public enum PolarisEntitySubType {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntityType.java b/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntityType.java
index fa3a2d66..af50eed6 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntityType.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisEntityType.java
@@ -20,7 +20,7 @@ package org.apache.polaris.core.entity;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import org.jetbrains.annotations.Nullable;
+import jakarta.annotation.Nullable;
/** Types of entities with their id */
public enum PolarisEntityType {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrivilege.java b/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrivilege.java
index 5148e42a..b674af26 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrivilege.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrivilege.java
@@ -20,8 +20,8 @@ package org.apache.polaris.core.entity;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
/** List of privileges */
public enum PolarisPrivilege {
@@ -114,9 +114,9 @@ public enum PolarisPrivilege {
*/
PolarisPrivilege(
int code,
- @NotNull PolarisEntityType securableType,
- @NotNull PolarisEntitySubType securableSubType,
- @NotNull PolarisEntityType granteeType) {
+ @Nonnull PolarisEntityType securableType,
+ @Nonnull PolarisEntitySubType securableSubType,
+ @Nonnull PolarisEntityType granteeType) {
this.code = code;
this.securableType = securableType;
this.securableSubType = securableSubType;
@@ -129,7 +129,7 @@ public enum PolarisPrivilege {
* @param code internal code associated to this privilege
* @param securableType securable type
*/
- PolarisPrivilege(int code, @NotNull PolarisEntityType securableType) {
+ PolarisPrivilege(int code, @Nonnull PolarisEntityType securableType) {
this.code = code;
this.securableType = securableType;
this.securableSubType = PolarisEntitySubType.NULL_SUBTYPE;
@@ -145,8 +145,8 @@ public enum PolarisPrivilege {
*/
PolarisPrivilege(
int code,
- @NotNull PolarisEntityType securableType,
- @NotNull PolarisEntitySubType securableSubType) {
+ @Nonnull PolarisEntityType securableType,
+ @Nonnull PolarisEntitySubType securableSubType) {
this.code = code;
this.securableType = securableType;
this.securableSubType = securableSubType;
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/monitor/PolarisMetricRegistry.java b/polaris-core/src/main/java/org/apache/polaris/core/monitor/PolarisMetricRegistry.java
index 7f09353c..a489021c 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/monitor/PolarisMetricRegistry.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/monitor/PolarisMetricRegistry.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.core.monitor;
+import com.google.common.annotations.VisibleForTesting;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
@@ -33,7 +34,6 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import org.apache.polaris.core.resource.TimedApi;
-import org.jetbrains.annotations.VisibleForTesting;
/**
* Wrapper around the Micrometer {@link MeterRegistry} providing additional metric management
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/BaseResult.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/BaseResult.java
index c2e2d0bd..cea33071 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/BaseResult.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/BaseResult.java
@@ -20,8 +20,8 @@ package org.apache.polaris.core.persistence;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
/** Base result class for any call to the persistence layer */
public class BaseResult {
@@ -36,14 +36,14 @@ public class BaseResult {
this.extraInformation = null;
}
- public BaseResult(@NotNull BaseResult.ReturnStatus returnStatus) {
+ public BaseResult(@Nonnull BaseResult.ReturnStatus returnStatus) {
this.returnStatusCode = returnStatus.getCode();
this.extraInformation = null;
}
@JsonCreator
public BaseResult(
- @JsonProperty("returnStatus") @NotNull BaseResult.ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull BaseResult.ReturnStatus returnStatus,
@JsonProperty("extraInformation") @Nullable String extraInformation) {
this.returnStatusCode = returnStatus.getCode();
this.extraInformation = extraInformation;
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
index b373f507..382a557b 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.core.persistence;
+import jakarta.annotation.Nonnull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -36,7 +37,6 @@ import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
import org.apache.polaris.core.monitor.PolarisMetricRegistry;
import org.apache.polaris.core.storage.PolarisStorageIntegrationProvider;
import org.apache.polaris.core.storage.cache.StorageCredentialCache;
-import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -61,10 +61,10 @@ public abstract class LocalPolarisMetaStoreManagerFactory<StoreType>
private boolean bootstrap;
- protected abstract StoreType createBackingStore(@NotNull PolarisDiagnostics diagnostics);
+ protected abstract StoreType createBackingStore(@Nonnull PolarisDiagnostics diagnostics);
protected abstract PolarisMetaStoreSession createMetaStoreSession(
- @NotNull StoreType store, @NotNull RealmContext realmContext);
+ @Nonnull StoreType store, @Nonnull RealmContext realmContext);
protected PrincipalSecretsGenerator secretsGenerator(RealmContext realmContext) {
if (bootstrap) {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityManager.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityManager.java
index 4709ec89..ba7398aa 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityManager.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityManager.java
@@ -18,6 +18,8 @@
*/
package org.apache.polaris.core.persistence;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal;
import org.apache.polaris.core.context.CallContext;
@@ -31,8 +33,6 @@ import org.apache.polaris.core.persistence.cache.EntityCache;
import org.apache.polaris.core.persistence.resolver.PolarisResolutionManifest;
import org.apache.polaris.core.persistence.resolver.Resolver;
import org.apache.polaris.core.storage.cache.StorageCredentialCache;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* Wraps logic of handling name-caching and entity-caching against a concrete underlying entity
@@ -60,8 +60,8 @@ public class PolarisEntityManager {
}
public Resolver prepareResolver(
- @NotNull CallContext callContext,
- @NotNull AuthenticatedPolarisPrincipal authenticatedPrincipal,
+ @Nonnull CallContext callContext,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPrincipal,
@Nullable String referenceCatalogName) {
return new Resolver(
callContext.getPolarisCallContext(),
@@ -76,8 +76,8 @@ public class PolarisEntityManager {
}
public PolarisResolutionManifest prepareResolutionManifest(
- @NotNull CallContext callContext,
- @NotNull AuthenticatedPolarisPrincipal authenticatedPrincipal,
+ @Nonnull CallContext callContext,
+ @Nonnull AuthenticatedPolarisPrincipal authenticatedPrincipal,
@Nullable String referenceCatalogName) {
PolarisResolutionManifest manifest =
new PolarisResolutionManifest(
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityResolver.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityResolver.java
index 6c85c169..3d795d73 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityResolver.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityResolver.java
@@ -18,6 +18,8 @@
*/
package org.apache.polaris.core.persistence;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -30,8 +32,6 @@ import org.apache.polaris.core.entity.PolarisEntityActiveRecord;
import org.apache.polaris.core.entity.PolarisEntityConstants;
import org.apache.polaris.core.entity.PolarisEntityCore;
import org.apache.polaris.core.entity.PolarisEntityType;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* Utility class used by the meta store manager to ensure that all entities which had been resolved
@@ -77,8 +77,8 @@ public class PolarisEntityResolver {
* or a principal can be specified here
*/
PolarisEntityResolver(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
@Nullable PolarisEntityCore resolvedEntity,
@Nullable List<PolarisEntityCore> otherTopLevelEntities) {
@@ -156,8 +156,8 @@ public class PolarisEntityResolver {
* like a catalog.
*/
PolarisEntityResolver(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath) {
this(callCtx, ms, catalogPath, null, null);
}
@@ -172,8 +172,8 @@ public class PolarisEntityResolver {
* @param resolvedEntityDto resolved entity DTO
*/
PolarisEntityResolver(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
PolarisEntityCore resolvedEntityDto) {
this(callCtx, ms, catalogPath, resolvedEntityDto, null);
@@ -189,10 +189,10 @@ public class PolarisEntityResolver {
* @param entity Polaris base entity
*/
PolarisEntityResolver(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisBaseEntity entity) {
this(callCtx, ms, catalogPath, new PolarisEntityCore(entity), null);
}
@@ -238,8 +238,8 @@ public class PolarisEntityResolver {
* @return true if all entities have been resolved successfully
*/
private boolean resolveEntitiesIfNeeded(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
@Nullable PolarisEntityCore resolvedEntity,
@Nullable List<PolarisEntityCore> otherTopLevelEntities) {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManager.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManager.java
index 4c646e38..69652cb8 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManager.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManager.java
@@ -21,6 +21,8 @@ package org.apache.polaris.core.persistence;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import java.util.Map;
import org.apache.polaris.core.PolarisCallContext;
@@ -35,8 +37,6 @@ import org.apache.polaris.core.entity.PolarisEntityType;
import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
import org.apache.polaris.core.persistence.cache.PolarisRemoteCache;
import org.apache.polaris.core.storage.PolarisCredentialVendor;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* Polaris Metastore Manager manages all Polaris entities and associated grant records metadata for
@@ -55,8 +55,8 @@ public interface PolarisMetaStoreManager
* @param callCtx call context
* @return the result of the bootstrap attempt
*/
- @NotNull
- BaseResult bootstrapPolarisService(@NotNull PolarisCallContext callCtx);
+ @Nonnull
+ BaseResult bootstrapPolarisService(@Nonnull PolarisCallContext callCtx);
/**
* Purge all metadata associated with the Polaris service, resetting the metastore to the state it
@@ -69,8 +69,8 @@ public interface PolarisMetaStoreManager
* @param callCtx call context
* @return always success or unexpected error
*/
- @NotNull
- BaseResult purge(@NotNull PolarisCallContext callCtx);
+ @Nonnull
+ BaseResult purge(@Nonnull PolarisCallContext callCtx);
/** the return for an entity lookup call */
class EntityResult extends BaseResult {
@@ -85,7 +85,7 @@ public interface PolarisMetaStoreManager
* @param extraInformation extra information if error. Implementation specific
*/
public EntityResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.entity = null;
}
@@ -95,7 +95,7 @@ public interface PolarisMetaStoreManager
*
* @param entity the entity being looked-up
*/
- public EntityResult(@NotNull PolarisBaseEntity entity) {
+ public EntityResult(@Nonnull PolarisBaseEntity entity) {
super(ReturnStatus.SUCCESS);
this.entity = entity;
}
@@ -107,7 +107,7 @@ public interface PolarisMetaStoreManager
* @param errorStatus error status, cannot be SUCCESS
* @param subTypeCode existing entity subtype code
*/
- public EntityResult(@NotNull BaseResult.ReturnStatus errorStatus, int subTypeCode) {
+ public EntityResult(@Nonnull BaseResult.ReturnStatus errorStatus, int subTypeCode) {
super(errorStatus, Integer.toString(subTypeCode));
this.entity = null;
}
@@ -136,7 +136,7 @@ public interface PolarisMetaStoreManager
@JsonCreator
private EntityResult(
- @JsonProperty("returnStatus") @NotNull ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull ReturnStatus returnStatus,
@JsonProperty("extraInformation") @Nullable String extraInformation,
@JsonProperty("entity") @Nullable PolarisBaseEntity entity) {
super(returnStatus, extraInformation);
@@ -164,13 +164,13 @@ public interface PolarisMetaStoreManager
* entity is not found in the specified path. CONCURRENT_MODIFICATION_DETECTED_NEED_RETRY is
* returned if the specified catalog path cannot be resolved.
*/
- @NotNull
+ @Nonnull
PolarisMetaStoreManager.EntityResult readEntityByName(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityType entityType,
- @NotNull PolarisEntitySubType entitySubType,
- @NotNull String name);
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull PolarisEntitySubType entitySubType,
+ @Nonnull String name);
/** the return the result for a list entities call */
class ListEntitiesResult extends BaseResult {
@@ -185,7 +185,7 @@ public interface PolarisMetaStoreManager
* @param extraInformation extra information
*/
public ListEntitiesResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.entities = null;
}
@@ -195,14 +195,14 @@ public interface PolarisMetaStoreManager
*
* @param entities list of entities being returned, implies success
*/
- public ListEntitiesResult(@NotNull List<PolarisEntityActiveRecord> entities) {
+ public ListEntitiesResult(@Nonnull List<PolarisEntityActiveRecord> entities) {
super(ReturnStatus.SUCCESS);
this.entities = entities;
}
@JsonCreator
private ListEntitiesResult(
- @JsonProperty("returnStatus") @NotNull ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@JsonProperty("entities") List<PolarisEntityActiveRecord> entities) {
super(returnStatus, extraInformation);
@@ -226,12 +226,12 @@ public interface PolarisMetaStoreManager
* Else exact match will be performed.
* @return all entities name, ids and subtype under the specified namespace.
*/
- @NotNull
+ @Nonnull
ListEntitiesResult listEntities(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityType entityType,
- @NotNull PolarisEntitySubType entitySubType);
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull PolarisEntitySubType entitySubType);
/** the return for a generate new entity id */
class GenerateEntityIdResult extends BaseResult {
@@ -246,7 +246,7 @@ public interface PolarisMetaStoreManager
* @param extraInformation extra information
*/
public GenerateEntityIdResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.id = null;
}
@@ -256,14 +256,14 @@ public interface PolarisMetaStoreManager
*
* @param id the new id which was generated
*/
- public GenerateEntityIdResult(@NotNull Long id) {
+ public GenerateEntityIdResult(@Nonnull Long id) {
super(ReturnStatus.SUCCESS);
this.id = id;
}
@JsonCreator
private GenerateEntityIdResult(
- @JsonProperty("returnStatus") @NotNull ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull ReturnStatus returnStatus,
@JsonProperty("extraInformation") @Nullable String extraInformation,
@JsonProperty("id") @Nullable Long id) {
super(returnStatus, extraInformation);
@@ -282,8 +282,8 @@ public interface PolarisMetaStoreManager
* @param callCtx call context
* @return the newly created id, not expected to fail
*/
- @NotNull
- GenerateEntityIdResult generateNewEntityId(@NotNull PolarisCallContext callCtx);
+ @Nonnull
+ GenerateEntityIdResult generateNewEntityId(@Nonnull PolarisCallContext callCtx);
/** the return the result of a create-principal method */
class CreatePrincipalResult extends BaseResult {
@@ -300,7 +300,7 @@ public interface PolarisMetaStoreManager
* @param extraInformation extra information
*/
public CreatePrincipalResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.principal = null;
this.principalSecrets = null;
@@ -313,7 +313,7 @@ public interface PolarisMetaStoreManager
* @param principalSecrets and associated secret information
*/
public CreatePrincipalResult(
- @NotNull PolarisBaseEntity principal, @NotNull PolarisPrincipalSecrets principalSecrets) {
+ @Nonnull PolarisBaseEntity principal, @Nonnull PolarisPrincipalSecrets principalSecrets) {
super(ReturnStatus.SUCCESS);
this.principal = principal;
this.principalSecrets = principalSecrets;
@@ -321,10 +321,10 @@ public interface PolarisMetaStoreManager
@JsonCreator
private CreatePrincipalResult(
- @JsonProperty("returnStatus") @NotNull ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull ReturnStatus returnStatus,
@JsonProperty("extraInformation") @Nullable String extraInformation,
- @JsonProperty("principal") @NotNull PolarisBaseEntity principal,
- @JsonProperty("principalSecrets") @NotNull PolarisPrincipalSecrets principalSecrets) {
+ @JsonProperty("principal") @Nonnull PolarisBaseEntity principal,
+ @JsonProperty("principalSecrets") @Nonnull PolarisPrincipalSecrets principalSecrets) {
super(returnStatus, extraInformation);
this.principal = principal;
this.principalSecrets = principalSecrets;
@@ -348,9 +348,9 @@ public interface PolarisMetaStoreManager
* @return the client_id/secret for the new principal which was created. Will return
* ENTITY_ALREADY_EXISTS if the principal already exists
*/
- @NotNull
+ @Nonnull
CreatePrincipalResult createPrincipal(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity principal);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity principal);
/** the return the result of a create-catalog method */
class CreateCatalogResult extends BaseResult {
@@ -368,7 +368,7 @@ public interface PolarisMetaStoreManager
* @param extraInformation extra information
*/
public CreateCatalogResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.catalog = null;
this.catalogAdminRole = null;
@@ -381,7 +381,7 @@ public interface PolarisMetaStoreManager
* @param catalogAdminRole and associated admin role
*/
public CreateCatalogResult(
- @NotNull PolarisBaseEntity catalog, @NotNull PolarisBaseEntity catalogAdminRole) {
+ @Nonnull PolarisBaseEntity catalog, @Nonnull PolarisBaseEntity catalogAdminRole) {
super(ReturnStatus.SUCCESS);
this.catalog = catalog;
this.catalogAdminRole = catalogAdminRole;
@@ -389,10 +389,10 @@ public interface PolarisMetaStoreManager
@JsonCreator
private CreateCatalogResult(
- @JsonProperty("returnStatus") @NotNull ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull ReturnStatus returnStatus,
@JsonProperty("extraInformation") @Nullable String extraInformation,
- @JsonProperty("catalog") @NotNull PolarisBaseEntity catalog,
- @JsonProperty("catalogAdminRole") @NotNull PolarisBaseEntity catalogAdminRole) {
+ @JsonProperty("catalog") @Nonnull PolarisBaseEntity catalog,
+ @JsonProperty("catalogAdminRole") @Nonnull PolarisBaseEntity catalogAdminRole) {
super(returnStatus, extraInformation);
this.catalog = catalog;
this.catalogAdminRole = catalogAdminRole;
@@ -419,11 +419,11 @@ public interface PolarisMetaStoreManager
* role of the newly created catalog to the service admin role.
* @return if success, the catalog which was created and its admin role.
*/
- @NotNull
+ @Nonnull
CreateCatalogResult createCatalog(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisBaseEntity catalog,
- @NotNull List<PolarisEntityCore> principalRoles);
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisBaseEntity catalog,
+ @Nonnull List<PolarisEntityCore> principalRoles);
/**
* Persist a newly created entity under the specified catalog path if specified, else this is a
@@ -442,11 +442,11 @@ public interface PolarisMetaStoreManager
* or if the catalogPath couldn't be resolved. If null is returned, the client app should
* retry this operation.
*/
- @NotNull
+ @Nonnull
EntityResult createEntityIfNotExists(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity);
+ @Nonnull PolarisBaseEntity entity);
/** a set of returned entities result */
class EntitiesResult extends BaseResult {
@@ -461,7 +461,7 @@ public interface PolarisMetaStoreManager
* @param extraInformation extra information
*/
public EntitiesResult(
- @NotNull BaseResult.ReturnStatus errorStatus, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorStatus, @Nullable String extraInformation) {
super(errorStatus, extraInformation);
this.entities = null;
}
@@ -471,14 +471,14 @@ public interface PolarisMetaStoreManager
*
* @param entities list of entities being returned, implies success
*/
- public EntitiesResult(@NotNull List<PolarisBaseEntity> entities) {
+ public EntitiesResult(@Nonnull List<PolarisBaseEntity> entities) {
super(ReturnStatus.SUCCESS);
this.entities = entities;
}
@JsonCreator
private EntitiesResult(
- @JsonProperty("returnStatus") @NotNull ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@JsonProperty("entities") List<PolarisBaseEntity> entities) {
super(returnStatus, extraInformation);
@@ -508,11 +508,11 @@ public interface PolarisMetaStoreManager
* exists or if the catalogPath couldn't be resolved. If null is returned, the client app
* should retry this operation.
*/
- @NotNull
+ @Nonnull
EntitiesResult createEntitiesIfNotExist(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull List<? extends PolarisBaseEntity> entities);
+ @Nonnull List<? extends PolarisBaseEntity> entities);
/**
* Update some properties of this entity assuming it can still be resolved the same way and itself
@@ -524,33 +524,33 @@ public interface PolarisMetaStoreManager
* @param entity entity to update, cannot be null
* @return the entity we updated or null if the client should retry
*/
- @NotNull
+ @Nonnull
EntityResult updateEntityPropertiesIfNotChanged(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity);
+ @Nonnull PolarisBaseEntity entity);
/** Class to represent an entity with its path */
class EntityWithPath {
// path to that entity. Could be null if this entity is top-level
- private final @NotNull List<PolarisEntityCore> catalogPath;
+ private final @Nonnull List<PolarisEntityCore> catalogPath;
// the base entity itself
- private final @NotNull PolarisBaseEntity entity;
+ private final @Nonnull PolarisBaseEntity entity;
@JsonCreator
public EntityWithPath(
- @JsonProperty("catalogPath") @NotNull List<PolarisEntityCore> catalogPath,
- @JsonProperty("entity") @NotNull PolarisBaseEntity entity) {
+ @JsonProperty("catalogPath") @Nonnull List<PolarisEntityCore> catalogPath,
+ @JsonProperty("entity") @Nonnull PolarisBaseEntity entity) {
this.catalogPath = catalogPath;
this.entity = entity;
}
- public @NotNull List<PolarisEntityCore> getCatalogPath() {
+ public @Nonnull List<PolarisEntityCore> getCatalogPath() {
return catalogPath;
}
- public @NotNull PolarisBaseEntity getEntity() {
+ public @Nonnull PolarisBaseEntity getEntity() {
return entity;
}
}
@@ -565,9 +565,9 @@ public interface PolarisMetaStoreManager
* @return list of all entities we updated or null if the client should retry because one update
* failed
*/
- @NotNull
+ @Nonnull
EntitiesResult updateEntitiesPropertiesIfNotChanged(
- @NotNull PolarisCallContext callCtx, @NotNull List<EntityWithPath> entities);
+ @Nonnull PolarisCallContext callCtx, @Nonnull List<EntityWithPath> entities);
/**
* Rename an entity, potentially re-parenting it.
@@ -581,13 +581,13 @@ public interface PolarisMetaStoreManager
* required to update the namespace path of the entity if it has changed
* @return the entity after renaming it or null if the rename operation has failed
*/
- @NotNull
+ @Nonnull
EntityResult renameEntity(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore entityToRename,
+ @Nonnull PolarisEntityCore entityToRename,
@Nullable List<PolarisEntityCore> newCatalogPath,
- @NotNull PolarisEntity renamedEntity);
+ @Nonnull PolarisEntity renamedEntity);
// the return the result of a drop entity
class DropEntityResult extends BaseResult {
@@ -602,7 +602,7 @@ public interface PolarisMetaStoreManager
* @param extraInformation extra information
*/
public DropEntityResult(
- @NotNull BaseResult.ReturnStatus errorStatus, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorStatus, @Nullable String extraInformation) {
super(errorStatus, extraInformation);
this.cleanupTaskId = null;
}
@@ -625,7 +625,7 @@ public interface PolarisMetaStoreManager
@JsonCreator
private DropEntityResult(
- @JsonProperty("returnStatus") @NotNull ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@JsonProperty("cleanupTaskId") Long cleanupTaskId) {
super(returnStatus, extraInformation);
@@ -659,11 +659,11 @@ public interface PolarisMetaStoreManager
* that the namespace or catalog to drop still has children, this should not be retried and
* should cause a failure
*/
- @NotNull
+ @Nonnull
DropEntityResult dropEntityIfExists(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore entityToDrop,
+ @Nonnull PolarisEntityCore entityToDrop,
@Nullable Map<String, String> cleanupProperties,
boolean cleanup);
@@ -675,8 +675,8 @@ public interface PolarisMetaStoreManager
* @param entityCatalogId id of the catalog for that entity
* @param entityId the id of the entity to load
*/
- @NotNull
- EntityResult loadEntity(@NotNull PolarisCallContext callCtx, long entityCatalogId, long entityId);
+ @Nonnull
+ EntityResult loadEntity(@Nonnull PolarisCallContext callCtx, long entityCatalogId, long entityId);
/**
* Fetch a list of tasks to be completed. Tasks
@@ -686,6 +686,6 @@ public interface PolarisMetaStoreManager
* @param limit limit
* @return list of tasks to be completed
*/
- @NotNull
- EntitiesResult loadTasks(@NotNull PolarisCallContext callCtx, String executorId, int limit);
+ @Nonnull
+ EntitiesResult loadTasks(@Nonnull PolarisCallContext callCtx, String executorId, int limit);
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManagerImpl.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManagerImpl.java
index edbe6ccf..b90c7e51 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManagerImpl.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManagerImpl.java
@@ -23,6 +23,8 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
@@ -49,13 +51,10 @@ import org.apache.polaris.core.entity.PolarisGrantRecord;
import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
import org.apache.polaris.core.entity.PolarisPrivilege;
import org.apache.polaris.core.entity.PolarisTaskConstants;
-import org.apache.polaris.core.persistence.cache.PolarisRemoteCache.CachedEntryResult;
import org.apache.polaris.core.storage.PolarisCredentialProperty;
import org.apache.polaris.core.storage.PolarisStorageActions;
import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
import org.apache.polaris.core.storage.PolarisStorageIntegration;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -82,9 +81,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @return the entity if it exists, null otherwise
*/
private @Nullable PolarisBaseEntity lookupEntityByName(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisEntitiesActiveKey entityActiveKey) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisEntitiesActiveKey entityActiveKey) {
// ensure that the entity exists
PolarisEntityActiveRecord entityActiveRecord = ms.lookupEntityActive(callCtx, entityActiveKey);
@@ -114,9 +113,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @param writeToActive if true, write it to active
*/
private void writeEntity(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisBaseEntity entity,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisBaseEntity entity,
boolean writeToActive) {
ms.writeToEntities(callCtx, entity);
ms.writeToEntitiesChangeTracking(callCtx, entity);
@@ -135,9 +134,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @param entity entity we need a DPO for
*/
private void persistNewEntity(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisBaseEntity entity) {
// validate the entity type and subtype
callCtx.getDiagServices().checkNotNull(entity, "unexpected_null_entity");
@@ -200,10 +199,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @param entity the entity which has been changed
* @return the entity with its version and lastUpdateTimestamp updated
*/
- private @NotNull PolarisBaseEntity persistEntityAfterChange(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisBaseEntity entity) {
+ private @Nonnull PolarisBaseEntity persistEntityAfterChange(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisBaseEntity entity) {
// validate the entity type and subtype
callCtx.getDiagServices().checkNotNull(entity, "unexpected_null_entity");
@@ -267,9 +266,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @param entity the entity being dropped
*/
private void dropEntity(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisBaseEntity entity) {
// validate the entity type and subtype
callCtx.getDiagServices().checkNotNull(entity, "unexpected_null_dpo");
@@ -363,12 +362,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @param priv privilege
* @return new grant record which was created and persisted
*/
- private @NotNull PolarisGrantRecord persistNewGrantRecord(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisEntityCore grantee,
- @NotNull PolarisPrivilege priv) {
+ private @Nonnull PolarisGrantRecord persistNewGrantRecord(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisEntityCore grantee,
+ @Nonnull PolarisPrivilege priv) {
// validate non null arguments
callCtx.getDiagServices().checkNotNull(securable, "unexpected_null_securable");
@@ -431,11 +430,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @param grantRecord the grant record to remove, which was read in the same transaction
*/
private void revokeGrantRecord(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisEntityCore grantee,
- @NotNull PolarisGrantRecord grantRecord) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisEntityCore grantee,
+ @Nonnull PolarisGrantRecord grantRecord) {
// validate securable
callCtx
@@ -512,12 +511,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @return the catalog we just created and its associated admin catalog role or error if we failed
* to
*/
- private @NotNull CreateCatalogResult createCatalog(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisBaseEntity catalog,
+ private @Nonnull CreateCatalogResult createCatalog(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisBaseEntity catalog,
@Nullable PolarisStorageIntegration<?> integration,
- @NotNull List<PolarisEntityCore> principalRoles) {
+ @Nonnull List<PolarisEntityCore> principalRoles) {
// validate input
callCtx.getDiagServices().checkNotNull(catalog, "unexpected_null_catalog");
@@ -639,7 +638,7 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @param ms meta store in read/write mode
*/
private void bootstrapPolarisService(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisMetaStoreSession ms) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisMetaStoreSession ms) {
// Create a root container entity that can represent the securable for any top-level grants.
PolarisBaseEntity rootContainer =
@@ -699,7 +698,7 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull BaseResult bootstrapPolarisService(@NotNull PolarisCallContext callCtx) {
+ public @Nonnull BaseResult bootstrapPolarisService(@Nonnull PolarisCallContext callCtx) {
// get meta store we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -711,7 +710,7 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
@Override
- public @NotNull BaseResult purge(@NotNull PolarisCallContext callCtx) {
+ public @Nonnull BaseResult purge(@Nonnull PolarisCallContext callCtx) {
// get meta store we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -728,13 +727,13 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* See {@link #readEntityByName(PolarisCallContext, List, PolarisEntityType, PolarisEntitySubType,
* String)}
*/
- private @NotNull PolarisMetaStoreManager.EntityResult readEntityByName(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull PolarisMetaStoreManager.EntityResult readEntityByName(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityType entityType,
- @NotNull PolarisEntitySubType entitySubType,
- @NotNull String name) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull PolarisEntitySubType entitySubType,
+ @Nonnull String name) {
// first resolve again the catalogPath to that entity
PolarisEntityResolver resolver = new PolarisEntityResolver(callCtx, ms, catalogPath);
@@ -764,12 +763,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull PolarisMetaStoreManager.EntityResult readEntityByName(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull PolarisMetaStoreManager.EntityResult readEntityByName(
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityType entityType,
- @NotNull PolarisEntitySubType entitySubType,
- @NotNull String name) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull PolarisEntitySubType entitySubType,
+ @Nonnull String name) {
// get meta store we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -781,12 +780,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/**
* See {@link #listEntities(PolarisCallContext, List, PolarisEntityType, PolarisEntitySubType)}
*/
- private @NotNull ListEntitiesResult listEntities(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull ListEntitiesResult listEntities(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityType entityType,
- @NotNull PolarisEntitySubType entitySubType) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull PolarisEntitySubType entitySubType) {
// first resolve again the catalogPath to that entity
PolarisEntityResolver resolver = new PolarisEntityResolver(callCtx, ms, catalogPath);
@@ -814,11 +813,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull ListEntitiesResult listEntities(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull ListEntitiesResult listEntities(
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityType entityType,
- @NotNull PolarisEntitySubType entitySubType) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull PolarisEntitySubType entitySubType) {
// get meta store we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -829,7 +828,7 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull GenerateEntityIdResult generateNewEntityId(@NotNull PolarisCallContext callCtx) {
+ public @Nonnull GenerateEntityIdResult generateNewEntityId(@Nonnull PolarisCallContext callCtx) {
// get meta store we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -877,10 +876,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** {@link #createPrincipal(PolarisCallContext, PolarisBaseEntity)} */
- private @NotNull CreatePrincipalResult createPrincipal(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisBaseEntity principal) {
+ private @Nonnull CreatePrincipalResult createPrincipal(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisBaseEntity principal) {
// validate input
callCtx.getDiagServices().checkNotNull(principal, "unexpected_null_principal");
@@ -976,8 +975,8 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull CreatePrincipalResult createPrincipal(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity principal) {
+ public @Nonnull CreatePrincipalResult createPrincipal(
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity principal) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -987,14 +986,14 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** See {@link #loadPrincipalSecrets(PolarisCallContext, String)} */
private @Nullable PolarisPrincipalSecrets loadPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, PolarisMetaStoreSession ms, @NotNull String clientId) {
+ @Nonnull PolarisCallContext callCtx, PolarisMetaStoreSession ms, @Nonnull String clientId) {
return ms.loadPrincipalSecrets(callCtx, clientId);
}
/** {@inheritDoc} */
@Override
- public @NotNull PrincipalSecretsResult loadPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId) {
+ public @Nonnull PrincipalSecretsResult loadPrincipalSecrets(
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1009,12 +1008,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** See {@link #} */
private @Nullable PolarisPrincipalSecrets rotatePrincipalSecrets(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull String clientId,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull String clientId,
long principalId,
boolean reset,
- @NotNull String oldSecretHash) {
+ @Nonnull String oldSecretHash) {
// if not found, the principal must have been dropped
EntityResult loadEntityResult =
loadEntity(callCtx, ms, PolarisEntityConstants.getNullId(), principalId);
@@ -1058,12 +1057,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull PrincipalSecretsResult rotatePrincipalSecrets(
- @NotNull PolarisCallContext callCtx,
- @NotNull String clientId,
+ public @Nonnull PrincipalSecretsResult rotatePrincipalSecrets(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull String clientId,
long principalId,
boolean reset,
- @NotNull String oldSecretHash) {
+ @Nonnull String oldSecretHash) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1082,10 +1081,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull CreateCatalogResult createCatalog(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisBaseEntity catalog,
- @NotNull List<PolarisEntityCore> principalRoles) {
+ public @Nonnull CreateCatalogResult createCatalog(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisBaseEntity catalog,
+ @Nonnull List<PolarisEntityCore> principalRoles) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1114,11 +1113,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** {@link #createEntityIfNotExists(PolarisCallContext, List, PolarisBaseEntity)} */
- private @NotNull EntityResult createEntityIfNotExists(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull EntityResult createEntityIfNotExists(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisBaseEntity entity) {
// entity cannot be null
callCtx.getDiagServices().checkNotNull(entity, "unexpected_null_entity");
@@ -1163,10 +1162,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull EntityResult createEntityIfNotExists(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull EntityResult createEntityIfNotExists(
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisBaseEntity entity) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1176,10 +1175,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
@Override
- public @NotNull EntitiesResult createEntitiesIfNotExist(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull EntitiesResult createEntitiesIfNotExist(
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull List<? extends PolarisBaseEntity> entities) {
+ @Nonnull List<? extends PolarisBaseEntity> entities) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1206,11 +1205,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/**
* See {@link #updateEntityPropertiesIfNotChanged(PolarisCallContext, List, PolarisBaseEntity)}
*/
- private @NotNull EntityResult updateEntityPropertiesIfNotChanged(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull EntityResult updateEntityPropertiesIfNotChanged(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisBaseEntity entity) {
// entity cannot be null
callCtx.getDiagServices().checkNotNull(entity, "unexpected_null_entity");
@@ -1246,10 +1245,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull EntityResult updateEntityPropertiesIfNotChanged(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull EntityResult updateEntityPropertiesIfNotChanged(
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisBaseEntity entity) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1259,10 +1258,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** See {@link #updateEntitiesPropertiesIfNotChanged(PolarisCallContext, List)} */
- private @NotNull EntitiesResult updateEntitiesPropertiesIfNotChanged(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull List<EntityWithPath> entities) {
+ private @Nonnull EntitiesResult updateEntitiesPropertiesIfNotChanged(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull List<EntityWithPath> entities) {
// ensure that the entities list is not null
callCtx.getDiagServices().checkNotNull(entities, "unexpected_null_entities");
@@ -1293,8 +1292,8 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull EntitiesResult updateEntitiesPropertiesIfNotChanged(
- @NotNull PolarisCallContext callCtx, @NotNull List<EntityWithPath> entities) {
+ public @Nonnull EntitiesResult updateEntitiesPropertiesIfNotChanged(
+ @Nonnull PolarisCallContext callCtx, @Nonnull List<EntityWithPath> entities) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1307,13 +1306,13 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* See {@link PolarisMetaStoreManager#renameEntity(PolarisCallContext, List, PolarisEntityCore,
* List, PolarisEntity)}
*/
- private @NotNull EntityResult renameEntity(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull EntityResult renameEntity(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore entityToRename,
+ @Nonnull PolarisEntityCore entityToRename,
@Nullable List<PolarisEntityCore> newCatalogPath,
- @NotNull PolarisBaseEntity renamedEntity) {
+ @Nonnull PolarisBaseEntity renamedEntity) {
// entity and new name cannot be null
callCtx.getDiagServices().checkNotNull(entityToRename, "unexpected_null_entityToRename");
@@ -1410,12 +1409,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull EntityResult renameEntity(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull EntityResult renameEntity(
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore entityToRename,
+ @Nonnull PolarisEntityCore entityToRename,
@Nullable List<PolarisEntityCore> newCatalogPath,
- @NotNull PolarisEntity renamedEntity) {
+ @Nonnull PolarisEntity renamedEntity) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1432,11 +1431,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
*
* <p>{@link #dropEntityIfExists(PolarisCallContext, List, PolarisEntityCore, Map, boolean)}
*/
- private @NotNull DropEntityResult dropEntityIfExists(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull DropEntityResult dropEntityIfExists(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore entityToDrop,
+ @Nonnull PolarisEntityCore entityToDrop,
@Nullable Map<String, String> cleanupProperties,
boolean cleanup) {
// entity cannot be null
@@ -1542,10 +1541,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull DropEntityResult dropEntityIfExists(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull DropEntityResult dropEntityIfExists(
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore entityToDrop,
+ @Nonnull PolarisEntityCore entityToDrop,
@Nullable Map<String, String> cleanupProperties,
boolean cleanup) {
// get metastore we should be using
@@ -1571,12 +1570,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @param grantee the grantee
* @return resolver for the specified entities
*/
- private @NotNull PolarisEntityResolver resolveRoleToGranteeUsageGrant(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull PolarisEntityResolver resolveRoleToGranteeUsageGrant(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee) {
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee) {
// validate the grantee input
callCtx.getDiagServices().checkNotNull(grantee, "unexpected_null_grantee");
@@ -1622,11 +1621,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @return a resolver for the role, the catalog path and the securable
*/
private PolarisEntityResolver resolveSecurableToRoleGrant(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisEntityCore grantee,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable) {
+ @Nonnull PolarisEntityCore securable) {
// validate role input
callCtx.getDiagServices().checkNotNull(grantee, "unexpected_null_grantee");
callCtx
@@ -1648,12 +1647,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* See {@link #grantUsageOnRoleToGrantee(PolarisCallContext, PolarisEntityCore, PolarisEntityCore,
* PolarisEntityCore)}
*/
- private @NotNull PrivilegeResult grantUsageOnRoleToGrantee(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull PrivilegeResult grantUsageOnRoleToGrantee(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee) {
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee) {
// ensure these entities have not changed
PolarisEntityResolver resolver =
@@ -1681,11 +1680,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull PrivilegeResult grantUsageOnRoleToGrantee(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull PrivilegeResult grantUsageOnRoleToGrantee(
+ @Nonnull PolarisCallContext callCtx,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee) {
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1698,12 +1697,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* See {@link #revokeUsageOnRoleFromGrantee(PolarisCallContext, PolarisEntityCore,
* PolarisEntityCore, PolarisEntityCore)}
*/
- private @NotNull PrivilegeResult revokeUsageOnRoleFromGrantee(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull PrivilegeResult revokeUsageOnRoleFromGrantee(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee) {
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee) {
// ensure these entities have not changed
PolarisEntityResolver resolver =
@@ -1743,11 +1742,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull PrivilegeResult revokeUsageOnRoleFromGrantee(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull PrivilegeResult revokeUsageOnRoleFromGrantee(
+ @Nonnull PolarisCallContext callCtx,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee) {
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1760,13 +1759,13 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* See {@link #grantPrivilegeOnSecurableToRole(PolarisCallContext, PolarisEntityCore, List,
* PolarisEntityCore, PolarisPrivilege)}
*/
- private @NotNull PrivilegeResult grantPrivilegeOnSecurableToRole(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisEntityCore grantee,
+ private @Nonnull PrivilegeResult grantPrivilegeOnSecurableToRole(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisPrivilege priv) {
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisPrivilege priv) {
// re-resolve now all these entities
PolarisEntityResolver resolver =
@@ -1785,12 +1784,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull PrivilegeResult grantPrivilegeOnSecurableToRole(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore grantee,
+ public @Nonnull PrivilegeResult grantPrivilegeOnSecurableToRole(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisPrivilege privilege) {
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisPrivilege privilege) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1806,13 +1805,13 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* See {@link #revokePrivilegeOnSecurableFromRole(PolarisCallContext, PolarisEntityCore, List,
* PolarisEntityCore, PolarisPrivilege)}
*/
- private @NotNull PrivilegeResult revokePrivilegeOnSecurableFromRole(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull PolarisEntityCore grantee,
+ private @Nonnull PrivilegeResult revokePrivilegeOnSecurableFromRole(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisPrivilege priv) {
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisPrivilege priv) {
// re-resolve now all these entities
PolarisEntityResolver resolver =
@@ -1847,12 +1846,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull PrivilegeResult revokePrivilegeOnSecurableFromRole(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore grantee,
+ public @Nonnull PrivilegeResult revokePrivilegeOnSecurableFromRole(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisPrivilege privilege) {
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisPrivilege privilege) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1865,9 +1864,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** {@link #loadGrantsOnSecurable(PolarisCallContext, long, long)} */
- private @NotNull LoadGrantsResult loadGrantsOnSecurable(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull LoadGrantsResult loadGrantsOnSecurable(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
long securableCatalogId,
long securableId) {
@@ -1904,8 +1903,8 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull LoadGrantsResult loadGrantsOnSecurable(
- @NotNull PolarisCallContext callCtx, long securableCatalogId, long securableId) {
+ public @Nonnull LoadGrantsResult loadGrantsOnSecurable(
+ @Nonnull PolarisCallContext callCtx, long securableCatalogId, long securableId) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1915,9 +1914,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** {@link #loadGrantsToGrantee(PolarisCallContext, long, long)} */
- public @NotNull LoadGrantsResult loadGrantsToGrantee(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ public @Nonnull LoadGrantsResult loadGrantsToGrantee(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
long granteeCatalogId,
long granteeId) {
@@ -1953,8 +1952,8 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull LoadGrantsResult loadGrantsToGrantee(
- @NotNull PolarisCallContext callCtx, long granteeCatalogId, long granteeId) {
+ public @Nonnull LoadGrantsResult loadGrantsToGrantee(
+ @Nonnull PolarisCallContext callCtx, long granteeCatalogId, long granteeId) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1964,10 +1963,10 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** {@link PolarisMetaStoreManager#loadEntitiesChangeTracking(PolarisCallContext, List)} */
- private @NotNull ChangeTrackingResult loadEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
- @NotNull List<PolarisEntityId> entityIds) {
+ private @Nonnull ChangeTrackingResult loadEntitiesChangeTracking(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
+ @Nonnull List<PolarisEntityId> entityIds) {
List<PolarisChangeTrackingVersions> changeTracking =
ms.lookupEntityVersions(callCtx, entityIds);
return new ChangeTrackingResult(changeTracking);
@@ -1975,8 +1974,8 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull ChangeTrackingResult loadEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull List<PolarisEntityId> entityIds) {
+ public @Nonnull ChangeTrackingResult loadEntitiesChangeTracking(
+ @Nonnull PolarisCallContext callCtx, @Nonnull List<PolarisEntityId> entityIds) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -1986,9 +1985,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** Refer to {@link #loadEntity(PolarisCallContext, long, long)} */
- private @NotNull EntityResult loadEntity(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull EntityResult loadEntity(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
long entityCatalogId,
long entityId) {
// this is an easy one
@@ -2000,8 +1999,8 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull EntityResult loadEntity(
- @NotNull PolarisCallContext callCtx, long entityCatalogId, long entityId) {
+ public @Nonnull EntityResult loadEntity(
+ @Nonnull PolarisCallContext callCtx, long entityCatalogId, long entityId) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -2011,9 +2010,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** Refer to {@link #loadTasks(PolarisCallContext, String, int)} */
- private @NotNull EntitiesResult loadTasks(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull EntitiesResult loadTasks(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
String executorId,
int limit) {
@@ -2062,21 +2061,21 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
@Override
- public @NotNull EntitiesResult loadTasks(
- @NotNull PolarisCallContext callCtx, String executorId, int limit) {
+ public @Nonnull EntitiesResult loadTasks(
+ @Nonnull PolarisCallContext callCtx, String executorId, int limit) {
PolarisMetaStoreSession ms = callCtx.getMetaStore();
return ms.runInTransaction(callCtx, () -> this.loadTasks(callCtx, ms, executorId, limit));
}
/** {@inheritDoc} */
@Override
- public @NotNull ScopedCredentialsResult getSubscopedCredsForEntity(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull ScopedCredentialsResult getSubscopedCredsForEntity(
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
// get meta store session we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -2126,12 +2125,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull ValidateAccessResult validateAccessToLocations(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull ValidateAccessResult validateAccessToLocations(
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
- @NotNull Set<PolarisStorageActions> actions,
- @NotNull Set<String> locations) {
+ @Nonnull Set<PolarisStorageActions> actions,
+ @Nonnull Set<String> locations) {
// get meta store we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
callCtx
@@ -2176,7 +2175,7 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
public static PolarisStorageConfigurationInfo readStorageConfiguration(
- @NotNull PolarisCallContext callCtx, PolarisBaseEntity reloadedEntity) {
+ @Nonnull PolarisCallContext callCtx, PolarisBaseEntity reloadedEntity) {
Map<String, String> propMap =
PolarisObjectMapperUtil.deserializeProperties(
callCtx, reloadedEntity.getInternalProperties());
@@ -2203,7 +2202,7 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
* @return a map of string representing the internal properties
*/
public Map<String, String> getInternalPropertyMap(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
String internalPropStr = entity.getInternalProperties();
Map<String, String> res = new HashMap<>();
if (internalPropStr == null) {
@@ -2213,9 +2212,9 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** {@link #loadCachedEntryById(PolarisCallContext, long, long)} */
- private @NotNull CachedEntryResult loadCachedEntryById(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull CachedEntryResult loadCachedEntryById(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
long entityCatalogId,
long entityId) {
@@ -2243,8 +2242,8 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull CachedEntryResult loadCachedEntryById(
- @NotNull PolarisCallContext callCtx, long entityCatalogId, long entityId) {
+ public @Nonnull CachedEntryResult loadCachedEntryById(
+ @Nonnull PolarisCallContext callCtx, long entityCatalogId, long entityId) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -2254,13 +2253,13 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** {@link #loadCachedEntryById(PolarisCallContext, long, long)} */
- private @NotNull CachedEntryResult loadCachedEntryByName(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull CachedEntryResult loadCachedEntryByName(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
long entityCatalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull String entityName) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull String entityName) {
// load that entity
PolarisEntitiesActiveKey entityActiveKey =
@@ -2290,12 +2289,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull CachedEntryResult loadCachedEntryByName(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull CachedEntryResult loadCachedEntryByName(
+ @Nonnull PolarisCallContext callCtx,
long entityCatalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull String entityName) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull String entityName) {
// get metastore we should be using
PolarisMetaStoreSession ms = callCtx.getMetaStore();
@@ -2355,12 +2354,12 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
}
/** {@inheritDoc} */
- private @NotNull CachedEntryResult refreshCachedEntity(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisMetaStoreSession ms,
+ private @Nonnull CachedEntryResult refreshCachedEntity(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisMetaStoreSession ms,
int entityVersion,
int entityGrantRecordsVersion,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
long entityCatalogId,
long entityId) {
@@ -2408,11 +2407,11 @@ public class PolarisMetaStoreManagerImpl implements PolarisMetaStoreManager {
/** {@inheritDoc} */
@Override
- public @NotNull CachedEntryResult refreshCachedEntity(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull CachedEntryResult refreshCachedEntity(
+ @Nonnull PolarisCallContext callCtx,
int entityVersion,
int entityGrantRecordsVersion,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
long entityCatalogId,
long entityId) {
// get metastore we should be using
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreSession.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreSession.java
index 448cb235..124ec1d7 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreSession.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreSession.java
@@ -18,6 +18,8 @@
*/
package org.apache.polaris.core.persistence;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
@@ -34,8 +36,6 @@ import org.apache.polaris.core.entity.PolarisGrantRecord;
import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
import org.apache.polaris.core.storage.PolarisStorageIntegration;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* Interface to the Polaris metadata store, allows to persist and retrieve all Polaris metadata like
@@ -58,7 +58,7 @@ public interface PolarisMetaStoreSession {
* @param callCtx call context
* @param transactionCode code of the transaction being executed, a supplier lambda
*/
- <T> T runInTransaction(@NotNull PolarisCallContext callCtx, @NotNull Supplier<T> transactionCode);
+ <T> T runInTransaction(@Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode);
/**
* Run the specified transaction code (a runnable lambda type) in a database read/write
@@ -70,7 +70,7 @@ public interface PolarisMetaStoreSession {
* @param transactionCode code of the transaction being executed, a runnable lambda
*/
void runActionInTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Runnable transactionCode);
+ @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode);
/**
* Run the specified transaction code (a Supplier lambda type) in a database read transaction. If
@@ -82,7 +82,7 @@ public interface PolarisMetaStoreSession {
* @param transactionCode code of the transaction being executed, a supplier lambda
*/
<T> T runInReadTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Supplier<T> transactionCode);
+ @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode);
/**
* Run the specified transaction code (a runnable lambda type) in a database read transaction. If
@@ -93,13 +93,13 @@ public interface PolarisMetaStoreSession {
* @param transactionCode code of the transaction being executed, a runnable lambda
*/
void runActionInReadTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Runnable transactionCode);
+ @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode);
/**
* @param callCtx call context
* @return new unique entity identifier
*/
- long generateNewId(@NotNull PolarisCallContext callCtx);
+ long generateNewId(@Nonnull PolarisCallContext callCtx);
/**
* Write the base entity to the entities table. If there is a conflict (existing record with the
@@ -109,7 +109,7 @@ public interface PolarisMetaStoreSession {
* @param entity entity record to write, potentially replacing an existing entity record with the
* same key
*/
- void writeToEntities(@NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity);
+ void writeToEntities(@Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity);
/**
* Write the base entity to the entities_active table. If there is a conflict (existing record
@@ -120,7 +120,7 @@ public interface PolarisMetaStoreSession {
* same key
*/
void writeToEntitiesActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity);
/**
* Write the base entity to the entities_dropped table. If there is a conflict (existing record
@@ -131,7 +131,7 @@ public interface PolarisMetaStoreSession {
* same key
*/
void writeToEntitiesDropped(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity);
/**
* Write the base entity to the entities change tracking table. If there is a conflict (existing
@@ -142,7 +142,7 @@ public interface PolarisMetaStoreSession {
* same key
*/
void writeToEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity);
/**
* Write the specified grantRecord to the grant_records table. If there is a conflict (existing
@@ -153,7 +153,7 @@ public interface PolarisMetaStoreSession {
* the same key
*/
void writeToGrantRecords(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisGrantRecord grantRec);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisGrantRecord grantRec);
/**
* Delete the base entity from the entities table.
@@ -161,7 +161,7 @@ public interface PolarisMetaStoreSession {
* @param callCtx call context
* @param entity entity record to delete
*/
- void deleteFromEntities(@NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity);
+ void deleteFromEntities(@Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity);
/**
* Delete the base entity from the entities_active table.
@@ -170,7 +170,7 @@ public interface PolarisMetaStoreSession {
* @param entity entity record to delete
*/
void deleteFromEntitiesActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity);
/**
* Delete the base entity to the entities_dropped table
@@ -179,7 +179,7 @@ public interface PolarisMetaStoreSession {
* @param entity entity record to delete
*/
void deleteFromEntitiesDropped(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity);
/**
* Delete the base entity from the entities change tracking table
@@ -188,7 +188,7 @@ public interface PolarisMetaStoreSession {
* @param entity entity record to delete
*/
void deleteFromEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity);
/**
* Delete the specified grantRecord to the grant_records table.
@@ -197,7 +197,7 @@ public interface PolarisMetaStoreSession {
* @param grantRec entity record to delete.
*/
void deleteFromGrantRecords(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisGrantRecord grantRec);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisGrantRecord grantRec);
/**
* Delete the all grant records in the grant_records table for the specified entity. This method
@@ -211,10 +211,10 @@ public interface PolarisMetaStoreSession {
* @param grantsOnSecurable all grants on that securable entity
*/
void deleteAllEntityGrantRecords(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore entity,
- @NotNull List<PolarisGrantRecord> grantsOnGrantee,
- @NotNull List<PolarisGrantRecord> grantsOnSecurable);
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore entity,
+ @Nonnull List<PolarisGrantRecord> grantsOnGrantee,
+ @Nonnull List<PolarisGrantRecord> grantsOnSecurable);
/**
* Delete Polaris entity and grant record metadata from all tables. This is used during metadata
@@ -222,7 +222,7 @@ public interface PolarisMetaStoreSession {
*
* @param callCtx call context
*/
- void deleteAll(@NotNull PolarisCallContext callCtx);
+ void deleteAll(@Nonnull PolarisCallContext callCtx);
/**
* Lookup an entity given its catalog id (which can be NULL_ID for top-level entities) and its
@@ -235,7 +235,7 @@ public interface PolarisMetaStoreSession {
*/
@Nullable
PolarisBaseEntity lookupEntity(
- @NotNull PolarisCallContext callCtx, long catalogId, long entityId);
+ @Nonnull PolarisCallContext callCtx, long catalogId, long entityId);
/**
* Lookup a set of entities given their catalog id/entity id unique identifier
@@ -245,9 +245,9 @@ public interface PolarisMetaStoreSession {
* @return list of polaris base entities, parallel to the input list of ids. An entity in the list
* will be null if the corresponding entity could not be found.
*/
- @NotNull
+ @Nonnull
List<PolarisBaseEntity> lookupEntities(
- @NotNull PolarisCallContext callCtx, List<PolarisEntityId> entityIds);
+ @Nonnull PolarisCallContext callCtx, List<PolarisEntityId> entityIds);
/**
* Lookup in the entities_change_tracking table the current version of an entity given its catalog
@@ -259,7 +259,7 @@ public interface PolarisMetaStoreSession {
* @param entityId unique entity id
* @return current version for that entity or 0 if entity was not found.
*/
- int lookupEntityVersion(@NotNull PolarisCallContext callCtx, long catalogId, long entityId);
+ int lookupEntityVersion(@Nonnull PolarisCallContext callCtx, long catalogId, long entityId);
/**
* Get change tracking versions for all specified entity ids.
@@ -269,9 +269,9 @@ public interface PolarisMetaStoreSession {
* @return list parallel to the input list of entity versions. If an entity cannot be found, the
* corresponding element in the list will be null
*/
- @NotNull
+ @Nonnull
List<PolarisChangeTrackingVersions> lookupEntityVersions(
- @NotNull PolarisCallContext callCtx, List<PolarisEntityId> entityIds);
+ @Nonnull PolarisCallContext callCtx, List<PolarisEntityId> entityIds);
/**
* Lookup in the entities_active table to determine if the specified entity exists. Return the
@@ -283,7 +283,7 @@ public interface PolarisMetaStoreSession {
*/
@Nullable
PolarisEntityActiveRecord lookupEntityActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntitiesActiveKey entityActiveKey);
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntitiesActiveKey entityActiveKey);
/**
* Lookup in the entities_active table to determine if the specified set of entities exist. Return
@@ -292,9 +292,9 @@ public interface PolarisMetaStoreSession {
*
* @return the list of entities_active records for the specified lookup operation
*/
- @NotNull
+ @Nonnull
List<PolarisEntityActiveRecord> lookupEntityActiveBatch(
- @NotNull PolarisCallContext callCtx, List<PolarisEntitiesActiveKey> entityActiveKeys);
+ @Nonnull PolarisCallContext callCtx, List<PolarisEntitiesActiveKey> entityActiveKeys);
/**
* List all active entities of the specified type which are child entities of the specified parent
@@ -305,12 +305,12 @@ public interface PolarisMetaStoreSession {
* @param entityType type of entities to list
* @return the list of entities_active records for the specified list operation
*/
- @NotNull
+ @Nonnull
List<PolarisEntityActiveRecord> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType);
+ @Nonnull PolarisEntityType entityType);
/**
* List active entities where some predicate returns true
@@ -323,13 +323,13 @@ public interface PolarisMetaStoreSession {
* returns true are returned in the list
* @return the list of entities for which the predicate returns true
*/
- @NotNull
+ @Nonnull
List<PolarisEntityActiveRecord> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull Predicate<PolarisBaseEntity> entityFilter);
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull Predicate<PolarisBaseEntity> entityFilter);
/**
* List active entities where some predicate returns true and transform the entities with a
@@ -346,15 +346,15 @@ public interface PolarisMetaStoreSession {
* returning
* @return the list of entities for which the predicate returns true
*/
- @NotNull
+ @Nonnull
<T> List<T> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
int limit,
- @NotNull Predicate<PolarisBaseEntity> entityFilter,
- @NotNull Function<PolarisBaseEntity, T> transformer);
+ @Nonnull Predicate<PolarisBaseEntity> entityFilter,
+ @Nonnull Function<PolarisBaseEntity, T> transformer);
/**
* Lookup in the entities_change_tracking table the current version of the grant records for this
@@ -367,7 +367,7 @@ public interface PolarisMetaStoreSession {
* @return current grant records version for that entity.
*/
int lookupEntityGrantRecordsVersion(
- @NotNull PolarisCallContext callCtx, long catalogId, long entityId);
+ @Nonnull PolarisCallContext callCtx, long catalogId, long entityId);
/**
* Lookup the specified grant record from the grant_records table. Return NULL if not found
@@ -383,7 +383,7 @@ public interface PolarisMetaStoreSession {
*/
@Nullable
PolarisGrantRecord lookupGrantRecord(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long securableCatalogId,
long securableId,
long granteeCatalogId,
@@ -399,9 +399,9 @@ public interface PolarisMetaStoreSession {
* @param securableId id of the securable entity
* @return the list of grant records for the specified securable
*/
- @NotNull
+ @Nonnull
List<PolarisGrantRecord> loadAllGrantRecordsOnSecurable(
- @NotNull PolarisCallContext callCtx, long securableCatalogId, long securableId);
+ @Nonnull PolarisCallContext callCtx, long securableCatalogId, long securableId);
/**
* Get all grant records granted to the specified grantee entity.
@@ -411,9 +411,9 @@ public interface PolarisMetaStoreSession {
* @param granteeId id of the grantee entity
* @return the list of grant records for the specified grantee
*/
- @NotNull
+ @Nonnull
List<PolarisGrantRecord> loadAllGrantRecordsOnGrantee(
- @NotNull PolarisCallContext callCtx, long granteeCatalogId, long granteeId);
+ @Nonnull PolarisCallContext callCtx, long granteeCatalogId, long granteeId);
/**
* Allows to retrieve to the secrets of a principal given its unique client id
@@ -424,7 +424,7 @@ public interface PolarisMetaStoreSession {
*/
@Nullable
PolarisPrincipalSecrets loadPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId);
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId);
/**
* generate and store a client id and associated secrets for a newly created principal entity
@@ -433,9 +433,9 @@ public interface PolarisMetaStoreSession {
* @param principalName name of the principal
* @param principalId principal id
*/
- @NotNull
+ @Nonnull
PolarisPrincipalSecrets generateNewPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String principalName, long principalId);
+ @Nonnull PolarisCallContext callCtx, @Nonnull String principalName, long principalId);
/**
* Rotate the secrets of a principal entity, i.e. make the specified main secrets the secondary
@@ -450,11 +450,11 @@ public interface PolarisMetaStoreSession {
*/
@Nullable
PolarisPrincipalSecrets rotatePrincipalSecrets(
- @NotNull PolarisCallContext callCtx,
- @NotNull String clientId,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull String clientId,
long principalId,
boolean reset,
- @NotNull String oldSecretHash);
+ @Nonnull String oldSecretHash);
/**
* When dropping a principal, we also need to drop the secrets of that principal
@@ -464,7 +464,7 @@ public interface PolarisMetaStoreSession {
* @param principalId the id of the principal whose secrets are dropped
*/
void deletePrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId, long principalId);
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId, long principalId);
/**
* Create an in-memory storage integration
@@ -477,7 +477,7 @@ public interface PolarisMetaStoreSession {
*/
@Nullable
<T extends PolarisStorageConfigurationInfo> PolarisStorageIntegration<T> createStorageIntegration(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
PolarisStorageConfigurationInfo polarisStorageConfigurationInfo);
@@ -490,8 +490,8 @@ public interface PolarisMetaStoreSession {
* @param storageIntegration the storage integration to persist
*/
<T extends PolarisStorageConfigurationInfo> void persistStorageIntegrationIfNeeded(
- @NotNull PolarisCallContext callContext,
- @NotNull PolarisBaseEntity entity,
+ @Nonnull PolarisCallContext callContext,
+ @Nonnull PolarisBaseEntity entity,
@Nullable PolarisStorageIntegration<T> storageIntegration);
/**
@@ -504,7 +504,7 @@ public interface PolarisMetaStoreSession {
@Nullable
<T extends PolarisStorageConfigurationInfo>
PolarisStorageIntegration<T> loadPolarisStorageIntegration(
- @NotNull PolarisCallContext callContext, @NotNull PolarisBaseEntity entity);
+ @Nonnull PolarisCallContext callContext, @Nonnull PolarisBaseEntity entity);
/**
* Check if the specified parent entity has children.
@@ -517,7 +517,7 @@ public interface PolarisMetaStoreSession {
* @return true if the parent entity has children
*/
boolean hasChildren(
- @NotNull PolarisCallContext callContext,
+ @Nonnull PolarisCallContext callContext,
@Nullable PolarisEntityType optionalEntityType,
long catalogId,
long parentId);
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisObjectMapperUtil.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisObjectMapperUtil.java
index 7f85580f..a91d2bba 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisObjectMapperUtil.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisObjectMapperUtil.java
@@ -26,13 +26,13 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
+import jakarta.annotation.Nullable;
import java.io.IOException;
import java.util.Map;
import org.apache.iceberg.rest.RESTSerializers;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.entity.PolarisBaseEntity;
import org.apache.polaris.core.entity.PolarisTaskConstants;
-import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreSessionImpl.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreSessionImpl.java
index 01611f3d..bea20541 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreSessionImpl.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreSessionImpl.java
@@ -19,6 +19,8 @@
package org.apache.polaris.core.persistence;
import com.google.common.base.Predicates;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
@@ -37,8 +39,6 @@ import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
import org.apache.polaris.core.storage.PolarisStorageIntegration;
import org.apache.polaris.core.storage.PolarisStorageIntegrationProvider;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSession {
@@ -48,9 +48,9 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
private final PrincipalSecretsGenerator secretsGenerator;
public PolarisTreeMapMetaStoreSessionImpl(
- @NotNull PolarisTreeMapStore store,
- @NotNull PolarisStorageIntegrationProvider storageIntegrationProvider,
- @NotNull PrincipalSecretsGenerator secretsGenerator) {
+ @Nonnull PolarisTreeMapStore store,
+ @Nonnull PolarisStorageIntegrationProvider storageIntegrationProvider,
+ @Nonnull PrincipalSecretsGenerator secretsGenerator) {
// init store
this.store = store;
@@ -61,7 +61,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public <T> T runInTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Supplier<T> transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode) {
// run transaction on our underlying store
return store.runInTransaction(callCtx, transactionCode);
@@ -70,7 +70,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void runActionInTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Runnable transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
// run transaction on our underlying store
store.runActionInTransaction(callCtx, transactionCode);
@@ -79,7 +79,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public <T> T runInReadTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Supplier<T> transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode) {
// run transaction on our underlying store
return store.runInReadTransaction(callCtx, transactionCode);
}
@@ -87,7 +87,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void runActionInReadTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Runnable transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
// run transaction on our underlying store
store.runActionInReadTransaction(callCtx, transactionCode);
@@ -97,14 +97,14 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
* @return new unique entity identifier
*/
@Override
- public long generateNewId(@NotNull PolarisCallContext callCtx) {
+ public long generateNewId(@Nonnull PolarisCallContext callCtx) {
return this.store.getNextSequence();
}
/** {@inheritDoc} */
@Override
public void writeToEntities(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// write it
this.store.getSliceEntities().write(entity);
}
@@ -112,8 +112,8 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public <T extends PolarisStorageConfigurationInfo> void persistStorageIntegrationIfNeeded(
- @NotNull PolarisCallContext callContext,
- @NotNull PolarisBaseEntity entity,
+ @Nonnull PolarisCallContext callContext,
+ @Nonnull PolarisBaseEntity entity,
@Nullable PolarisStorageIntegration<T> storageIntegration) {
// not implemented for in-memory store
}
@@ -121,7 +121,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void writeToEntitiesActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// write it
this.store.getSliceEntitiesActive().write(entity);
}
@@ -129,7 +129,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void writeToEntitiesDropped(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// write it
this.store.getSliceEntitiesDropped().write(entity);
this.store.getSliceEntitiesDroppedToPurge().write(entity);
@@ -138,7 +138,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void writeToEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// write it
this.store.getSliceEntitiesChangeTracking().write(entity);
}
@@ -146,7 +146,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void writeToGrantRecords(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisGrantRecord grantRec) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisGrantRecord grantRec) {
// write it
this.store.getSliceGrantRecords().write(grantRec);
this.store.getSliceGrantRecordsByGrantee().write(grantRec);
@@ -155,7 +155,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void deleteFromEntities(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity) {
// delete it
this.store.getSliceEntities().delete(this.store.buildEntitiesKey(entity));
@@ -164,7 +164,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void deleteFromEntitiesActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity) {
// delete it
this.store.getSliceEntitiesActive().delete(this.store.buildEntitiesActiveKey(entity));
}
@@ -172,7 +172,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void deleteFromEntitiesDropped(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
// delete it
this.store.getSliceEntitiesDropped().delete(entity);
this.store.getSliceEntitiesDroppedToPurge().delete(entity);
@@ -186,7 +186,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
*/
@Override
public void deleteFromEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntityCore entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntityCore entity) {
// delete it
this.store.getSliceEntitiesChangeTracking().delete(this.store.buildEntitiesKey(entity));
}
@@ -194,7 +194,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void deleteFromGrantRecords(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisGrantRecord grantRec) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisGrantRecord grantRec) {
// delete it
this.store.getSliceGrantRecords().delete(grantRec);
@@ -204,10 +204,10 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void deleteAllEntityGrantRecords(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore entity,
- @NotNull List<PolarisGrantRecord> grantsOnGrantee,
- @NotNull List<PolarisGrantRecord> grantsOnSecurable) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore entity,
+ @Nonnull List<PolarisGrantRecord> grantsOnGrantee,
+ @Nonnull List<PolarisGrantRecord> grantsOnSecurable) {
// build composite prefix key and delete grant records on the indexed side of each grant table
String prefix = this.store.buildPrefixKeyComposite(entity.getCatalogId(), entity.getId());
@@ -222,7 +222,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
- public void deleteAll(@NotNull PolarisCallContext callCtx) {
+ public void deleteAll(@Nonnull PolarisCallContext callCtx) {
// clear all slices
this.store.deleteAll();
}
@@ -230,14 +230,14 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public @Nullable PolarisBaseEntity lookupEntity(
- @NotNull PolarisCallContext callCtx, long catalogId, long entityId) {
+ @Nonnull PolarisCallContext callCtx, long catalogId, long entityId) {
return this.store.getSliceEntities().read(this.store.buildKeyComposite(catalogId, entityId));
}
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisBaseEntity> lookupEntities(
- @NotNull PolarisCallContext callCtx, List<PolarisEntityId> entityIds) {
+ public @Nonnull List<PolarisBaseEntity> lookupEntities(
+ @Nonnull PolarisCallContext callCtx, List<PolarisEntityId> entityIds) {
// allocate return list
return entityIds.stream()
.map(
@@ -251,7 +251,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public int lookupEntityVersion(
- @NotNull PolarisCallContext callCtx, long catalogId, long entityId) {
+ @Nonnull PolarisCallContext callCtx, long catalogId, long entityId) {
PolarisBaseEntity baseEntity =
this.store
.getSliceEntitiesChangeTracking()
@@ -262,8 +262,8 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisChangeTrackingVersions> lookupEntityVersions(
- @NotNull PolarisCallContext callCtx, List<PolarisEntityId> entityIds) {
+ public @Nonnull List<PolarisChangeTrackingVersions> lookupEntityVersions(
+ @Nonnull PolarisCallContext callCtx, List<PolarisEntityId> entityIds) {
// allocate return list
return entityIds.stream()
.map(
@@ -284,7 +284,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
@Override
@Nullable
public PolarisEntityActiveRecord lookupEntityActive(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisEntitiesActiveKey entityActiveKey) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisEntitiesActiveKey entityActiveKey) {
// lookup the active entity slice
PolarisBaseEntity entity =
this.store
@@ -310,10 +310,10 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
- @NotNull
+ @Nonnull
public List<PolarisEntityActiveRecord> lookupEntityActiveBatch(
- @NotNull PolarisCallContext callCtx,
- @NotNull List<PolarisEntitiesActiveKey> entityActiveKeys) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull List<PolarisEntitiesActiveKey> entityActiveKeys) {
// now build a list to quickly verify that nothing has changed
return entityActiveKeys.stream()
.map(entityActiveKey -> this.lookupEntityActive(callCtx, entityActiveKey))
@@ -322,21 +322,21 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisEntityActiveRecord> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull List<PolarisEntityActiveRecord> listActiveEntities(
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType) {
+ @Nonnull PolarisEntityType entityType) {
return listActiveEntities(callCtx, catalogId, parentId, entityType, Predicates.alwaysTrue());
}
@Override
- public @NotNull List<PolarisEntityActiveRecord> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull List<PolarisEntityActiveRecord> listActiveEntities(
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull Predicate<PolarisBaseEntity> entityFilter) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull Predicate<PolarisBaseEntity> entityFilter) {
// full range scan under the parent for that type
return listActiveEntities(
callCtx,
@@ -356,14 +356,14 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
}
@Override
- public @NotNull <T> List<T> listActiveEntities(
- @NotNull PolarisCallContext callCtx,
+ public @Nonnull <T> List<T> listActiveEntities(
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
int limit,
- @NotNull Predicate<PolarisBaseEntity> entityFilter,
- @NotNull Function<PolarisBaseEntity, T> transformer) {
+ @Nonnull Predicate<PolarisBaseEntity> entityFilter,
+ @Nonnull Function<PolarisBaseEntity, T> transformer) {
// full range scan under the parent for that type
return this.store
.getSliceEntitiesActive()
@@ -378,7 +378,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public boolean hasChildren(
- @NotNull PolarisCallContext callContext,
+ @Nonnull PolarisCallContext callContext,
@Nullable PolarisEntityType entityType,
long catalogId,
long parentId) {
@@ -394,7 +394,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public int lookupEntityGrantRecordsVersion(
- @NotNull PolarisCallContext callCtx, long catalogId, long entityId) {
+ @Nonnull PolarisCallContext callCtx, long catalogId, long entityId) {
PolarisBaseEntity entity =
this.store
.getSliceEntitiesChangeTracking()
@@ -407,7 +407,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public @Nullable PolarisGrantRecord lookupGrantRecord(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long securableCatalogId,
long securableId,
long granteeCatalogId,
@@ -423,8 +423,8 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisGrantRecord> loadAllGrantRecordsOnSecurable(
- @NotNull PolarisCallContext callCtx, long securableCatalogId, long securableId) {
+ public @Nonnull List<PolarisGrantRecord> loadAllGrantRecordsOnSecurable(
+ @Nonnull PolarisCallContext callCtx, long securableCatalogId, long securableId) {
// now fetch all grants for this securable
return this.store
.getSliceGrantRecords()
@@ -433,8 +433,8 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
- public @NotNull List<PolarisGrantRecord> loadAllGrantRecordsOnGrantee(
- @NotNull PolarisCallContext callCtx, long granteeCatalogId, long granteeId) {
+ public @Nonnull List<PolarisGrantRecord> loadAllGrantRecordsOnGrantee(
+ @Nonnull PolarisCallContext callCtx, long granteeCatalogId, long granteeId) {
// now fetch all grants assigned to this grantee
return this.store
.getSliceGrantRecordsByGrantee()
@@ -444,14 +444,14 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public @Nullable PolarisPrincipalSecrets loadPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId) {
return this.store.getSlicePrincipalSecrets().read(clientId);
}
/** {@inheritDoc} */
@Override
- public @NotNull PolarisPrincipalSecrets generateNewPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String principalName, long principalId) {
+ public @Nonnull PolarisPrincipalSecrets generateNewPrincipalSecrets(
+ @Nonnull PolarisCallContext callCtx, @Nonnull String principalName, long principalId) {
// ensure principal client id is unique
PolarisPrincipalSecrets principalSecrets;
PolarisPrincipalSecrets lookupPrincipalSecrets;
@@ -473,12 +473,12 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
- public @NotNull PolarisPrincipalSecrets rotatePrincipalSecrets(
- @NotNull PolarisCallContext callCtx,
- @NotNull String clientId,
+ public @Nonnull PolarisPrincipalSecrets rotatePrincipalSecrets(
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull String clientId,
long principalId,
boolean reset,
- @NotNull String oldSecretHash) {
+ @Nonnull String oldSecretHash) {
// load the existing secrets
PolarisPrincipalSecrets principalSecrets = this.store.getSlicePrincipalSecrets().read(clientId);
@@ -519,7 +519,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
/** {@inheritDoc} */
@Override
public void deletePrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId, long principalId) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId, long principalId) {
// load the existing secrets
PolarisPrincipalSecrets principalSecrets = this.store.getSlicePrincipalSecrets().read(clientId);
@@ -551,7 +551,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
@Override
public @Nullable <T extends PolarisStorageConfigurationInfo>
PolarisStorageIntegration<T> createStorageIntegration(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
PolarisStorageConfigurationInfo polarisStorageConfigurationInfo) {
@@ -563,7 +563,7 @@ public class PolarisTreeMapMetaStoreSessionImpl implements PolarisMetaStoreSessi
@Override
public @Nullable <T extends PolarisStorageConfigurationInfo>
PolarisStorageIntegration<T> loadPolarisStorageIntegration(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity entity) {
PolarisStorageConfigurationInfo storageConfig =
PolarisMetaStoreManagerImpl.readStorageConfiguration(callCtx, entity);
return storageIntegrationProvider.getStorageIntegrationForConfig(storageConfig);
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisTreeMapStore.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisTreeMapStore.java
index 44bcc9c1..544bcf0f 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisTreeMapStore.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisTreeMapStore.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.core.persistence;
+import jakarta.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;
@@ -30,7 +31,6 @@ import org.apache.polaris.core.entity.PolarisBaseEntity;
import org.apache.polaris.core.entity.PolarisEntityCore;
import org.apache.polaris.core.entity.PolarisGrantRecord;
import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
-import org.jetbrains.annotations.NotNull;
/** Implements a simple in-memory store for Polaris, using tree-map */
public class PolarisTreeMapStore {
@@ -223,7 +223,7 @@ public class PolarisTreeMapStore {
*
* @param diagnostics diagnostic services
*/
- public PolarisTreeMapStore(@NotNull PolarisDiagnostics diagnostics) {
+ public PolarisTreeMapStore(@Nonnull PolarisDiagnostics diagnostics) {
// the entities slice
this.sliceEntities =
@@ -409,7 +409,7 @@ public class PolarisTreeMapStore {
* @return the result of the execution
*/
public <T> T runInTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Supplier<T> transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode) {
synchronized (lock) {
// execute transaction
@@ -435,7 +435,7 @@ public class PolarisTreeMapStore {
* @param transactionCode transaction code
*/
public void runActionInTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Runnable transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
synchronized (lock) {
@@ -463,7 +463,7 @@ public class PolarisTreeMapStore {
* @return the result of the execution
*/
public <T> T runInReadTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Supplier<T> transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> transactionCode) {
synchronized (lock) {
// execute transaction
@@ -486,7 +486,7 @@ public class PolarisTreeMapStore {
* @param transactionCode transaction code
*/
public void runActionInReadTransaction(
- @NotNull PolarisCallContext callCtx, @NotNull Runnable transactionCode) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
synchronized (lock) {
// execute transaction
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PrincipalSecretsGenerator.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PrincipalSecretsGenerator.java
index 10de55d1..27ddacbe 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/PrincipalSecretsGenerator.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/PrincipalSecretsGenerator.java
@@ -18,10 +18,10 @@
*/
package org.apache.polaris.core.persistence;
+import jakarta.annotation.Nonnull;
import java.util.Locale;
import java.util.function.Function;
import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
-import org.jetbrains.annotations.NotNull;
/**
* An interface for generating principal secrets. It enables detaching the secret generation logic
@@ -60,7 +60,7 @@ public interface PrincipalSecretsGenerator {
* @param principalId the ID of the related principal. This ID is part of the returned data.
* @return a new {@link PolarisPrincipalSecrets} instance for the specified principal.
*/
- PolarisPrincipalSecrets produceSecrets(@NotNull String principalName, long principalId);
+ PolarisPrincipalSecrets produceSecrets(@Nonnull String principalName, long principalId);
static PrincipalSecretsGenerator bootstrap(String realmName) {
return bootstrap(realmName, System.getenv()::get);
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/ResolvedPolarisEntity.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/ResolvedPolarisEntity.java
index 6d59e9aa..a091362a 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/ResolvedPolarisEntity.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/ResolvedPolarisEntity.java
@@ -19,11 +19,11 @@
package org.apache.polaris.core.persistence;
import com.google.common.collect.ImmutableList;
+import jakarta.annotation.Nonnull;
import java.util.List;
import org.apache.polaris.core.entity.PolarisEntity;
import org.apache.polaris.core.entity.PolarisGrantRecord;
import org.apache.polaris.core.persistence.cache.EntityCacheEntry;
-import org.jetbrains.annotations.NotNull;
public class ResolvedPolarisEntity {
private final PolarisEntity entity;
@@ -48,7 +48,7 @@ public class ResolvedPolarisEntity {
this.grantRecordsAsSecurable = grantRecordsAsSecurable;
}
- public ResolvedPolarisEntity(@NotNull EntityCacheEntry cacheEntry) {
+ public ResolvedPolarisEntity(@Nonnull EntityCacheEntry cacheEntry) {
this.entity = PolarisEntity.of(cacheEntry.getEntity());
this.grantRecordsAsGrantee = ImmutableList.copyOf(cacheEntry.getGrantRecordsAsGrantee());
this.grantRecordsAsSecurable = ImmutableList.copyOf(cacheEntry.getGrantRecordsAsSecurable());
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/TransactionWorkspaceMetaStoreManager.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/TransactionWorkspaceMetaStoreManager.java
index 92466b2f..44134751 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/TransactionWorkspaceMetaStoreManager.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/TransactionWorkspaceMetaStoreManager.java
@@ -19,6 +19,8 @@
package org.apache.polaris.core.persistence;
import com.google.common.collect.ImmutableList;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -31,10 +33,7 @@ import org.apache.polaris.core.entity.PolarisEntityId;
import org.apache.polaris.core.entity.PolarisEntitySubType;
import org.apache.polaris.core.entity.PolarisEntityType;
import org.apache.polaris.core.entity.PolarisPrivilege;
-import org.apache.polaris.core.persistence.cache.PolarisRemoteCache.CachedEntryResult;
import org.apache.polaris.core.storage.PolarisStorageActions;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* Wraps an existing impl of PolarisMetaStoreManager and delegates expected "read" operations
@@ -72,7 +71,7 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
}
@Override
- public BaseResult bootstrapPolarisService(@NotNull PolarisCallContext callCtx) {
+ public BaseResult bootstrapPolarisService(@Nonnull PolarisCallContext callCtx) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "bootstrapPolarisService");
@@ -80,34 +79,34 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
}
@Override
- public BaseResult purge(@NotNull PolarisCallContext callCtx) {
+ public BaseResult purge(@Nonnull PolarisCallContext callCtx) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "purge");
return null;
}
@Override
public PolarisMetaStoreManager.EntityResult readEntityByName(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityType entityType,
- @NotNull PolarisEntitySubType entitySubType,
- @NotNull String name) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull PolarisEntitySubType entitySubType,
+ @Nonnull String name) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "readEntityByName");
return null;
}
@Override
public ListEntitiesResult listEntities(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityType entityType,
- @NotNull PolarisEntitySubType entitySubType) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull PolarisEntitySubType entitySubType) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "listEntities");
return null;
}
@Override
- public GenerateEntityIdResult generateNewEntityId(@NotNull PolarisCallContext callCtx) {
+ public GenerateEntityIdResult generateNewEntityId(@Nonnull PolarisCallContext callCtx) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "generateNewEntityId");
@@ -116,14 +115,14 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public CreatePrincipalResult createPrincipal(
- @NotNull PolarisCallContext callCtx, @NotNull PolarisBaseEntity principal) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity principal) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "createPrincipal");
return null;
}
@Override
public PrincipalSecretsResult loadPrincipalSecrets(
- @NotNull PolarisCallContext callCtx, @NotNull String clientId) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull String clientId) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "loadPrincipalSecrets");
@@ -132,11 +131,11 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public PrincipalSecretsResult rotatePrincipalSecrets(
- @NotNull PolarisCallContext callCtx,
- @NotNull String clientId,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull String clientId,
long principalId,
boolean reset,
- @NotNull String oldSecretHash) {
+ @Nonnull String oldSecretHash) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "rotatePrincipalSecrets");
@@ -145,18 +144,18 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public CreateCatalogResult createCatalog(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisBaseEntity catalog,
- @NotNull List<PolarisEntityCore> principalRoles) {
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisBaseEntity catalog,
+ @Nonnull List<PolarisEntityCore> principalRoles) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "createCatalog");
return null;
}
@Override
public EntityResult createEntityIfNotExists(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisBaseEntity entity) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "createEntityIfNotExists");
@@ -165,9 +164,9 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public EntitiesResult createEntitiesIfNotExist(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull List<? extends PolarisBaseEntity> entities) {
+ @Nonnull List<? extends PolarisBaseEntity> entities) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "createEntitiesIfNotExist");
@@ -176,16 +175,16 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public EntityResult updateEntityPropertiesIfNotChanged(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisBaseEntity entity) {
+ @Nonnull PolarisBaseEntity entity) {
pendingUpdates.add(new EntityWithPath(catalogPath, entity));
return new EntityResult(entity);
}
@Override
public EntitiesResult updateEntitiesPropertiesIfNotChanged(
- @NotNull PolarisCallContext callCtx, @NotNull List<EntityWithPath> entities) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull List<EntityWithPath> entities) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "updateEntitiesPropertiesIfNotChanged");
@@ -194,20 +193,20 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public EntityResult renameEntity(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore entityToRename,
+ @Nonnull PolarisEntityCore entityToRename,
@Nullable List<PolarisEntityCore> newCatalogPath,
- @NotNull PolarisEntity renamedEntity) {
+ @Nonnull PolarisEntity renamedEntity) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "renameEntity");
return null;
}
@Override
public DropEntityResult dropEntityIfExists(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore entityToDrop,
+ @Nonnull PolarisEntityCore entityToDrop,
@Nullable Map<String, String> cleanupProperties,
boolean cleanup) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "dropEntityIfExists");
@@ -216,10 +215,10 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public PrivilegeResult grantUsageOnRoleToGrantee(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee) {
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "grantUsageOnRoleToGrantee");
@@ -228,10 +227,10 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public PrivilegeResult revokeUsageOnRoleFromGrantee(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
@Nullable PolarisEntityCore catalog,
- @NotNull PolarisEntityCore role,
- @NotNull PolarisEntityCore grantee) {
+ @Nonnull PolarisEntityCore role,
+ @Nonnull PolarisEntityCore grantee) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "revokeUsageOnRoleFromGrantee");
@@ -240,11 +239,11 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public PrivilegeResult grantPrivilegeOnSecurableToRole(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore grantee,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisPrivilege privilege) {
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisPrivilege privilege) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "grantPrivilegeOnSecurableToRole");
@@ -253,11 +252,11 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public PrivilegeResult revokePrivilegeOnSecurableFromRole(
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntityCore grantee,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntityCore grantee,
@Nullable List<PolarisEntityCore> catalogPath,
- @NotNull PolarisEntityCore securable,
- @NotNull PolarisPrivilege privilege) {
+ @Nonnull PolarisEntityCore securable,
+ @Nonnull PolarisPrivilege privilege) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "revokePrivilegeOnSecurableFromRole");
@@ -266,7 +265,7 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public LoadGrantsResult loadGrantsOnSecurable(
- @NotNull PolarisCallContext callCtx, long securableCatalogId, long securableId) {
+ @Nonnull PolarisCallContext callCtx, long securableCatalogId, long securableId) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "loadGrantsOnSecurable");
@@ -284,7 +283,7 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public ChangeTrackingResult loadEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull List<PolarisEntityId> entityIds) {
+ @Nonnull PolarisCallContext callCtx, @Nonnull List<PolarisEntityId> entityIds) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "loadEntitiesChangeTracking");
@@ -293,26 +292,26 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public EntityResult loadEntity(
- @NotNull PolarisCallContext callCtx, long entityCatalogId, long entityId) {
+ @Nonnull PolarisCallContext callCtx, long entityCatalogId, long entityId) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "loadEntity");
return null;
}
@Override
public EntitiesResult loadTasks(
- @NotNull PolarisCallContext callCtx, String executorId, int limit) {
+ @Nonnull PolarisCallContext callCtx, String executorId, int limit) {
callCtx.getDiagServices().fail("illegal_method_in_transaction_workspace", "loadTasks");
return null;
}
@Override
public ScopedCredentialsResult getSubscopedCredsForEntity(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
return delegate.getSubscopedCredsForEntity(
callCtx,
catalogId,
@@ -324,11 +323,11 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public ValidateAccessResult validateAccessToLocations(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
- @NotNull Set<PolarisStorageActions> actions,
- @NotNull Set<String> locations) {
+ @Nonnull Set<PolarisStorageActions> actions,
+ @Nonnull Set<String> locations) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "validateAccessToLocations");
@@ -337,7 +336,7 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public CachedEntryResult loadCachedEntryById(
- @NotNull PolarisCallContext callCtx, long entityCatalogId, long entityId) {
+ @Nonnull PolarisCallContext callCtx, long entityCatalogId, long entityId) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "loadCachedEntryById");
@@ -346,11 +345,11 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public CachedEntryResult loadCachedEntryByName(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long entityCatalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull String entityName) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull String entityName) {
callCtx
.getDiagServices()
.fail("illegal_method_in_transaction_workspace", "loadCachedEntryByName");
@@ -359,10 +358,10 @@ public class TransactionWorkspaceMetaStoreManager implements PolarisMetaStoreMan
@Override
public CachedEntryResult refreshCachedEntity(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
int entityVersion,
int entityGrantRecordsVersion,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
long entityCatalogId,
long entityId) {
callCtx
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCache.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCache.java
index 3966b1e3..05efba7f 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCache.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCache.java
@@ -21,6 +21,8 @@ package org.apache.polaris.core.persistence.cache;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.RemovalListener;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.AbstractMap;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
@@ -30,8 +32,6 @@ import org.apache.polaris.core.entity.PolarisBaseEntity;
import org.apache.polaris.core.entity.PolarisEntityType;
import org.apache.polaris.core.entity.PolarisGrantRecord;
import org.apache.polaris.core.persistence.cache.PolarisRemoteCache.CachedEntryResult;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/** The entity cache, can be private or shared */
public class EntityCache {
@@ -53,7 +53,7 @@ public class EntityCache {
*
* @param polarisRemoteCache the meta store manager implementation
*/
- public EntityCache(@NotNull PolarisRemoteCache polarisRemoteCache) {
+ public EntityCache(@Nonnull PolarisRemoteCache polarisRemoteCache) {
// by name cache
this.byName = new ConcurrentHashMap<>();
@@ -91,7 +91,7 @@ public class EntityCache {
*
* @param cacheEntry cache entry to remove
*/
- public void removeCacheEntry(@NotNull EntityCacheEntry cacheEntry) {
+ public void removeCacheEntry(@Nonnull EntityCacheEntry cacheEntry) {
// compute name key
EntityCacheByNameKey nameKey = new EntityCacheByNameKey(cacheEntry.getEntity());
@@ -107,7 +107,7 @@ public class EntityCache {
*
* @param cacheEntry new cache entry
*/
- private void cacheNewEntry(@NotNull EntityCacheEntry cacheEntry) {
+ private void cacheNewEntry(@Nonnull EntityCacheEntry cacheEntry) {
// compute name key
EntityCacheByNameKey nameKey = new EntityCacheByNameKey(cacheEntry.getEntity());
@@ -160,7 +160,7 @@ public class EntityCache {
* @param newCacheEntry new entry
*/
private void replaceCacheEntry(
- @Nullable EntityCacheEntry oldCacheEntry, @NotNull EntityCacheEntry newCacheEntry) {
+ @Nullable EntityCacheEntry oldCacheEntry, @Nonnull EntityCacheEntry newCacheEntry) {
// need to remove old?
if (oldCacheEntry != null) {
@@ -192,7 +192,7 @@ public class EntityCache {
* @return true if there is a mismatch
*/
private boolean entityNameKeyMismatch(
- @NotNull PolarisBaseEntity entity, @NotNull PolarisBaseEntity otherEntity) {
+ @Nonnull PolarisBaseEntity entity, @Nonnull PolarisBaseEntity otherEntity) {
return entity.getId() != otherEntity.getId()
|| entity.getParentId() != otherEntity.getParentId()
|| !entity.getName().equals(otherEntity.getName())
@@ -233,7 +233,7 @@ public class EntityCache {
* @param entityNameKey entity name key
* @return the cache entry or null if not found
*/
- public @Nullable EntityCacheEntry getEntityByName(@NotNull EntityCacheByNameKey entityNameKey) {
+ public @Nullable EntityCacheEntry getEntityByName(@Nonnull EntityCacheByNameKey entityNameKey) {
return byName.get(entityNameKey);
}
@@ -250,8 +250,8 @@ public class EntityCache {
* @return the cache entry for the entity or null if the specified entity does not exist
*/
public @Nullable EntityCacheEntry getAndRefreshIfNeeded(
- @NotNull PolarisCallContext callContext,
- @NotNull PolarisBaseEntity entityToValidate,
+ @Nonnull PolarisCallContext callContext,
+ @Nonnull PolarisBaseEntity entityToValidate,
int entityMinVersion,
int entityGrantRecordsMinVersion) {
long entityCatalogId = entityToValidate.getCatalogId();
@@ -366,7 +366,7 @@ public class EntityCache {
* entity, either as found in the cache or loaded from the backend
*/
public @Nullable EntityCacheLookupResult getOrLoadEntityById(
- @NotNull PolarisCallContext callContext, long entityCatalogId, long entityId) {
+ @Nonnull PolarisCallContext callContext, long entityCatalogId, long entityId) {
// if it exists, we are set
EntityCacheEntry entry = this.getEntityById(entityId);
@@ -418,7 +418,7 @@ public class EntityCache {
* entity, either as found in the cache or loaded from the backend
*/
public @Nullable EntityCacheLookupResult getOrLoadEntityByName(
- @NotNull PolarisCallContext callContext, @NotNull EntityCacheByNameKey entityNameKey) {
+ @Nonnull PolarisCallContext callContext, @Nonnull EntityCacheByNameKey entityNameKey) {
// if it exists, we are set
EntityCacheEntry entry = this.getEntityByName(entityNameKey);
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCacheEntry.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCacheEntry.java
index 20652b7c..ca1a7e4e 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCacheEntry.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCacheEntry.java
@@ -19,12 +19,12 @@
package org.apache.polaris.core.persistence.cache;
import com.google.common.collect.ImmutableList;
+import jakarta.annotation.Nonnull;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.entity.PolarisBaseEntity;
import org.apache.polaris.core.entity.PolarisGrantRecord;
-import org.jetbrains.annotations.NotNull;
/** An entry in our entity cache. Note, this is fully immutable */
public class EntityCacheEntry {
@@ -57,10 +57,10 @@ public class EntityCacheEntry {
* @param grantsVersion version of the grants when they were loaded
*/
EntityCacheEntry(
- @NotNull PolarisDiagnostics diagnostics,
+ @Nonnull PolarisDiagnostics diagnostics,
long createdOnNanoTimestamp,
- @NotNull PolarisBaseEntity entity,
- @NotNull List<PolarisGrantRecord> grantRecords,
+ @Nonnull PolarisBaseEntity entity,
+ @Nonnull List<PolarisGrantRecord> grantRecords,
int grantsVersion) {
// validate not null
diagnostics.checkNotNull(entity, "entity_null");
@@ -103,21 +103,21 @@ public class EntityCacheEntry {
return lastAccessedNanoTimestamp;
}
- public @NotNull PolarisBaseEntity getEntity() {
+ public @Nonnull PolarisBaseEntity getEntity() {
return entity;
}
- public @NotNull List<PolarisGrantRecord> getAllGrantRecords() {
+ public @Nonnull List<PolarisGrantRecord> getAllGrantRecords() {
return grantRecords;
}
- public @NotNull List<PolarisGrantRecord> getGrantRecordsAsGrantee() {
+ public @Nonnull List<PolarisGrantRecord> getGrantRecordsAsGrantee() {
return grantRecords.stream()
.filter(record -> record.getGranteeId() == entity.getId())
.collect(Collectors.toList());
}
- public @NotNull List<PolarisGrantRecord> getGrantRecordsAsSecurable() {
+ public @Nonnull List<PolarisGrantRecord> getGrantRecordsAsSecurable() {
return grantRecords.stream()
.filter(record -> record.getSecurableId() == entity.getId())
.collect(Collectors.toList());
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCacheLookupResult.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCacheLookupResult.java
index 87245e38..a4677baa 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCacheLookupResult.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCacheLookupResult.java
@@ -18,7 +18,7 @@
*/
package org.apache.polaris.core.persistence.cache;
-import org.jetbrains.annotations.Nullable;
+import jakarta.annotation.Nullable;
/** Result of a lookup operation */
public class EntityCacheLookupResult {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/PolarisRemoteCache.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/PolarisRemoteCache.java
index ca5054ae..e45cc8b1 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/PolarisRemoteCache.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/PolarisRemoteCache.java
@@ -20,6 +20,8 @@ package org.apache.polaris.core.persistence.cache;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.entity.PolarisBaseEntity;
@@ -28,8 +30,6 @@ import org.apache.polaris.core.entity.PolarisEntityId;
import org.apache.polaris.core.entity.PolarisEntityType;
import org.apache.polaris.core.entity.PolarisGrantRecord;
import org.apache.polaris.core.persistence.BaseResult;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* Interface to the remote entity cache. This allows the local cache to detect remote entity changes
@@ -46,9 +46,9 @@ public interface PolarisRemoteCache {
* @return a list of version tracking information. Order in that returned list is the same as the
* input list. Some elements might be NULL if the entity has been purged. Not expected to fail
*/
- @NotNull
+ @Nonnull
ChangeTrackingResult loadEntitiesChangeTracking(
- @NotNull PolarisCallContext callCtx, @NotNull List<PolarisEntityId> entityIds);
+ @Nonnull PolarisCallContext callCtx, @Nonnull List<PolarisEntityId> entityIds);
/**
* Load a cached entry, i.e. an entity definition and associated grant records, from the backend
@@ -63,9 +63,9 @@ public interface PolarisRemoteCache {
* @return cached entry for this entity. Status will be ENTITY_NOT_FOUND if the entity was not
* found
*/
- @NotNull
+ @Nonnull
CachedEntryResult loadCachedEntryById(
- @NotNull PolarisCallContext callCtx, long entityCatalogId, long entityId);
+ @Nonnull PolarisCallContext callCtx, long entityCatalogId, long entityId);
/**
* Load a cached entry, i.e. an entity definition and associated grant records, from the backend
@@ -83,13 +83,13 @@ public interface PolarisRemoteCache {
* @return cached entry for this entity. Status will be ENTITY_NOT_FOUND if the entity was not
* found
*/
- @NotNull
+ @Nonnull
CachedEntryResult loadCachedEntryByName(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long entityCatalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull String entityName);
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull String entityName);
/**
* Refresh a cached entity from the backend store. Will return NULL if the entity does not exist,
@@ -106,12 +106,12 @@ public interface PolarisRemoteCache {
* @return cached entry for this entity. Status will be ENTITY_NOT_FOUND if the entity was not *
* found
*/
- @NotNull
+ @Nonnull
CachedEntryResult refreshCachedEntity(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
int entityVersion,
int entityGrantRecordsVersion,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
long entityCatalogId,
long entityId);
@@ -128,7 +128,7 @@ public interface PolarisRemoteCache {
* @param extraInformation extra information
*/
public ChangeTrackingResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.changeTrackingVersions = null;
}
@@ -139,14 +139,14 @@ public interface PolarisRemoteCache {
* @param changeTrackingVersions change tracking versions
*/
public ChangeTrackingResult(
- @NotNull List<PolarisChangeTrackingVersions> changeTrackingVersions) {
+ @Nonnull List<PolarisChangeTrackingVersions> changeTrackingVersions) {
super(BaseResult.ReturnStatus.SUCCESS);
this.changeTrackingVersions = changeTrackingVersions;
}
@JsonCreator
private ChangeTrackingResult(
- @JsonProperty("returnStatus") @NotNull BaseResult.ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull BaseResult.ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@JsonProperty("changeTrackingVersions")
List<PolarisChangeTrackingVersions> changeTrackingVersions) {
@@ -180,7 +180,7 @@ public interface PolarisRemoteCache {
* @param extraInformation extra information
*/
public CachedEntryResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.entity = null;
this.entityGrantRecords = null;
@@ -206,7 +206,7 @@ public interface PolarisRemoteCache {
@JsonCreator
public CachedEntryResult(
- @JsonProperty("returnStatus") @NotNull BaseResult.ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull BaseResult.ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@Nullable @JsonProperty("entity") PolarisBaseEntity entity,
@JsonProperty("grantRecordsVersion") int grantRecordsVersion,
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/persistence/resolver/Resolver.java b/polaris-core/src/main/java/org/apache/polaris/core/persistence/resolver/Resolver.java
index be6311b2..ebefa158 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/persistence/resolver/Resolver.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/persistence/resolver/Resolver.java
@@ -18,6 +18,8 @@
*/
package org.apache.polaris.core.persistence.resolver;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.HashMap;
@@ -42,8 +44,6 @@ import org.apache.polaris.core.persistence.cache.EntityCacheEntry;
import org.apache.polaris.core.persistence.cache.EntityCacheLookupResult;
import org.apache.polaris.core.persistence.cache.PolarisRemoteCache;
import org.apache.polaris.core.persistence.cache.PolarisRemoteCache.ChangeTrackingResult;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/**
* REST request resolver, allows to resolve all entities referenced directly or indirectly by in
@@ -52,16 +52,16 @@ import org.jetbrains.annotations.Nullable;
public class Resolver {
// we stash the Polaris call context here
- private final @NotNull PolarisCallContext polarisCallContext;
+ private final @Nonnull PolarisCallContext polarisCallContext;
// the diagnostic services
- private final @NotNull PolarisDiagnostics diagnostics;
+ private final @Nonnull PolarisDiagnostics diagnostics;
// the polaris metastore manager
- private final @NotNull PolarisRemoteCache polarisRemoteCache;
+ private final @Nonnull PolarisRemoteCache polarisRemoteCache;
// the cache of entities
- private final @NotNull EntityCache cache;
+ private final @Nonnull EntityCache cache;
// the id of the principal making the call or 0 if unknown
private final long callerPrincipalId;
@@ -126,12 +126,12 @@ public class Resolver {
* service admin should use null for that parameter.
*/
public Resolver(
- @NotNull PolarisCallContext polarisCallContext,
- @NotNull PolarisRemoteCache polarisRemoteCache,
+ @Nonnull PolarisCallContext polarisCallContext,
+ @Nonnull PolarisRemoteCache polarisRemoteCache,
long callerPrincipalId,
@Nullable String callerPrincipalName,
@Nullable Set<String> callerPrincipalRoleNamesScope,
- @NotNull EntityCache cache,
+ @Nonnull EntityCache cache,
@Nullable String referenceCatalogName) {
this.polarisCallContext = polarisCallContext;
this.diagnostics = polarisCallContext.getDiagServices();
@@ -185,7 +185,7 @@ public class Resolver {
* catalog role.
* @param entityName the name of the entity
*/
- public void addEntityByName(@NotNull PolarisEntityType entityType, @NotNull String entityName) {
+ public void addEntityByName(@Nonnull PolarisEntityType entityType, @Nonnull String entityName) {
diagnostics.checkNotNull(entityType, "entity_type_is_null");
diagnostics.checkNotNull(entityName, "entity_name_is_null");
// can only be called if the resolver has not yet been called
@@ -204,7 +204,7 @@ public class Resolver {
* @param entityName the name of the entity
*/
public void addOptionalEntityByName(
- @NotNull PolarisEntityType entityType, @NotNull String entityName) {
+ @Nonnull PolarisEntityType entityType, @Nonnull String entityName) {
diagnostics.checkNotNull(entityType, "entity_type_is_null");
diagnostics.checkNotNull(entityName, "entity_name_is_null");
// can only be called if the resolver has not yet been called
@@ -217,7 +217,7 @@ public class Resolver {
*
* @param path path to resolve
*/
- public void addPath(@NotNull ResolverPath path) {
+ public void addPath(@Nonnull ResolverPath path) {
// can only be called if the resolver has not yet been called
this.diagnostics.check(resolverStatus == null, "resolver_called");
diagnostics.checkNotNull(path, "unexpected_null_entity_path");
@@ -269,7 +269,7 @@ public class Resolver {
/**
* @return the principal we resolved
*/
- public @NotNull EntityCacheEntry getResolvedCallerPrincipal() {
+ public @Nonnull EntityCacheEntry getResolvedCallerPrincipal() {
// can only be called if the resolver has been called and was success
this.diagnostics.checkNotNull(resolverStatus, "resolver_must_be_called_first");
this.diagnostics.check(
@@ -282,7 +282,7 @@ public class Resolver {
/**
* @return all principal roles which were activated. The list can be empty
*/
- public @NotNull List<EntityCacheEntry> getResolvedCallerPrincipalRoles() {
+ public @Nonnull List<EntityCacheEntry> getResolvedCallerPrincipalRoles() {
// can only be called if the resolver has been called and was success
this.diagnostics.checkNotNull(resolverStatus, "resolver_must_be_called_first");
this.diagnostics.check(
@@ -329,7 +329,7 @@ public class Resolver {
*
* @return single resolved path
*/
- public @NotNull List<EntityCacheEntry> getResolvedPath() {
+ public @Nonnull List<EntityCacheEntry> getResolvedPath() {
// can only be called if the resolver has been called and was success
this.diagnostics.checkNotNull(resolverStatus, "resolver_must_be_called_first");
this.diagnostics.check(
@@ -345,7 +345,7 @@ public class Resolver {
*
* @return list of resolved path
*/
- public @NotNull List<List<EntityCacheEntry>> getResolvedPaths() {
+ public @Nonnull List<List<EntityCacheEntry>> getResolvedPaths() {
// can only be called if the resolver has been called and was success
this.diagnostics.checkNotNull(resolverStatus, "resolver_must_be_called_first");
this.diagnostics.check(
@@ -366,7 +366,7 @@ public class Resolver {
* @return the entity which has been resolved or null if that entity does not exist
*/
public @Nullable EntityCacheEntry getResolvedEntity(
- @NotNull PolarisEntityType entityType, @NotNull String entityName) {
+ @Nonnull PolarisEntityType entityType, @Nonnull String entityName) {
// can only be called if the resolver has been called and was success
this.diagnostics.checkNotNull(resolverStatus, "resolver_must_be_called_first");
this.diagnostics.check(
@@ -769,7 +769,7 @@ public class Resolver {
* @return the status of resolution
*/
private ResolverStatus resolveReferenceCatalog(
- @NotNull List<EntityCacheEntry> toValidate, @NotNull String referenceCatalogName) {
+ @Nonnull List<EntityCacheEntry> toValidate, @Nonnull String referenceCatalogName) {
// resolve the catalog
this.resolvedReferenceCatalog =
this.resolveByName(toValidate, PolarisEntityType.CATALOG, referenceCatalogName);
@@ -843,7 +843,7 @@ public class Resolver {
* @param optional if true, the entity is optional
*/
private void addEntityByName(
- @NotNull PolarisEntityType entityType, @NotNull String entityName, boolean optional) {
+ @Nonnull PolarisEntityType entityType, @Nonnull String entityName, boolean optional) {
// can only be called if the resolver has not yet been called
this.diagnostics.check(resolverStatus == null, "resolver_called");
@@ -896,11 +896,11 @@ public class Resolver {
* that this entity is up-to-date
*/
private EntityCacheEntry resolveByName(
- @NotNull List<EntityCacheEntry> toValidate,
+ @Nonnull List<EntityCacheEntry> toValidate,
long catalogId,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
long parentId,
- @NotNull String entityName) {
+ @Nonnull String entityName) {
// key for that entity
EntityCacheByNameKey nameKey =
@@ -959,8 +959,8 @@ public class Resolver {
* that this entity is up-to-date
*/
private EntityCacheEntry resolveById(
- @NotNull List<EntityCacheEntry> toValidate,
- @NotNull PolarisEntityType entityType,
+ @Nonnull List<EntityCacheEntry> toValidate,
+ @Nonnull PolarisEntityType entityType,
long catalogId,
long entityId) {
// get or load by name
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/FileStorageConfigurationInfo.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/FileStorageConfigurationInfo.java
index 2847d5a8..6b1d48c5 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/FileStorageConfigurationInfo.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/FileStorageConfigurationInfo.java
@@ -19,9 +19,9 @@
package org.apache.polaris.core.storage;
import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.annotation.Nonnull;
import java.util.List;
import java.util.Locale;
-import org.jetbrains.annotations.NotNull;
/**
* Support for file:// URLs in storage configuration. This is pretty-much only used for testing.
@@ -31,7 +31,7 @@ import org.jetbrains.annotations.NotNull;
public class FileStorageConfigurationInfo extends PolarisStorageConfigurationInfo {
public FileStorageConfigurationInfo(
- @JsonProperty(value = "allowedLocations", required = true) @NotNull
+ @JsonProperty(value = "allowedLocations", required = true) @Nonnull
List<String> allowedLocations) {
super(StorageType.FILE, allowedLocations);
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/InMemoryStorageIntegration.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/InMemoryStorageIntegration.java
index ce130668..ae872642 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/InMemoryStorageIntegration.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/InMemoryStorageIntegration.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.core.storage;
+import jakarta.annotation.Nonnull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -26,7 +27,6 @@ import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.apache.polaris.core.context.CallContext;
-import org.jetbrains.annotations.NotNull;
/**
* Base class for in-memory implementations of {@link PolarisStorageIntegration}. A basic
@@ -56,9 +56,9 @@ public abstract class InMemoryStorageIntegration<T extends PolarisStorageConfigu
*/
public static Map<String, Map<PolarisStorageActions, ValidationResult>>
validateSubpathsOfAllowedLocations(
- @NotNull PolarisStorageConfigurationInfo storageConfig,
- @NotNull Set<PolarisStorageActions> actions,
- @NotNull Set<String> locations) {
+ @Nonnull PolarisStorageConfigurationInfo storageConfig,
+ @Nonnull Set<PolarisStorageActions> actions,
+ @Nonnull Set<String> locations) {
// trim trailing / from allowed locations so that locations missing the trailing slash still
// match
Set<String> allowedLocationStrings =
@@ -124,11 +124,11 @@ public abstract class InMemoryStorageIntegration<T extends PolarisStorageConfigu
}
@Override
- @NotNull
+ @Nonnull
public Map<String, Map<PolarisStorageActions, ValidationResult>> validateAccessToLocations(
- @NotNull T storageConfig,
- @NotNull Set<PolarisStorageActions> actions,
- @NotNull Set<String> locations) {
+ @Nonnull T storageConfig,
+ @Nonnull Set<PolarisStorageActions> actions,
+ @Nonnull Set<String> locations) {
return validateSubpathsOfAllowedLocations(storageConfig, actions, locations);
}
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisCredentialVendor.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisCredentialVendor.java
index c4d6989e..9f03082a 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisCredentialVendor.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisCredentialVendor.java
@@ -20,13 +20,13 @@ package org.apache.polaris.core.storage;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.EnumMap;
import java.util.Map;
import java.util.Set;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.persistence.BaseResult;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/** Manage credentials for storage locations. */
public interface PolarisCredentialVendor {
@@ -43,14 +43,14 @@ public interface PolarisCredentialVendor {
* @param allowedWriteLocations a set of allowed to write locations
* @return an enum map containing the scoped credentials
*/
- @NotNull
+ @Nonnull
ScopedCredentialsResult getSubscopedCredsForEntity(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations);
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations);
/**
* Validate whether the entity has access to the locations with the provided target operations
@@ -85,13 +85,13 @@ public interface PolarisCredentialVendor {
* }
* </pre>
*/
- @NotNull
+ @Nonnull
ValidateAccessResult validateAccessToLocations(
- @NotNull PolarisCallContext callCtx,
+ @Nonnull PolarisCallContext callCtx,
long catalogId,
long entityId,
- @NotNull Set<PolarisStorageActions> actions,
- @NotNull Set<String> locations);
+ @Nonnull Set<PolarisStorageActions> actions,
+ @Nonnull Set<String> locations);
/** Result of a getSubscopedCredsForEntity() call */
class ScopedCredentialsResult extends BaseResult {
@@ -106,7 +106,7 @@ public interface PolarisCredentialVendor {
* @param extraInformation extra information
*/
public ScopedCredentialsResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.credentials = null;
}
@@ -117,14 +117,14 @@ public interface PolarisCredentialVendor {
* @param credentials credentials
*/
public ScopedCredentialsResult(
- @NotNull EnumMap<PolarisCredentialProperty, String> credentials) {
+ @Nonnull EnumMap<PolarisCredentialProperty, String> credentials) {
super(BaseResult.ReturnStatus.SUCCESS);
this.credentials = credentials;
}
@JsonCreator
private ScopedCredentialsResult(
- @JsonProperty("returnStatus") @NotNull BaseResult.ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull BaseResult.ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@JsonProperty("credentials") Map<String, String> credentials) {
super(returnStatus, extraInformation);
@@ -154,7 +154,7 @@ public interface PolarisCredentialVendor {
* @param extraInformation extra information
*/
public ValidateAccessResult(
- @NotNull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
+ @Nonnull BaseResult.ReturnStatus errorCode, @Nullable String extraInformation) {
super(errorCode, extraInformation);
this.validateResult = null;
}
@@ -164,14 +164,14 @@ public interface PolarisCredentialVendor {
*
* @param validateResult validate result
*/
- public ValidateAccessResult(@NotNull Map<String, String> validateResult) {
+ public ValidateAccessResult(@Nonnull Map<String, String> validateResult) {
super(BaseResult.ReturnStatus.SUCCESS);
this.validateResult = validateResult;
}
@JsonCreator
private ValidateAccessResult(
- @JsonProperty("returnStatus") @NotNull BaseResult.ReturnStatus returnStatus,
+ @JsonProperty("returnStatus") @Nonnull BaseResult.ReturnStatus returnStatus,
@JsonProperty("extraInformation") String extraInformation,
@JsonProperty("validateResult") Map<String, String> validateResult) {
super(returnStatus, extraInformation);
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java
index 4b284926..54745427 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java
@@ -26,6 +26,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
+import jakarta.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -46,7 +47,6 @@ import org.apache.polaris.core.entity.TableLikeEntity;
import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo;
import org.apache.polaris.core.storage.azure.AzureStorageConfigurationInfo;
import org.apache.polaris.core.storage.gcp.GcpStorageConfigurationInfo;
-import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -78,8 +78,8 @@ public abstract class PolarisStorageConfigurationInfo {
private final StorageType storageType;
public PolarisStorageConfigurationInfo(
- @JsonProperty(value = "storageType", required = true) @NotNull StorageType storageType,
- @JsonProperty(value = "allowedLocations", required = true) @NotNull
+ @JsonProperty(value = "storageType", required = true) @Nonnull StorageType storageType,
+ @JsonProperty(value = "allowedLocations", required = true) @Nonnull
List<String> allowedLocations) {
this(storageType, allowedLocations, true);
}
@@ -125,7 +125,7 @@ public abstract class PolarisStorageConfigurationInfo {
* @return the PolarisStorageConfiguration object
*/
public static PolarisStorageConfigurationInfo deserialize(
- @NotNull PolarisDiagnostics diagnostics, final @NotNull String jsonStr) {
+ @Nonnull PolarisDiagnostics diagnostics, final @Nonnull String jsonStr) {
try {
return DEFAULT_MAPPER.readValue(jsonStr, PolarisStorageConfigurationInfo.class);
} catch (JsonProcessingException exception) {
@@ -205,7 +205,7 @@ public abstract class PolarisStorageConfigurationInfo {
.orElse(List.of());
}
- private static @NotNull Optional<PolarisEntity> findStorageInfoFromHierarchy(
+ private static @Nonnull Optional<PolarisEntity> findStorageInfoFromHierarchy(
List<PolarisEntity> entityPath) {
for (int i = entityPath.size() - 1; i >= 0; i--) {
PolarisEntity e = entityPath.get(i);
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegration.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegration.java
index 97bbc8a2..eec9a420 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegration.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegration.java
@@ -18,12 +18,12 @@
*/
package org.apache.polaris.core.storage;
+import jakarta.annotation.Nonnull;
import java.util.EnumMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.apache.polaris.core.PolarisDiagnostics;
-import org.jetbrains.annotations.NotNull;
/**
* Abstract of Polaris Storage Integration. It holds the reference to an object that having the
@@ -55,11 +55,11 @@ public abstract class PolarisStorageIntegration<T extends PolarisStorageConfigur
* @return An enum map including the scoped credentials
*/
public abstract EnumMap<PolarisCredentialProperty, String> getSubscopedCreds(
- @NotNull PolarisDiagnostics diagnostics,
- @NotNull T storageConfig,
+ @Nonnull PolarisDiagnostics diagnostics,
+ @Nonnull T storageConfig,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations);
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations);
/**
* Validate access for the provided operation actions and locations.
@@ -92,12 +92,12 @@ public abstract class PolarisStorageIntegration<T extends PolarisStorageConfigur
* }
* </pre>
*/
- @NotNull
+ @Nonnull
public abstract Map<String, Map<PolarisStorageActions, ValidationResult>>
validateAccessToLocations(
- @NotNull T storageConfig,
- @NotNull Set<PolarisStorageActions> actions,
- @NotNull Set<String> locations);
+ @Nonnull T storageConfig,
+ @Nonnull Set<PolarisStorageActions> actions,
+ @Nonnull Set<String> locations);
/**
* Result of calling {@link #validateAccessToLocations(PolarisStorageConfigurationInfo, Set, Set)}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegrationProvider.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegrationProvider.java
index 437d6e3b..95f558ba 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegrationProvider.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegrationProvider.java
@@ -18,7 +18,7 @@
*/
package org.apache.polaris.core.storage;
-import org.jetbrains.annotations.Nullable;
+import jakarta.annotation.Nullable;
/**
* Factory interface that knows how to construct a {@link PolarisStorageIntegration} given a {@link
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageConfigurationOverride.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageConfigurationOverride.java
index f85ec1eb..bf5a6cbf 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageConfigurationOverride.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageConfigurationOverride.java
@@ -18,8 +18,8 @@
*/
package org.apache.polaris.core.storage;
+import jakarta.annotation.Nonnull;
import java.util.List;
-import org.jetbrains.annotations.NotNull;
/**
* Allows overriding the allowed locations for specific entities. Only the allowedLocations
@@ -32,7 +32,7 @@ public class StorageConfigurationOverride extends PolarisStorageConfigurationInf
private final PolarisStorageConfigurationInfo parentStorageConfiguration;
public StorageConfigurationOverride(
- @NotNull PolarisStorageConfigurationInfo parentStorageConfiguration,
+ @Nonnull PolarisStorageConfigurationInfo parentStorageConfiguration,
List<String> allowedLocations) {
super(parentStorageConfiguration.getStorageType(), allowedLocations, false);
this.parentStorageConfiguration = parentStorageConfiguration;
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageLocation.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageLocation.java
index baad1f89..d2c8fe9b 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageLocation.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageLocation.java
@@ -18,7 +18,7 @@
*/
package org.apache.polaris.core.storage;
-import jakarta.validation.constraints.NotNull;
+import jakarta.annotation.Nonnull;
import java.net.URI;
import org.apache.polaris.core.storage.azure.AzureLocation;
@@ -36,7 +36,7 @@ public class StorageLocation {
}
}
- protected StorageLocation(@NotNull String location) {
+ protected StorageLocation(@Nonnull String location) {
if (location == null) {
this.location = null;
} else if (location.startsWith("file:/") && !location.startsWith("file:///")) {
@@ -56,7 +56,7 @@ public class StorageLocation {
}
/** If a path doesn't start with `/`, this will add one */
- protected final @NotNull String ensureLeadingSlash(@NotNull String location) {
+ protected final @Nonnull String ensureLeadingSlash(@Nonnull String location) {
if (location.startsWith("/")) {
return location;
} else {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageUtil.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageUtil.java
index 13c0f17e..02cc2af1 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageUtil.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/StorageUtil.java
@@ -18,8 +18,8 @@
*/
package org.apache.polaris.core.storage;
+import jakarta.annotation.Nonnull;
import java.net.URI;
-import org.jetbrains.annotations.NotNull;
public class StorageUtil {
/**
@@ -31,8 +31,8 @@ public class StorageUtil {
* @param fileSep File separator to use.
* @return Well formatted file path.
*/
- public static @NotNull String concatFilePrefixes(
- @NotNull String leftPath, String rightPath, String fileSep) {
+ public static @Nonnull String concatFilePrefixes(
+ @Nonnull String leftPath, String rightPath, String fileSep) {
if (leftPath.endsWith(fileSep) && rightPath.startsWith(fileSep)) {
return leftPath + rightPath.substring(1);
} else if (!leftPath.endsWith(fileSep) && !rightPath.startsWith(fileSep)) {
@@ -48,7 +48,7 @@ public class StorageUtil {
* @param path A path to parse
* @return The bucket/authority of the path
*/
- public static @NotNull String getBucket(String path) {
+ public static @Nonnull String getBucket(String path) {
URI uri = URI.create(path);
return getBucket(uri);
}
@@ -59,7 +59,7 @@ public class StorageUtil {
* @param uri A path to parse
* @return The bucket/authority of the URI
*/
- public static @NotNull String getBucket(URI uri) {
+ public static @Nonnull String getBucket(URI uri) {
return uri.getAuthority();
}
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
index 1714f67c..c22772f8 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.core.storage.aws;
+import jakarta.annotation.Nonnull;
import java.net.URI;
import java.util.EnumMap;
import java.util.HashMap;
@@ -28,7 +29,6 @@ import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.storage.InMemoryStorageIntegration;
import org.apache.polaris.core.storage.PolarisCredentialProperty;
import org.apache.polaris.core.storage.StorageUtil;
-import org.jetbrains.annotations.NotNull;
import software.amazon.awssdk.policybuilder.iam.IamConditionOperator;
import software.amazon.awssdk.policybuilder.iam.IamEffect;
import software.amazon.awssdk.policybuilder.iam.IamPolicy;
@@ -51,11 +51,11 @@ public class AwsCredentialsStorageIntegration
/** {@inheritDoc} */
@Override
public EnumMap<PolarisCredentialProperty, String> getSubscopedCreds(
- @NotNull PolarisDiagnostics diagnostics,
- @NotNull AwsStorageConfigurationInfo storageConfig,
+ @Nonnull PolarisDiagnostics diagnostics,
+ @Nonnull AwsStorageConfigurationInfo storageConfig,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
AssumeRoleResponse response =
stsClient.assumeRole(
AssumeRoleRequest.builder()
@@ -174,13 +174,13 @@ public class AwsCredentialsStorageIntegration
}
}
- private static @NotNull String parseS3Path(URI uri) {
+ private static @Nonnull String parseS3Path(URI uri) {
String bucket = StorageUtil.getBucket(uri);
String path = trimLeadingSlash(uri.getPath());
return String.join("/", bucket, path);
}
- private static @NotNull String trimLeadingSlash(String path) {
+ private static @Nonnull String trimLeadingSlash(String path) {
if (path.startsWith("/")) {
path = path.substring(1);
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java
index c6b0f58e..0996fb40 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java
@@ -22,11 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/** Aws Polaris Storage Configuration information */
public class AwsStorageConfigurationInfo extends PolarisStorageConfigurationInfo {
@@ -39,7 +39,7 @@ public class AwsStorageConfigurationInfo extends PolarisStorageConfigurationInfo
@JsonIgnore public static final String ROLE_ARN_PATTERN = "^arn:aws:iam::\\d{12}:role/.+$";
// AWS role to be assumed
- private final @NotNull String roleARN;
+ private final @Nonnull String roleARN;
// AWS external ID, optional
@JsonProperty(value = "externalId")
@@ -51,17 +51,17 @@ public class AwsStorageConfigurationInfo extends PolarisStorageConfigurationInfo
@JsonCreator
public AwsStorageConfigurationInfo(
- @JsonProperty(value = "storageType", required = true) @NotNull StorageType storageType,
- @JsonProperty(value = "allowedLocations", required = true) @NotNull
+ @JsonProperty(value = "storageType", required = true) @Nonnull StorageType storageType,
+ @JsonProperty(value = "allowedLocations", required = true) @Nonnull
List<String> allowedLocations,
- @JsonProperty(value = "roleARN", required = true) @NotNull String roleARN) {
+ @JsonProperty(value = "roleARN", required = true) @Nonnull String roleARN) {
this(storageType, allowedLocations, roleARN, null);
}
public AwsStorageConfigurationInfo(
- @NotNull StorageType storageType,
- @NotNull List<String> allowedLocations,
- @NotNull String roleARN,
+ @Nonnull StorageType storageType,
+ @Nonnull List<String> allowedLocations,
+ @Nonnull String roleARN,
@Nullable String externalId) {
super(storageType, allowedLocations);
this.roleARN = roleARN;
@@ -87,7 +87,7 @@ public class AwsStorageConfigurationInfo extends PolarisStorageConfigurationInfo
}
}
- public @NotNull String getRoleARN() {
+ public @Nonnull String getRoleARN() {
return roleARN;
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureCredentialsStorageIntegration.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureCredentialsStorageIntegration.java
index 86888c41..4f5d7a0a 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureCredentialsStorageIntegration.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureCredentialsStorageIntegration.java
@@ -35,6 +35,7 @@ import com.azure.storage.file.datalake.DataLakeServiceClientBuilder;
import com.azure.storage.file.datalake.models.DataLakeStorageException;
import com.azure.storage.file.datalake.sas.DataLakeServiceSasSignatureValues;
import com.azure.storage.file.datalake.sas.PathSasPermission;
+import jakarta.annotation.Nonnull;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.Period;
@@ -47,7 +48,6 @@ import java.util.Set;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.storage.InMemoryStorageIntegration;
import org.apache.polaris.core.storage.PolarisCredentialProperty;
-import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono;
@@ -70,11 +70,11 @@ public class AzureCredentialsStorageIntegration
@Override
public EnumMap<PolarisCredentialProperty, String> getSubscopedCreds(
- @NotNull PolarisDiagnostics diagnostics,
- @NotNull AzureStorageConfigurationInfo storageConfig,
+ @Nonnull PolarisDiagnostics diagnostics,
+ @Nonnull AzureStorageConfigurationInfo storageConfig,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
EnumMap<PolarisCredentialProperty, String> credentialMap =
new EnumMap<>(PolarisCredentialProperty.class);
String loc =
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureLocation.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureLocation.java
index a5f0b218..0214ebca 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureLocation.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureLocation.java
@@ -18,10 +18,10 @@
*/
package org.apache.polaris.core.storage.azure;
+import jakarta.annotation.Nonnull;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.polaris.core.storage.StorageLocation;
-import org.jetbrains.annotations.NotNull;
/** This class represents all information for a azure location */
public class AzureLocation extends StorageLocation {
@@ -45,7 +45,7 @@ public class AzureLocation extends StorageLocation {
*
* @param location a uri
*/
- public AzureLocation(@NotNull String location) {
+ public AzureLocation(@Nonnull String location) {
super(location);
Matcher matcher = URI_PATTERN.matcher(location);
@@ -103,7 +103,7 @@ public class AzureLocation extends StorageLocation {
* by the other StorageLocation.
*/
@Override
- public boolean isChildOf(@NotNull StorageLocation potentialParent) {
+ public boolean isChildOf(@Nonnull StorageLocation potentialParent) {
if (potentialParent instanceof AzureLocation) {
AzureLocation potentialAzureParent = (AzureLocation) potentialParent;
if (this.container.equals(potentialAzureParent.container)) {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureStorageConfigurationInfo.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureStorageConfigurationInfo.java
index 325ad149..99e7f3e3 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureStorageConfigurationInfo.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureStorageConfigurationInfo.java
@@ -22,11 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import java.util.Objects;
import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/** Azure storage configuration information. */
public class AzureStorageConfigurationInfo extends PolarisStorageConfigurationInfo {
@@ -35,7 +35,7 @@ public class AzureStorageConfigurationInfo extends PolarisStorageConfigurationIn
@JsonIgnore private static final int MAX_ALLOWED_LOCATIONS = 20;
// Azure tenant id
- private final @NotNull String tenantId;
+ private final @Nonnull String tenantId;
/** The multi tenant app name for the service principal */
@JsonProperty(value = "multiTenantAppName", required = false)
@@ -47,9 +47,9 @@ public class AzureStorageConfigurationInfo extends PolarisStorageConfigurationIn
@JsonCreator
public AzureStorageConfigurationInfo(
- @JsonProperty(value = "allowedLocations", required = true) @NotNull
+ @JsonProperty(value = "allowedLocations", required = true) @Nonnull
List<String> allowedLocations,
- @JsonProperty(value = "tenantId", required = true) @NotNull String tenantId) {
+ @JsonProperty(value = "tenantId", required = true) @Nonnull String tenantId) {
super(StorageType.AZURE, allowedLocations);
this.tenantId = tenantId;
validateMaxAllowedLocations(MAX_ALLOWED_LOCATIONS);
@@ -60,7 +60,7 @@ public class AzureStorageConfigurationInfo extends PolarisStorageConfigurationIn
return "org.apache.iceberg.azure.adlsv2.ADLSFileIO";
}
- public @NotNull String getTenantId() {
+ public @Nonnull String getTenantId() {
return tenantId;
}
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java
index 7a058442..d7707115 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java
@@ -21,6 +21,7 @@ package org.apache.polaris.core.storage.cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.Expiry;
import com.github.benmanes.caffeine.cache.LoadingCache;
+import jakarta.annotation.Nonnull;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
@@ -31,7 +32,6 @@ import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.entity.PolarisEntity;
import org.apache.polaris.core.entity.PolarisEntityType;
import org.apache.polaris.core.storage.PolarisCredentialVendor;
-import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.VisibleForTesting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -103,12 +103,12 @@ public class StorageCredentialCache {
* @return the a map of string containing the scoped creds information
*/
public Map<String, String> getOrGenerateSubScopeCreds(
- @NotNull PolarisCredentialVendor credentialVendor,
- @NotNull PolarisCallContext callCtx,
- @NotNull PolarisEntity polarisEntity,
+ @Nonnull PolarisCredentialVendor credentialVendor,
+ @Nonnull PolarisCallContext callCtx,
+ @Nonnull PolarisEntity polarisEntity,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
if (!isTypeSupported(polarisEntity.getType())) {
callCtx
.getDiagServices()
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheKey.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheKey.java
index 912a01b3..48d83ef1 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheKey.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheKey.java
@@ -18,13 +18,13 @@
*/
package org.apache.polaris.core.storage.cache;
+import jakarta.annotation.Nullable;
import java.util.Objects;
import java.util.Set;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.context.CallContext;
import org.apache.polaris.core.entity.PolarisEntity;
import org.apache.polaris.core.entity.PolarisEntityConstants;
-import org.jetbrains.annotations.Nullable;
public class StorageCredentialCacheKey {
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/gcp/GcpCredentialsStorageIntegration.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/gcp/GcpCredentialsStorageIntegration.java
index 5e0d7e04..7d886e32 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/gcp/GcpCredentialsStorageIntegration.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/gcp/GcpCredentialsStorageIntegration.java
@@ -25,6 +25,8 @@ import com.google.auth.oauth2.AccessToken;
import com.google.auth.oauth2.CredentialAccessBoundary;
import com.google.auth.oauth2.DownscopedCredentials;
import com.google.auth.oauth2.GoogleCredentials;
+import com.google.common.annotations.VisibleForTesting;
+import jakarta.annotation.Nonnull;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
@@ -41,8 +43,6 @@ import org.apache.polaris.core.storage.InMemoryStorageIntegration;
import org.apache.polaris.core.storage.PolarisCredentialProperty;
import org.apache.polaris.core.storage.PolarisStorageIntegration;
import org.apache.polaris.core.storage.StorageUtil;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.VisibleForTesting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,11 +70,11 @@ public class GcpCredentialsStorageIntegration
@Override
public EnumMap<PolarisCredentialProperty, String> getSubscopedCreds(
- @NotNull PolarisDiagnostics diagnostics,
- @NotNull GcpStorageConfigurationInfo storageConfig,
+ @Nonnull PolarisDiagnostics diagnostics,
+ @Nonnull GcpStorageConfigurationInfo storageConfig,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
try {
sourceCredentials.refresh();
} catch (IOException e) {
@@ -127,8 +127,8 @@ public class GcpCredentialsStorageIntegration
@VisibleForTesting
public static CredentialAccessBoundary generateAccessBoundaryRules(
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
Map<String, List<String>> readConditionsMap = new HashMap<>();
Map<String, List<String>> writeConditionsMap = new HashMap<>();
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/gcp/GcpStorageConfigurationInfo.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/gcp/GcpStorageConfigurationInfo.java
index d57f6d39..7b0a9f6a 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/storage/gcp/GcpStorageConfigurationInfo.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/gcp/GcpStorageConfigurationInfo.java
@@ -22,10 +22,10 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.List;
import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
/** Gcp storage storage configuration information. */
public class GcpStorageConfigurationInfo extends PolarisStorageConfigurationInfo {
@@ -41,7 +41,7 @@ public class GcpStorageConfigurationInfo extends PolarisStorageConfigurationInfo
@JsonCreator
public GcpStorageConfigurationInfo(
- @JsonProperty(value = "allowedLocations", required = true) @NotNull
+ @JsonProperty(value = "allowedLocations", required = true) @Nonnull
List<String> allowedLocations) {
super(StorageType.GCS, allowedLocations);
validateMaxAllowedLocations(MAX_ALLOWED_LOCATIONS);
diff --git a/polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java b/polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java
index da4e4734..f05cd789 100644
--- a/polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java
+++ b/polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java
@@ -20,6 +20,8 @@ package org.apache.polaris.core.persistence;
import static org.apache.polaris.core.persistence.PrincipalSecretsGenerator.RANDOM_SECRETS;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
@@ -42,8 +44,6 @@ import org.apache.polaris.core.persistence.resolver.Resolver;
import org.apache.polaris.core.persistence.resolver.ResolverPath;
import org.apache.polaris.core.persistence.resolver.ResolverStatus;
import org.assertj.core.api.Assertions;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@@ -377,7 +377,7 @@ public class ResolverTest {
*
* @return new resolver to test with
*/
- @NotNull
+ @Nonnull
private Resolver allocateResolver() {
return this.allocateResolver(null, null);
}
@@ -389,7 +389,7 @@ public class ResolverTest {
* @param referenceCatalogName the reference e catalog name, can be null
* @return new resolver to test with
*/
- @NotNull
+ @Nonnull
private Resolver allocateResolver(@Nullable String referenceCatalogName) {
return this.allocateResolver(null, referenceCatalogName);
}
@@ -401,7 +401,7 @@ public class ResolverTest {
* @param cache if not null, cache to use, else one will be created
* @return new resolver to test with
*/
- @NotNull
+ @Nonnull
private Resolver allocateResolver(@Nullable EntityCache cache) {
return this.allocateResolver(cache, null);
}
@@ -414,7 +414,7 @@ public class ResolverTest {
* @param referenceCatalogName the reference e catalog name, can be null
* @return new resolver to test with
*/
- @NotNull
+ @Nonnull
private Resolver allocateResolver(
@Nullable EntityCache cache, @Nullable String referenceCatalogName) {
return this.allocateResolver(cache, null, referenceCatalogName);
@@ -429,7 +429,7 @@ public class ResolverTest {
* @param referenceCatalogName the reference e catalog name, can be null
* @return new resolver to test with
*/
- @NotNull
+ @Nonnull
private Resolver allocateResolver(
@Nullable EntityCache cache,
Set<String> principalRolesScope,
diff --git a/polaris-core/src/test/java/org/apache/polaris/core/storage/InMemoryStorageIntegrationTest.java b/polaris-core/src/test/java/org/apache/polaris/core/storage/InMemoryStorageIntegrationTest.java
index 14656e35..e51cf828 100644
--- a/polaris-core/src/test/java/org/apache/polaris/core/storage/InMemoryStorageIntegrationTest.java
+++ b/polaris-core/src/test/java/org/apache/polaris/core/storage/InMemoryStorageIntegrationTest.java
@@ -18,6 +18,8 @@
*/
package org.apache.polaris.core.storage;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.time.Clock;
import java.util.EnumMap;
import java.util.List;
@@ -30,8 +32,6 @@ import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.context.CallContext;
import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo;
import org.assertj.core.api.Assertions;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@@ -190,11 +190,11 @@ class InMemoryStorageIntegrationTest {
@Override
public EnumMap<PolarisCredentialProperty, String> getSubscopedCreds(
- @NotNull PolarisDiagnostics diagnostics,
- @NotNull PolarisStorageConfigurationInfo storageConfig,
+ @Nonnull PolarisDiagnostics diagnostics,
+ @Nonnull PolarisStorageConfigurationInfo storageConfig,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
return null;
}
}
diff --git a/polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java b/polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java
index 357ea2e3..5e276030 100644
--- a/polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java
+++ b/polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java
@@ -21,6 +21,7 @@ package org.apache.polaris.core.storage.cache;
import static org.apache.polaris.core.persistence.PrincipalSecretsGenerator.RANDOM_SECRETS;
import com.google.common.collect.ImmutableMap;
+import jakarta.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
@@ -46,7 +47,6 @@ import org.apache.polaris.core.persistence.PolarisTreeMapStore;
import org.apache.polaris.core.storage.PolarisCredentialProperty;
import org.apache.polaris.core.storage.PolarisCredentialVendor.ScopedCredentialsResult;
import org.assertj.core.api.Assertions;
-import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@@ -416,7 +416,7 @@ public class StorageCredentialCacheTest {
return res;
}
- @NotNull
+ @Nonnull
private static List<PolarisEntity> getPolarisEntities() {
PolarisEntity polarisEntity1 =
new PolarisEntity(
diff --git a/polaris-core/src/test/java/org/apache/polaris/service/storage/PolarisConfigurationStoreTest.java b/polaris-core/src/test/java/org/apache/polaris/service/storage/PolarisConfigurationStoreTest.java
index e6d1c8be..a0da2c5d 100644
--- a/polaris-core/src/test/java/org/apache/polaris/service/storage/PolarisConfigurationStoreTest.java
+++ b/polaris-core/src/test/java/org/apache/polaris/service/storage/PolarisConfigurationStoreTest.java
@@ -18,11 +18,11 @@
*/
package org.apache.polaris.service.storage;
+import jakarta.annotation.Nullable;
import java.util.List;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.PolarisConfiguration;
import org.apache.polaris.core.PolarisConfigurationStore;
-import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git a/polaris-core/src/test/java/org/apache/polaris/service/storage/aws/AwsCredentialsStorageIntegrationTest.java b/polaris-core/src/test/java/org/apache/polaris/service/storage/aws/AwsCredentialsStorageIntegrationTest.java
index a7527d18..5ee6adc9 100644
--- a/polaris-core/src/test/java/org/apache/polaris/service/storage/aws/AwsCredentialsStorageIntegrationTest.java
+++ b/polaris-core/src/test/java/org/apache/polaris/service/storage/aws/AwsCredentialsStorageIntegrationTest.java
@@ -20,6 +20,7 @@ package org.apache.polaris.service.storage.aws;
import static org.assertj.core.api.Assertions.assertThat;
+import jakarta.annotation.Nonnull;
import java.util.EnumMap;
import java.util.List;
import java.util.Set;
@@ -29,7 +30,6 @@ import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
import org.apache.polaris.core.storage.aws.AwsCredentialsStorageIntegration;
import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo;
import org.assertj.core.api.InstanceOfAssertFactories;
-import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@@ -470,7 +470,7 @@ class AwsCredentialsStorageIntegrationTest {
.containsEntry(PolarisCredentialProperty.AWS_SECRET_KEY, "secretKey");
}
- private static @NotNull String s3Arn(String partition, String bucket, String keyPrefix) {
+ private static @Nonnull String s3Arn(String partition, String bucket, String keyPrefix) {
String bucketArn = "arn:" + partition + ":s3:::" + bucket;
if (keyPrefix == null) {
return bucketArn;
@@ -478,7 +478,7 @@ class AwsCredentialsStorageIntegrationTest {
return bucketArn + "/" + keyPrefix + "/*";
}
- private static @NotNull String s3Path(String bucket, String keyPrefix) {
+ private static @Nonnull String s3Path(String bucket, String keyPrefix) {
return "s3://" + bucket + "/" + keyPrefix;
}
}
diff --git a/polaris-core/src/testFixtures/java/org/apache/polaris/core/persistence/PolarisTestMetaStoreManager.java b/polaris-core/src/testFixtures/java/org/apache/polaris/core/persistence/PolarisTestMetaStoreManager.java
index 53b0e840..11ee4a87 100644
--- a/polaris-core/src/testFixtures/java/org/apache/polaris/core/persistence/PolarisTestMetaStoreManager.java
+++ b/polaris-core/src/testFixtures/java/org/apache/polaris/core/persistence/PolarisTestMetaStoreManager.java
@@ -21,6 +21,7 @@ package org.apache.polaris.core.persistence;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
+import jakarta.annotation.Nonnull;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -44,7 +45,6 @@ import org.apache.polaris.core.entity.PolarisPrivilege;
import org.apache.polaris.core.entity.PolarisTaskConstants;
import org.apache.polaris.core.persistence.cache.PolarisRemoteCache.CachedEntryResult;
import org.assertj.core.api.Assertions;
-import org.jetbrains.annotations.NotNull;
/** Test the Polaris persistence layer */
public class PolarisTestMetaStoreManager {
@@ -1358,8 +1358,8 @@ public class PolarisTestMetaStoreManager {
private PolarisBaseEntity loadCacheEntryByName(
long entityCatalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull String entityName,
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull String entityName,
boolean expectExists) {
// load cached entry
CachedEntryResult cacheEntry =
@@ -1391,8 +1391,8 @@ public class PolarisTestMetaStoreManager {
private PolarisBaseEntity loadCacheEntryByName(
long entityCatalogId,
long parentId,
- @NotNull PolarisEntityType entityType,
- @NotNull String entityName) {
+ @Nonnull PolarisEntityType entityType,
+ @Nonnull String entityName) {
return this.loadCacheEntryByName(entityCatalogId, parentId, entityType, entityName, true);
}
@@ -1487,7 +1487,7 @@ public class PolarisTestMetaStoreManager {
private void refreshCacheEntry(
int entityVersion,
int entityGrantRecordsVersion,
- @NotNull PolarisEntityType entityType,
+ @Nonnull PolarisEntityType entityType,
long entityCatalogId,
long entityId) {
// refresh cached entry
diff --git a/polaris-service/build.gradle.kts b/polaris-service/build.gradle.kts
index bc7a4a4f..370a5bfc 100644
--- a/polaris-service/build.gradle.kts
+++ b/polaris-service/build.gradle.kts
@@ -69,7 +69,6 @@ dependencies {
implementation("io.micrometer:micrometer-registry-prometheus")
compileOnly(libs.swagger.annotations)
- compileOnly(libs.jetbrains.annotations)
compileOnly(libs.spotbugs.annotations)
implementation(libs.swagger.jaxrs)
implementation(libs.javax.annotation.api)
@@ -81,7 +80,7 @@ dependencies {
implementation(libs.logback.core)
implementation(libs.bouncycastle.bcprov)
- compileOnly(libs.jetbrains.annotations)
+ compileOnly(libs.jakarta.annotation.api)
compileOnly(libs.spotbugs.annotations)
implementation(platform(libs.google.cloud.storage.bom))
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/TimedApplicationEventListener.java b/polaris-service/src/main/java/org/apache/polaris/service/TimedApplicationEventListener.java
index deaa0bba..db319d3a 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/TimedApplicationEventListener.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/TimedApplicationEventListener.java
@@ -20,6 +20,7 @@ package org.apache.polaris.service;
import static org.apache.polaris.core.monitor.PolarisMetricRegistry.TAG_RESP_CODE;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Stopwatch;
import io.micrometer.core.instrument.Tag;
import java.lang.reflect.Method;
@@ -33,7 +34,6 @@ import org.glassfish.jersey.server.monitoring.ApplicationEvent;
import org.glassfish.jersey.server.monitoring.ApplicationEventListener;
import org.glassfish.jersey.server.monitoring.RequestEvent;
import org.glassfish.jersey.server.monitoring.RequestEventListener;
-import org.jetbrains.annotations.VisibleForTesting;
/**
* An ApplicationEventListener that supports timing and error counting of Jersey resource methods
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java b/polaris-service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java
index ba5113e9..a8046001 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java
@@ -18,6 +18,8 @@
*/
package org.apache.polaris.service.admin;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -83,8 +85,6 @@ import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
import org.apache.polaris.core.storage.StorageLocation;
import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo;
import org.apache.polaris.core.storage.azure.AzureStorageConfigurationInfo;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -598,7 +598,7 @@ public class PolarisAdminService {
}
}
- public @NotNull CatalogEntity getCatalog(String name) {
+ public @Nonnull CatalogEntity getCatalog(String name) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.GET_CATALOG;
authorizeBasicTopLevelEntityOperationOrThrow(op, name, PolarisEntityType.CATALOG);
@@ -658,7 +658,7 @@ public class PolarisAdminService {
}
}
- public @NotNull CatalogEntity updateCatalog(String name, UpdateCatalogRequest updateRequest) {
+ public @Nonnull CatalogEntity updateCatalog(String name, UpdateCatalogRequest updateRequest) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.UPDATE_CATALOG;
authorizeBasicTopLevelEntityOperationOrThrow(op, name, PolarisEntityType.CATALOG);
@@ -794,7 +794,7 @@ public class PolarisAdminService {
}
}
- public @NotNull PrincipalEntity getPrincipal(String name) {
+ public @Nonnull PrincipalEntity getPrincipal(String name) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.GET_PRINCIPAL;
authorizeBasicTopLevelEntityOperationOrThrow(op, name, PolarisEntityType.PRINCIPAL);
@@ -802,7 +802,7 @@ public class PolarisAdminService {
.orElseThrow(() -> new NotFoundException("Principal %s not found", name));
}
- public @NotNull PrincipalEntity updatePrincipal(
+ public @Nonnull PrincipalEntity updatePrincipal(
String name, UpdatePrincipalRequest updateRequest) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.UPDATE_PRINCIPAL;
authorizeBasicTopLevelEntityOperationOrThrow(op, name, PolarisEntityType.PRINCIPAL);
@@ -835,7 +835,7 @@ public class PolarisAdminService {
return returnedEntity;
}
- private @NotNull PrincipalWithCredentials rotateOrResetCredentialsHelper(
+ private @Nonnull PrincipalWithCredentials rotateOrResetCredentialsHelper(
String principalName, boolean shouldReset) {
PrincipalEntity currentPrincipalEntity =
findPrincipalByName(principalName)
@@ -874,14 +874,14 @@ public class PolarisAdminService {
newSecrets.getPrincipalClientId(), newSecrets.getMainSecret()));
}
- public @NotNull PrincipalWithCredentials rotateCredentials(String principalName) {
+ public @Nonnull PrincipalWithCredentials rotateCredentials(String principalName) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.ROTATE_CREDENTIALS;
authorizeBasicTopLevelEntityOperationOrThrow(op, principalName, PolarisEntityType.PRINCIPAL);
return rotateOrResetCredentialsHelper(principalName, false);
}
- public @NotNull PrincipalWithCredentials resetCredentials(String principalName) {
+ public @Nonnull PrincipalWithCredentials resetCredentials(String principalName) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.RESET_CREDENTIALS;
authorizeBasicTopLevelEntityOperationOrThrow(op, principalName, PolarisEntityType.PRINCIPAL);
@@ -956,7 +956,7 @@ public class PolarisAdminService {
}
}
- public @NotNull PrincipalRoleEntity getPrincipalRole(String name) {
+ public @Nonnull PrincipalRoleEntity getPrincipalRole(String name) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.GET_PRINCIPAL_ROLE;
authorizeBasicTopLevelEntityOperationOrThrow(op, name, PolarisEntityType.PRINCIPAL_ROLE);
@@ -964,7 +964,7 @@ public class PolarisAdminService {
.orElseThrow(() -> new NotFoundException("PrincipalRole %s not found", name));
}
- public @NotNull PrincipalRoleEntity updatePrincipalRole(
+ public @Nonnull PrincipalRoleEntity updatePrincipalRole(
String name, UpdatePrincipalRoleRequest updateRequest) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.UPDATE_PRINCIPAL_ROLE;
authorizeBasicTopLevelEntityOperationOrThrow(op, name, PolarisEntityType.PRINCIPAL_ROLE);
@@ -1077,7 +1077,7 @@ public class PolarisAdminService {
}
}
- public @NotNull CatalogRoleEntity getCatalogRole(String catalogName, String name) {
+ public @Nonnull CatalogRoleEntity getCatalogRole(String catalogName, String name) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.GET_CATALOG_ROLE;
authorizeBasicCatalogRoleOperationOrThrow(op, catalogName, name);
@@ -1085,7 +1085,7 @@ public class PolarisAdminService {
.orElseThrow(() -> new NotFoundException("CatalogRole %s not found", name));
}
- public @NotNull CatalogRoleEntity updateCatalogRole(
+ public @Nonnull CatalogRoleEntity updateCatalogRole(
String catalogName, String name, UpdateCatalogRoleRequest updateRequest) {
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.UPDATE_CATALOG_ROLE;
authorizeBasicCatalogRoleOperationOrThrow(op, catalogName, name);
@@ -1273,7 +1273,7 @@ public class PolarisAdminService {
* @return list of grantees or securables matching the filter
*/
private List<PolarisEntity> buildEntitiesFromGrantResults(
- @NotNull LoadGrantsResult grantList,
+ @Nonnull LoadGrantsResult grantList,
boolean grantees,
@Nullable Function<PolarisGrantRecord, Boolean> grantFilter) {
Map<Long, PolarisBaseEntity> granteeMap = grantList.getEntitiesAsMap();
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/auth/TokenBroker.java b/polaris-service/src/main/java/org/apache/polaris/service/auth/TokenBroker.java
index 16e27ec5..190a21e5 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/auth/TokenBroker.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/auth/TokenBroker.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.service.auth;
+import jakarta.annotation.Nonnull;
import java.util.Optional;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.auth.PolarisSecretsManager.PrincipalSecretsResult;
@@ -26,7 +27,6 @@ import org.apache.polaris.core.entity.PolarisEntityType;
import org.apache.polaris.core.entity.PrincipalEntity;
import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
import org.apache.polaris.service.types.TokenType;
-import org.jetbrains.annotations.NotNull;
/** Generic token class intended to be extended by different token types */
public interface TokenBroker {
@@ -43,7 +43,7 @@ public interface TokenBroker {
DecodedToken verify(String token);
- static @NotNull Optional<PrincipalEntity> findPrincipalEntity(
+ static @Nonnull Optional<PrincipalEntity> findPrincipalEntity(
PolarisMetaStoreManager metaStoreManager, String clientId, String clientSecret) {
// Validate the principal is present and secrets match
PolarisCallContext polarisCallContext = CallContext.getCurrentContext().getPolarisCallContext();
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java b/polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
index 92614665..19c05664 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
@@ -23,6 +23,7 @@ import com.google.common.base.Joiner;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
+import jakarta.annotation.Nonnull;
import java.io.Closeable;
import java.io.IOException;
import java.util.Arrays;
@@ -106,8 +107,6 @@ import org.apache.polaris.service.exception.IcebergExceptionMapper;
import org.apache.polaris.service.task.TaskExecutor;
import org.apache.polaris.service.types.NotificationRequest;
import org.apache.polaris.service.types.NotificationType;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.TestOnly;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.core.exception.SdkException;
@@ -212,7 +211,7 @@ public class BasePolarisCatalog extends BaseMetastoreViewCatalog
return catalogName;
}
- @TestOnly
+ @VisibleForTesting
FileIO getIo() {
return catalogFileIO;
}
@@ -554,7 +553,7 @@ public class BasePolarisCatalog extends BaseMetastoreViewCatalog
}
}
- private static @NotNull String resolveLocationForPath(List<PolarisEntity> parentPath) {
+ private static @Nonnull String resolveLocationForPath(List<PolarisEntity> parentPath) {
// always take the first object. If it has the base-location, stop there
AtomicBoolean foundBaseLocation = new AtomicBoolean(false);
return parentPath.reversed().stream()
@@ -850,7 +849,7 @@ public class BasePolarisCatalog extends BaseMetastoreViewCatalog
return specifiedTableLikeLocation;
}
- private @NotNull Optional<PolarisEntity> findStorageInfo(TableIdentifier tableIdentifier) {
+ private @Nonnull Optional<PolarisEntity> findStorageInfo(TableIdentifier tableIdentifier) {
PolarisResolvedPathWrapper resolvedTableEntities =
resolvedEntityView.getResolvedPath(tableIdentifier, PolarisEntitySubType.TABLE);
@@ -1427,7 +1426,7 @@ public class BasePolarisCatalog extends BaseMetastoreViewCatalog
}
}
- private static @NotNull Optional<PolarisEntity> findStorageInfoFromHierarchy(
+ private static @Nonnull Optional<PolarisEntity> findStorageInfoFromHierarchy(
PolarisResolvedPathWrapper resolvedStorageEntity) {
Optional<PolarisEntity> storageInfoEntity =
resolvedStorageEntity.getRawFullPath().reversed().stream()
@@ -1835,7 +1834,7 @@ public class BasePolarisCatalog extends BaseMetastoreViewCatalog
}
@SuppressWarnings("FormatStringAnnotation")
- private @NotNull PolarisMetaStoreManager.DropEntityResult dropTableLike(
+ private @Nonnull PolarisMetaStoreManager.DropEntityResult dropTableLike(
PolarisEntitySubType subType,
TableIdentifier identifier,
Map<String, String> storageProperties,
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/config/DefaultConfigurationStore.java b/polaris-service/src/main/java/org/apache/polaris/service/config/DefaultConfigurationStore.java
index 7f04bbd5..35a54a5f 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/config/DefaultConfigurationStore.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/config/DefaultConfigurationStore.java
@@ -18,12 +18,12 @@
*/
package org.apache.polaris.service.config;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.Map;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.PolarisConfigurationStore;
import org.apache.polaris.core.context.CallContext;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
public class DefaultConfigurationStore implements PolarisConfigurationStore {
private final Map<String, Object> config;
@@ -42,7 +42,7 @@ public class DefaultConfigurationStore implements PolarisConfigurationStore {
@SuppressWarnings("unchecked")
@Override
- public <T> @Nullable T getConfiguration(@NotNull PolarisCallContext ctx, String configName) {
+ public <T> @Nullable T getConfiguration(@Nonnull PolarisCallContext ctx, String configName) {
String realm = CallContext.getCurrentContext().getRealmContext().getRealmIdentifier();
return (T)
realmConfig.getOrDefault(realm, Map.of()).getOrDefault(configName, config.get(configName));
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/exception/IcebergExceptionMapper.java b/polaris-service/src/main/java/org/apache/polaris/service/exception/IcebergExceptionMapper.java
index 6be8d9f4..e0c3523e 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/exception/IcebergExceptionMapper.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/exception/IcebergExceptionMapper.java
@@ -20,6 +20,7 @@ package org.apache.polaris.service.exception;
import com.azure.core.exception.AzureException;
import com.google.cloud.storage.StorageException;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSet;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.MediaType;
@@ -51,7 +52,6 @@ import org.apache.iceberg.exceptions.ServiceUnavailableException;
import org.apache.iceberg.exceptions.UnprocessableEntityException;
import org.apache.iceberg.exceptions.ValidationException;
import org.apache.iceberg.rest.responses.ErrorResponse;
-import org.jetbrains.annotations.VisibleForTesting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.services.s3.model.S3Exception;
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java b/polaris-service/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
index 2fa0d4e9..8f1f146e 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
@@ -19,6 +19,7 @@
package org.apache.polaris.service.persistence;
import com.fasterxml.jackson.annotation.JsonTypeName;
+import jakarta.annotation.Nonnull;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
@@ -32,7 +33,6 @@ import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
import org.apache.polaris.core.persistence.PolarisMetaStoreSession;
import org.apache.polaris.core.persistence.PolarisTreeMapMetaStoreSessionImpl;
import org.apache.polaris.core.persistence.PolarisTreeMapStore;
-import org.jetbrains.annotations.NotNull;
@JsonTypeName("in-memory")
public class InMemoryPolarisMetaStoreManagerFactory
@@ -40,13 +40,13 @@ public class InMemoryPolarisMetaStoreManagerFactory
final Set<String> bootstrappedRealms = new HashSet<>();
@Override
- protected PolarisTreeMapStore createBackingStore(@NotNull PolarisDiagnostics diagnostics) {
+ protected PolarisTreeMapStore createBackingStore(@Nonnull PolarisDiagnostics diagnostics) {
return new PolarisTreeMapStore(diagnostics);
}
@Override
protected PolarisMetaStoreSession createMetaStoreSession(
- @NotNull PolarisTreeMapStore store, @NotNull RealmContext realmContext) {
+ @Nonnull PolarisTreeMapStore store, @Nonnull RealmContext realmContext) {
return new PolarisTreeMapMetaStoreSessionImpl(
store, storageIntegration, secretsGenerator(realmContext));
}
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/ratelimiter/RealmTokenBucketRateLimiter.java b/polaris-service/src/main/java/org/apache/polaris/service/ratelimiter/RealmTokenBucketRateLimiter.java
index bc45153f..f3973fef 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/ratelimiter/RealmTokenBucketRateLimiter.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/ratelimiter/RealmTokenBucketRateLimiter.java
@@ -21,13 +21,13 @@ package org.apache.polaris.service.ratelimiter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.google.common.annotations.VisibleForTesting;
import java.time.Clock;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.polaris.core.context.CallContext;
import org.apache.polaris.core.context.RealmContext;
-import org.jetbrains.annotations.VisibleForTesting;
/**
* Rate limiter that maps the request's realm identifier to its own TokenBucketRateLimiter, with its
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java b/polaris-service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java
index b3252a29..fad2e42d 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java
@@ -22,6 +22,8 @@ import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.auth.http.HttpTransportFactory;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.ServiceOptions;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.util.EnumMap;
import java.util.Map;
import java.util.Set;
@@ -35,8 +37,6 @@ import org.apache.polaris.core.storage.PolarisStorageIntegrationProvider;
import org.apache.polaris.core.storage.aws.AwsCredentialsStorageIntegration;
import org.apache.polaris.core.storage.azure.AzureCredentialsStorageIntegration;
import org.apache.polaris.core.storage.gcp.GcpCredentialsStorageIntegration;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import software.amazon.awssdk.services.sts.StsClient;
public class PolarisStorageIntegrationProviderImpl implements PolarisStorageIntegrationProvider {
@@ -82,20 +82,20 @@ public class PolarisStorageIntegrationProviderImpl implements PolarisStorageInte
new PolarisStorageIntegration<>("file") {
@Override
public EnumMap<PolarisCredentialProperty, String> getSubscopedCreds(
- @NotNull PolarisDiagnostics diagnostics,
- @NotNull T storageConfig,
+ @Nonnull PolarisDiagnostics diagnostics,
+ @Nonnull T storageConfig,
boolean allowListOperation,
- @NotNull Set<String> allowedReadLocations,
- @NotNull Set<String> allowedWriteLocations) {
+ @Nonnull Set<String> allowedReadLocations,
+ @Nonnull Set<String> allowedWriteLocations) {
return new EnumMap<>(PolarisCredentialProperty.class);
}
@Override
- public @NotNull Map<String, Map<PolarisStorageActions, ValidationResult>>
+ public @Nonnull Map<String, Map<PolarisStorageActions, ValidationResult>>
validateAccessToLocations(
- @NotNull T storageConfig,
- @NotNull Set<PolarisStorageActions> actions,
- @NotNull Set<String> locations) {
+ @Nonnull T storageConfig,
+ @Nonnull Set<PolarisStorageActions> actions,
+ @Nonnull Set<String> locations) {
return Map.of();
}
};
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java b/polaris-service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java
index e3a227f4..920e5e21 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.service.task;
+import jakarta.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -32,7 +33,6 @@ import org.apache.polaris.core.entity.PolarisEntityType;
import org.apache.polaris.core.entity.TaskEntity;
import org.apache.polaris.core.persistence.MetaStoreManagerFactory;
import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
-import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -72,7 +72,7 @@ public class TaskExecutorImpl implements TaskExecutor {
tryHandleTask(taskEntityId, clone, null, 1);
}
- private @NotNull CompletableFuture<Void> tryHandleTask(
+ private @Nonnull CompletableFuture<Void> tryHandleTask(
long taskEntityId, CallContext clone, Throwable e, int attempt) {
if (attempt > 3) {
return CompletableFuture.failedFuture(e);
diff --git a/polaris-service/src/main/java/org/apache/polaris/service/tracing/HeadersMapAccessor.java b/polaris-service/src/main/java/org/apache/polaris/service/tracing/HeadersMapAccessor.java
index 44f52ffb..7c73aea8 100644
--- a/polaris-service/src/main/java/org/apache/polaris/service/tracing/HeadersMapAccessor.java
+++ b/polaris-service/src/main/java/org/apache/polaris/service/tracing/HeadersMapAccessor.java
@@ -20,12 +20,12 @@ package org.apache.polaris.service.tracing;
import io.opentelemetry.context.propagation.TextMapGetter;
import io.opentelemetry.context.propagation.TextMapSetter;
+import jakarta.annotation.Nullable;
import jakarta.servlet.http.HttpServletRequest;
import java.net.http.HttpRequest;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.stream.StreamSupport;
-import org.jetbrains.annotations.Nullable;
/**
* Implementation of {@link TextMapSetter} and {@link TextMapGetter} that can handle an {@link
diff --git a/polaris-service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java b/polaris-service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java
index 57548cec..ce28d4b5 100644
--- a/polaris-service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java
+++ b/polaris-service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java
@@ -23,6 +23,8 @@ import static org.apache.iceberg.types.Types.NestedField.required;
import com.google.auth.oauth2.AccessToken;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.common.collect.ImmutableMap;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
import java.io.IOException;
import java.time.Clock;
import java.util.Date;
@@ -73,8 +75,6 @@ import org.apache.polaris.service.context.PolarisCallContextCatalogFactory;
import org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory;
import org.apache.polaris.service.storage.PolarisStorageIntegrationProviderImpl;
import org.assertj.core.api.Assertions;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.mockito.Mockito;
@@ -301,7 +301,7 @@ public abstract class PolarisAuthzTestBase {
}
}
- protected @NotNull PrincipalEntity rotateAndRefreshPrincipal(
+ protected @Nonnull PrincipalEntity rotateAndRefreshPrincipal(
PolarisMetaStoreManager metaStoreManager,
String principalName,
PrincipalWithCredentialsCredentials credentials,
diff --git a/polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogTest.java b/polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogTest.java
index 7b0270c4..704c7a4e 100644
--- a/polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogTest.java
+++ b/polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogTest.java
@@ -25,6 +25,7 @@ import static org.mockito.Mockito.when;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterators;
+import jakarta.annotation.Nullable;
import java.io.IOException;
import java.time.Clock;
import java.util.Arrays;
@@ -100,7 +101,6 @@ import org.apache.polaris.service.types.NotificationType;
import org.apache.polaris.service.types.TableUpdateNotification;
import org.assertj.core.api.AbstractBooleanAssert;
import org.assertj.core.api.Assertions;
-import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeEach;
diff --git a/polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogViewTest.java b/polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogViewTest.java
index 252cd16f..6385cd94 100644
--- a/polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogViewTest.java
+++ b/polaris-service/src/test/java/org/apache/polaris/service/catalog/BasePolarisCatalogViewTest.java
@@ -21,6 +21,7 @@ package org.apache.polaris.service.catalog;
import com.google.auth.oauth2.AccessToken;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.common.collect.ImmutableMap;
+import jakarta.annotation.Nullable;
import java.time.Clock;
import java.util.Date;
import java.util.HashMap;
@@ -53,7 +54,6 @@ import org.apache.polaris.service.admin.PolarisAdminService;
import org.apache.polaris.service.catalog.io.DefaultFileIOFactory;
import org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory;
import org.apache.polaris.service.storage.PolarisStorageIntegrationProviderImpl;
-import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.BeforeEach;
import org.mockito.Mockito;
diff --git a/polaris-service/src/test/java/org/apache/polaris/service/task/TaskTestUtils.java b/polaris-service/src/test/java/org/apache/polaris/service/task/TaskTestUtils.java
index 1e5612e2..818f8765 100644
--- a/polaris-service/src/test/java/org/apache/polaris/service/task/TaskTestUtils.java
+++ b/polaris-service/src/test/java/org/apache/polaris/service/task/TaskTestUtils.java
@@ -18,6 +18,7 @@
*/
package org.apache.polaris.service.task;
+import jakarta.annotation.Nonnull;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
@@ -40,7 +41,6 @@ import org.apache.iceberg.io.FileAppender;
import org.apache.iceberg.io.FileIO;
import org.apache.iceberg.io.PositionOutputStream;
import org.apache.iceberg.types.Types;
-import org.jetbrains.annotations.NotNull;
public class TaskTestUtils {
static ManifestFile manifestFile(
@@ -83,7 +83,7 @@ public class TaskTestUtils {
out.close();
}
- static @NotNull TestSnapshot newSnapshot(
+ static @Nonnull TestSnapshot newSnapshot(
FileIO fileIO,
String manifestListLocation,
long sequenceNumber,
diff --git a/polaris-service/src/test/java/org/apache/polaris/service/test/DropwizardTestEnvironmentResolver.java b/polaris-service/src/test/java/org/apache/polaris/service/test/DropwizardTestEnvironmentResolver.java
index 4aa65974..b979e9c0 100644
--- a/polaris-service/src/test/java/org/apache/polaris/service/test/DropwizardTestEnvironmentResolver.java
+++ b/polaris-service/src/test/java/org/apache/polaris/service/test/DropwizardTestEnvironmentResolver.java
@@ -19,12 +19,12 @@
package org.apache.polaris.service.test;
import io.dropwizard.testing.junit5.DropwizardAppExtension;
+import jakarta.annotation.Nullable;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.Optional;
import org.apache.polaris.core.entity.PolarisGrantRecord;
-import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.platform.commons.util.ReflectionUtils;
diff --git a/server-templates/api.mustache b/server-templates/api.mustache
index 08821fbf..bf16d0f3 100644
--- a/server-templates/api.mustache
+++ b/server-templates/api.mustache
@@ -29,6 +29,7 @@ import java.util.List;
import java.io.InputStream;
+import jakarta.annotation.Nonnull;
import jakarta.annotation.security.RolesAllowed;
import {{javaxPackage}}.ws.rs.Consumes;
diff --git a/server-templates/bodyParams.mustache b/server-templates/bodyParams.mustache
index 3edb32c2..9958d1e5 100644
--- a/server-templates/bodyParams.mustache
+++ b/server-templates/bodyParams.mustache
@@ -19,4 +19,4 @@ under the License.
Note that this template is copied from https://github.com/OpenAPITools/openapi-generator/blob/783e68c7acbbdcbb2282d167d1644b069f12d486/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache
It is here to remove some unsupported swagger annotations
-}}{{#isBodyParam}}{{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}}
\ No newline at end of file
+}}{{#isBodyParam}}{{#useBeanValidation}}{{#required}} @Nonnull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}}
\ No newline at end of file