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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
import org.apache.polaris.service.context.RealmContextResolver;
import org.apache.polaris.service.context.TestRealmContextResolver;
import org.apache.polaris.service.credentials.connection.AuthType;
import org.apache.polaris.service.events.listeners.PolarisEventListener;
import org.apache.polaris.service.events.listeners.TestPolarisEventListener;
import org.apache.polaris.service.metrics.MetricsConfiguration;
import org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory;
import org.eclipse.microprofile.config.Config;
Expand Down Expand Up @@ -222,18 +220,6 @@ public ProductionReadinessCheck checkRealmResolver(Config config, RealmContextRe
return ProductionReadinessCheck.OK;
}

@Produces
public ProductionReadinessCheck checkPolarisEventListener(
PolarisEventListener polarisEventListener) {
if (polarisEventListener instanceof TestPolarisEventListener) {
return ProductionReadinessCheck.of(
Error.of(
"TestPolarisEventListener is intended for tests only.",
"polaris.event-listener.type"));
}
return ProductionReadinessCheck.OK;
}
Comment on lines -225 to -235
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this production readiness check not honoured any more ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary anymore since the class has been moved to a test folder and hence is not present anymore in Polaris production code. IOW: you cannot select this listener anymore when deploying Polaris, only when testing it.


private static String authRealmSegment(String realm) {
return realm.equals(AuthenticationConfiguration.DEFAULT_REALM_KEY) ? "" : realm + ".";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.polaris.service.events.listeners;

import io.smallrye.common.annotation.Identifier;
import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
@Identifier("test")
public class QuarkusTestPolarisEventListener extends TestPolarisEventListener {}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
package org.apache.polaris.service.events.listeners;

import io.smallrye.common.annotation.Identifier;
import jakarta.enterprise.context.ApplicationScoped;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.polaris.service.events.AfterAttemptTaskEvent;
Expand All @@ -33,9 +31,7 @@
import org.apache.polaris.service.events.PrincipalRolesServiceEvents;
import org.apache.polaris.service.events.PrincipalsServiceEvents;

/** Event listener that stores all emitted events forever. Not recommended for use in production. */
@ApplicationScoped
@Identifier("test")
/** Test event listener that stores all emitted events forever. */
public class TestPolarisEventListener implements PolarisEventListener {
private final Map<Class<? extends PolarisEvent>, PolarisEvent> latestEvents =
new ConcurrentHashMap<>();
Expand Down