healchow commented on code in PR #5545: URL: https://github.com/apache/inlong/pull/5545#discussion_r945464617
########## inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/sink/common/TubeProducerHolder.java: ########## @@ -0,0 +1,277 @@ +/* + * 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. + */ + +package org.apache.inlong.dataproxy.sink.common; + +import com.google.common.base.Preconditions; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; +import org.apache.commons.lang3.StringUtils; +import org.apache.flume.FlumeException; +import org.apache.inlong.dataproxy.config.pojo.MQClusterConfig; +import org.apache.inlong.tubemq.client.config.TubeClientConfig; +import org.apache.inlong.tubemq.client.exception.TubeClientException; +import org.apache.inlong.tubemq.client.factory.TubeMultiSessionFactory; +import org.apache.inlong.tubemq.client.producer.MessageProducer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TubeProducerHolder { + private static final Logger logger = + LoggerFactory.getLogger(TubeProducerHolder.class); + private static final long SEND_FAILURE_WAIT = 30000L; + private static final long PUBLISH_FAILURE_WAIT = 60000L; + private final AtomicBoolean started = new AtomicBoolean(false); + private final String sinkName; + private final String clusterAddr; + private final MQClusterConfig clusterConfig; + private TubeMultiSessionFactory sessionFactory = null; + private final Map<String, MessageProducer> producerMap = new ConcurrentHashMap<>(); + private MessageProducer lastProducer = null; + private final AtomicInteger lastPubTopicCnt = new AtomicInteger(0); + private static final ConcurrentHashMap<String, AtomicLong> frozenTopicMap Review Comment: Suggest changing to UPPER_CASE for the `static final` variable. -- 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: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org