You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/03/09 17:48:50 UTC

[GitHub] [helix] mgao0 commented on a change in pull request #1976: Add event handler and event listener interface

mgao0 commented on a change in pull request #1976:
URL: https://github.com/apache/helix/pull/1976#discussion_r822922633



##########
File path: helix-core/src/main/java/org/apache/helix/cloud/event/CloudEventHandler.java
##########
@@ -0,0 +1,92 @@
+package org.apache.helix.cloud.event;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CloudEventHandler {
+  private static final Logger LOG = LoggerFactory.getLogger(CloudEventHandler.class.getName());
+  @VisibleForTesting
+  protected List<CloudEventListener> _eventListeners = new ArrayList<>();
+  private PreEventHandlerCallback _preEventHandlerCallback = null;
+  private PostEventHandlerCallback _postEventHandlerCallback = null;

Review comment:
       Sorry for the confusion. This is for user to hook, they can implement them and register them to the event handler.
   I think you are talking about the pre- and post- **callback** inside each listener. 
   These two are different - conceptually they will be the first and the last **event listener** to be triggered in an event.
   If it's not that clear maybe we can rename these two interfaces?




-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org