qqu0127 commented on code in PR #2149:
URL: https://github.com/apache/helix/pull/2149#discussion_r898439037
##########
helix-core/src/main/java/org/apache/helix/cloud/event/helix/DefaultCloudEventCallbackImpl.java:
##########
@@ -19,51 +19,109 @@
* under the License.
*/
+import java.util.List;
+import java.util.Map;
+
+import org.apache.helix.HelixDataAccessor;
import org.apache.helix.HelixManager;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+import org.apache.helix.constants.InstanceConstants;
+import org.apache.helix.model.ClusterConfig;
+import org.apache.helix.util.ConfigStringUtil;
+import org.apache.helix.util.InstanceValidationUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* A default callback implementation class to be used in {@link
HelixCloudEventListener}
*/
public class DefaultCloudEventCallbackImpl {
+ private static final Logger LOG =
LoggerFactory.getLogger(DefaultCloudEventCallbackImpl.class);
+ private final String _instanceReason = "Cloud event in
DefaultCloudEventCallback at %s";
+ private final String _emmReason = "Cloud event EMM in
DefaultCloudEventCallback by %s at %s";
/**
- * Disable the instance
+ * Disable the instance and track the cloud event in map field
disabledInstancesWithInfo in
+ * cluster config. Will not re-disable the instance if the instance is
already disabled for
+ * other reason. (So we will not overwrite the disabled reason and enable
this instance when
+ * on-unpause)
* @param manager The helix manager associated with the listener
* @param eventInfo Detailed information about the event
*/
public void disableInstance(HelixManager manager, Object eventInfo) {
- // To be implemented
- throw new NotImplementedException();
+ String message = String.format(_instanceReason,
System.currentTimeMillis());
Review Comment:
Sure, not a big deal so feel free to drop it.
But just to clarify my concern, it's not on space save but for future
change, e.g. if we add another field in the string template, we need to modify
two `String.format`, which is more prone to error.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]