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 2021/06/24 23:27:13 UTC

[GitHub] [helix] huizhilu commented on a change in pull request #1803: Add message generation logic for management pipeline

huizhilu commented on a change in pull request #1803:
URL: https://github.com/apache/helix/pull/1803#discussion_r658311558



##########
File path: helix-core/src/main/java/org/apache/helix/api/status/ClusterManagementMode.java
##########
@@ -67,4 +67,8 @@ public Status getStatus() {
     public Type getMode() {
         return mode;
     }
+
+    public boolean isFullyInNormalMode() {
+        return Type.NORMAL.equals(mode) && Status.COMPLETED.equals(status);

Review comment:
       I'll leave it with the final naming refactoring such as `cluster_pause` -> `cluster_freeze` mode, which won't need any review. Tracking: https://github.com/apache/helix/issues/1805

##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -647,9 +650,16 @@ private static PipelineRegistry createManagementModeRegistry(String pipelineName
       Pipeline dataRefresh = new Pipeline(pipelineName);
       dataRefresh.addStage(new ReadClusterDataStage());
 
+      // data pre-process pipeline
+      Pipeline dataPreprocess = new Pipeline(pipelineName);
+      dataPreprocess.addStage(new ResourceComputationStage());

Review comment:
       No. ResourceValidation is to match the ideal state rules, which is not required management pipeline. We can assume in management pipeline, the ideal states are validated since management pipeline is switched from default pipeline.
   The pipeline switch logic from default to management is ResourceValidation. To avoid handling it in management pipeline and make the logic simple, I don't want to add ResourceValidation.

##########
File path: helix-core/src/main/java/org/apache/helix/controller/stages/ManagementMessageDispatchStage.java
##########
@@ -0,0 +1,62 @@
+package org.apache.helix.controller.stages;
+
+/*
+ * 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.List;
+
+import org.apache.helix.HelixManager;
+import org.apache.helix.api.status.ClusterManagementMode;
+import org.apache.helix.controller.LogUtil;
+import org.apache.helix.controller.dataproviders.ManagementControllerDataProvider;
+import org.apache.helix.model.Message;
+import org.apache.helix.util.RebalanceUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Dispatches participant status change and pending state transition cancellation messages
+ * for the management pipeline.
+ */
+public class ManagementMessageDispatchStage extends MessageDispatchStage {
+  private static final Logger LOG = LoggerFactory.getLogger(ManagementMessageDispatchStage.class);
+
+  @Override
+  public void process(ClusterEvent event) throws Exception {
+    MessageOutput messageOutput =
+        event.getAttribute(AttributeName.MESSAGES_ALL.name());
+    processEvent(event, messageOutput);
+
+    // Send participant status change messages.

Review comment:
       It's sent by `super.sendMessages(manager.getHelixDataAccessor(), messageOutput.getStatusChangeMessages());`
   Synced offline. Resolved.




-- 
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.

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