diff --git a/helix-gateway/src/main/java/org/apache/helix/gateway/api/constant/GatewayServiceManagerConstant.java b/helix-gateway/src/main/java/org/apache/helix/gateway/api/constant/GatewayServiceManagerConstant.java new file mode 100644 index 0000000000..d8fdfec06e --- /dev/null +++ b/helix-gateway/src/main/java/org/apache/helix/gateway/api/constant/GatewayServiceManagerConstant.java @@ -0,0 +1,25 @@ +package org.apache.helix.gateway.api.constant; + +/* + * 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. + */ + +public class GatewayServiceManagerConstant { + public static final String TARGET_STATE_ASSIGNMENT_KEY_NAME = "Assignment"; + public static final String TIMESTAMP_KEY = "Timestamp"; +} diff --git a/helix-gateway/src/main/java/org/apache/helix/gateway/api/constant/gatewayServiceManagerConstant.java b/helix-gateway/src/main/java/org/apache/helix/gateway/api/constant/gatewayServiceManagerConstant.java deleted file mode 100644 index c4fc420e18..0000000000 --- a/helix-gateway/src/main/java/org/apache/helix/gateway/api/constant/gatewayServiceManagerConstant.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.apache.helix.gateway.api.constant; - -public class gatewayServiceManagerConstant { - public static final String TARGET_STATE_ASSIGNMENT_KEY_NAME = "Assignment"; - public static final String TIMESTAMP_KEY = "Timestamp"; -} diff --git a/helix-gateway/src/main/java/org/apache/helix/gateway/participant/HelixGatewayParticipant.java b/helix-gateway/src/main/java/org/apache/helix/gateway/participant/HelixGatewayParticipant.java index 4d3b975c0e..eeb042c1c1 100644 --- a/helix-gateway/src/main/java/org/apache/helix/gateway/participant/HelixGatewayParticipant.java +++ b/helix-gateway/src/main/java/org/apache/helix/gateway/participant/HelixGatewayParticipant.java @@ -88,6 +88,7 @@ public void processStateTransitionMessage(Message message) throws Exception { throw new Exception("Failed to transition to state " + toState); } } finally { + logger.info("State transition finished for shard: {}{}", resourceId, shardId); _stateTransitionResultMap.remove(concatenatedShardName); } } @@ -167,6 +168,7 @@ public void onDisconnected(HelixManager helixManager, Throwable error) throws Ex } public void disconnect() { + logger.info("Disconnecting from HelixManager {}", _helixManager.getInstanceName() ); if (_helixManager.isConnected()) { _helixManager.disconnect(); } diff --git a/helix-gateway/src/main/java/org/apache/helix/gateway/service/GatewayServiceManager.java b/helix-gateway/src/main/java/org/apache/helix/gateway/service/GatewayServiceManager.java index 0809ac6e2e..d53ee51343 100644 --- a/helix-gateway/src/main/java/org/apache/helix/gateway/service/GatewayServiceManager.java +++ b/helix-gateway/src/main/java/org/apache/helix/gateway/service/GatewayServiceManager.java @@ -19,7 +19,6 @@ * under the License. */ -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.collect.ImmutableSet; @@ -37,11 +36,10 @@ import org.apache.helix.gateway.participant.HelixGatewayParticipant; import org.apache.helix.gateway.util.GatewayCurrentStateCache; import org.apache.helix.gateway.util.PerKeyBlockingExecutor; -import org.apache.helix.gateway.util.PollChannelUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.apache.helix.gateway.api.constant.gatewayServiceManagerConstant.*; +import static org.apache.helix.gateway.api.constant.GatewayServiceManagerConstant.*; /** @@ -115,6 +113,7 @@ public void onGatewayServiceEvent(GatewayServiceEvent event) { } public void resetTargetStateCache(String clusterName, String instanceName) { + logger.info("Resetting target state cache for cluster: {}, instance: {}", clusterName, instanceName); getOrCreateCache(clusterName).resetTargetStateCache(instanceName); } @@ -244,6 +243,7 @@ private void createHelixGatewayParticipant(String clusterName, String instanceNa } private void removeHelixGatewayParticipant(String clusterName, String instanceName) { + logger.info("Removing participant: {} from cluster: {}", instanceName, clusterName); // Disconnect and remove the participant from the participant map HelixGatewayParticipant participant = getHelixGatewayParticipant(clusterName, instanceName); if (participant != null) {