dimas-b commented on code in PR #4064:
URL: https://github.com/apache/polaris/pull/4064#discussion_r3074522305
##########
runtime/service/src/main/java/org/apache/polaris/service/events/PolarisEventListeners.java:
##########
@@ -31,23 +31,68 @@
import jakarta.enterprise.inject.Any;
import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;
+import java.util.BitSet;
+import java.util.EnumSet;
import java.util.HashSet;
-import java.util.Set;
import org.apache.polaris.service.events.listeners.PolarisEventListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@ApplicationScoped
public class PolarisEventListeners {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(PolarisEventListeners.class);
+
@Inject EventBus eventBus;
@Inject @Any Instance<PolarisEventListener> eventListeners;
@Inject PolarisEventListenerConfiguration configuration;
+ private final BitSet eventsByType = new
BitSet(PolarisEventType.values().length);
+
public void onStartup(@Observes StartupEvent event) {
- Set<String> listenerTypeSet =
configuration.types().orElseGet(HashSet::new);
+ var listenerTypeSet = configuration.types().orElseGet(HashSet::new);
for (String enabledEventListener : listenerTypeSet) {
- PolarisEventListener listener =
-
eventListeners.select(Identifier.Literal.of(enabledEventListener)).get();
- Handler<Message<PolarisEvent>> handler = e -> listener.onEvent(e.body());
- eventBus.localConsumer(POLARIS_EVENT_CHANNEL, handler);
+ var listenerConfiguration =
configuration.listenerConfig().get(enabledEventListener);
+ var supportedTypes =
+ listenerConfiguration == null
Review Comment:
@adnanhemani : Do you mean we should ask the listener for the set of event
types it needs to process?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]