Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log and refine code style #2950

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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";
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.*;


/**
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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) {
Expand Down
Loading