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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
* Polaris metadata from/to the configured database systems.
*/
public class PolarisEclipseLinkMetaStoreSessionImpl implements PolarisMetaStoreSession {
private static final Logger LOG =
private static final Logger LOGGER =
LoggerFactory.getLogger(PolarisEclipseLinkMetaStoreSessionImpl.class);

// Cache to hold the EntityManagerFactory for each realm. Each realm needs a separate
Expand All @@ -108,7 +108,7 @@ public PolarisEclipseLinkMetaStoreSessionImpl(
@NotNull RealmContext realmContext,
@Nullable String confFile,
@Nullable String persistenceUnitName) {
LOG.debug("Create EclipseLink Meta Store Session for {}", realmContext.getRealmIdentifier());
LOGGER.debug("Create EclipseLink Meta Store Session for {}", realmContext.getRealmIdentifier());
emf = createEntityManagerFactory(realmContext, confFile, persistenceUnitName);

// init store
Expand Down Expand Up @@ -215,7 +215,7 @@ private Map<String, String> loadProperties(
String.format(
"Cannot find or parse the configuration file %s for persistence-unit %s",
confFile, persistenceUnitName);
LOG.error(str, e);
LOGGEr.error(str, e);
throw new IOException(str);
}
}
Expand All @@ -237,13 +237,13 @@ public <T> T runInTransaction(
// Commit when it's not rolled back by the client
if (session.getTransaction().isActive()) {
tr.commit();
LOG.debug("transaction committed");
LOGGER.debug("transaction committed");
}

return result;
} catch (Exception e) {
tr.rollback();
LOG.debug("transaction rolled back: {}", e);
LOGGER.debug("transaction rolled back: {}", e);

if (e instanceof OptimisticLockException
|| e.getCause() instanceof OptimisticLockException) {
Expand Down Expand Up @@ -274,11 +274,11 @@ public void runActionInTransaction(
// Commit when it's not rolled back by the client
if (session.getTransaction().isActive()) {
tr.commit();
LOG.debug("transaction committed");
LOGGER.debug("transaction committed");
}
} catch (Exception e) {
tr.rollback();
LOG.debug("transaction rolled back");
LOGGER.debug("transaction rolled back");

if (e instanceof OptimisticLockException
|| e.getCause() instanceof OptimisticLockException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* with EclipseLink support
*/
public class PolarisEclipseLinkStore {
private static final Logger LOG = LoggerFactory.getLogger(PolarisEclipseLinkStore.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisEclipseLinkStore.class);

// diagnostic services
private final PolarisDiagnostics diagnosticServices;
Expand Down Expand Up @@ -195,7 +195,7 @@ void deleteAll(EntityManager session) {
session.createQuery("DELETE from ModelGrantRecord").executeUpdate();
session.createQuery("DELETE from ModelPrincipalSecrets").executeUpdate();

LOG.debug("All entities deleted.");
LOGGER.debug("All entities deleted.");
}

ModelEntity lookupEntity(EntityManager session, long catalogId, long entityId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
* which translates into a cross-catalog permission.
*/
public class PolarisAuthorizer {
private static final Logger LOG = LoggerFactory.getLogger(PolarisAuthorizer.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisAuthorizer.class);

private static final SetMultimap<PolarisPrivilege, PolarisPrivilege> SUPER_PRIVILEGES =
HashMultimap.create();
Expand Down Expand Up @@ -605,7 +605,7 @@ public boolean hasTransitivePrivilege(
desiredPrivilege, PolarisPrivilege.fromCode(grantRecord.getPrivilegeCode()))) {
// Found a potential candidate for satisfying our authz goal.
if (activatedGranteeIds.contains(grantRecord.getGranteeId())) {
LOG.debug(
LOGGER.debug(
"Satisfied privilege {} with grantRecord {} from securable {} for "
+ "principalName {} and activatedIds {}",
desiredPrivilege,
Expand All @@ -619,7 +619,7 @@ public boolean hasTransitivePrivilege(
}
}

LOG.debug(
LOGGER.debug(
"Failed to satisfy privilege {} for principalName {} on resolvedPath {}",
desiredPrivilege,
authenticatedPolarisPrincipal.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* different Polaris components.
*/
public class PolarisCatalogHelpers {
private static final Logger LOG = LoggerFactory.getLogger(PolarisCatalogHelpers.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisCatalogHelpers.class);

/** Not intended for instantiation. */
private PolarisCatalogHelpers() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* Catalog} model to the persistent entity model.
*/
public class CatalogEntity extends PolarisEntity {
private static final Logger LOG = LoggerFactory.getLogger(CatalogEntity.class);
private static final Logger LOGGER = LoggerFactory.getLogger(CatalogEntity.class);

public static final long ROOT_CATALOG_ID = 0;
public static final String CATALOG_TYPE_PROPERTY = "catalogType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract class LocalPolarisMetaStoreManagerFactory<StoreType>

protected PolarisStorageIntegrationProvider storageIntegration;

private final Logger logger =
private final Logger LOGGER =
org.slf4j.LoggerFactory.getLogger(LocalPolarisMetaStoreManagerFactory.class);

protected abstract StoreType createBackingStore(@NotNull PolarisDiagnostics diagnostics);
Expand Down Expand Up @@ -197,7 +197,7 @@ private void checkPolarisServiceBootstrappedForRealm(
PolarisEntityConstants.getRootPrincipalName());

if (!rootPrincipalLookup.isSuccess()) {
logger.error(
LOGGER.error(
"\n\n Realm {} is not bootstrapped, could not load root principal. Please run Bootstrap command. \n\n",
realmContext.getRealmIdentifier());
throw new IllegalStateException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* id and name resolution mechanics around PolarisEntities.
*/
public class PolarisEntityManager {
private static final Logger LOG = LoggerFactory.getLogger(PolarisEntityManager.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisEntityManager.class);

private final PolarisMetaStoreManager metaStoreManager;
private final Supplier<PolarisMetaStoreSession> sessionSupplier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* function as a lookup manifest for downstream callers.
*/
public class PolarisResolutionManifest implements PolarisResolutionManifestCatalogView {
private static final Logger LOG = LoggerFactory.getLogger(PolarisResolutionManifest.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisResolutionManifest.class);

private final PolarisEntityManager entityManager;
private final CallContext callContext;
Expand Down Expand Up @@ -195,14 +195,14 @@ public PolarisResolvedPathWrapper getPassthroughResolvedPath(Object key) {
ResolverStatus status = passthroughResolver.resolveAll();

if (status.getStatus() != ResolverStatus.StatusEnum.SUCCESS) {
LOG.debug("Returning null for key {} due to resolver status {}", key, status.getStatus());
LOGGER.debug("Returning null for key {} due to resolver status {}", key, status.getStatus());
return null;
}

List<EntityCacheEntry> resolvedPath = passthroughResolver.getResolvedPath();
if (requestedPath.isOptional()) {
if (resolvedPath.size() != requestedPath.getEntityNames().size()) {
LOG.debug(
LOGGER.debug(
"Returning null for key {} due to size mismatch from getPassthroughResolvedPath "
+ "resolvedPath: {}, requestedPath.getEntityNames(): {}",
key,
Expand All @@ -216,7 +216,8 @@ public PolarisResolvedPathWrapper getPassthroughResolvedPath(Object key) {
resolvedEntities.add(
new ResolvedPolarisEntity(passthroughResolver.getResolvedReferenceCatalog()));
resolvedPath.forEach(cacheEntry -> resolvedEntities.add(new ResolvedPolarisEntity(cacheEntry)));
LOG.debug("Returning resolvedEntities from getPassthroughResolvedPath: {}", resolvedEntities);
LOGGER.debug(
"Returning resolvedEntities from getPassthroughResolvedPath: {}", resolvedEntities);
return new PolarisResolvedPathWrapper(resolvedEntities);
}

Expand Down Expand Up @@ -276,7 +277,7 @@ private ResolvedPolarisEntity getResolvedRootContainerEntity() {
primaryResolver.getResolvedEntity(
PolarisEntityType.ROOT, PolarisEntityConstants.getRootContainerName());
if (resolvedCacheEntry == null) {
LOG.debug("Failed to find rootContainer, so using simulated rootContainer instead.");
LOGGER.debug("Failed to find rootContainer, so using simulated rootContainer instead.");
return simulatedResolvedRootContainerEntity;
}
return new ResolvedPolarisEntity(resolvedCacheEntry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

public class AzureCredentialStorageIntegrationTest {

private final Logger LOGGER =
private static final Logger LOGGER =
LoggerFactory.getLogger(AzureCredentialStorageIntegrationTest.class);

private final String clientId = System.getenv("AZURE_CLIENT_ID");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
import org.slf4j.LoggerFactory;

public class IcebergExceptionMapper implements ExceptionMapper<RuntimeException> {
private static final Logger LOG = LoggerFactory.getLogger(IcebergExceptionMapper.class);
private static final Logger LOGGER = LoggerFactory.getLogger(IcebergExceptionMapper.class);

public IcebergExceptionMapper() {}

@Override
public Response toResponse(RuntimeException runtimeException) {
LOG.info("Handling runtimeException {}", runtimeException.getMessage());
LOGGER.info("Handling runtimeException {}", runtimeException.getMessage());
int responseCode =
switch (runtimeException) {
case NoSuchNamespaceException e -> Response.Status.NOT_FOUND.getStatusCode();
Expand Down Expand Up @@ -80,7 +80,7 @@ public Response toResponse(RuntimeException runtimeException) {
default -> Response.Status.INTERNAL_SERVER_ERROR.getStatusCode();
};
if (responseCode == Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()) {
LOG.error("Unhandled exception returning INTERNAL_SERVER_ERROR", runtimeException);
LOGGER.error("Unhandled exception returning INTERNAL_SERVER_ERROR", runtimeException);
}

ErrorResponse icebergErrorResponse =
Expand All @@ -94,7 +94,7 @@ public Response toResponse(RuntimeException runtimeException) {
.entity(icebergErrorResponse)
.type(MediaType.APPLICATION_JSON_TYPE)
.build();
LOG.debug("Mapped exception to errorResp: {}", errorResp);
LOGGER.debug("Mapped exception to errorResp: {}", errorResp);
return errorResp;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
* the persistence layer.
*/
public class PolarisAdminService {
private static final Logger LOG = LoggerFactory.getLogger(PolarisAdminService.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisAdminService.class);
public static final String CLEANUP_ON_CATALOG_DROP = "CLEANUP_ON_CATALOG_DROP";

private final CallContext callContext;
Expand Down Expand Up @@ -187,7 +187,8 @@ private void authorizeBasicTopLevelEntityOperationOrThrow(
== authenticatedPrincipal.getPrincipalEntity().getId()
&& (op.equals(PolarisAuthorizableOperation.ROTATE_CREDENTIALS)
|| op.equals(PolarisAuthorizableOperation.RESET_CREDENTIALS))) {
LOG.atDebug()
LOGGER
.atDebug()
.addKeyValue("principalName", topLevelEntityName)
.log("Allowing rotate own credentials");
return;
Expand Down
Loading