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

Suppress compile warning #31

Merged
merged 1 commit into from
Aug 2, 2021
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
Expand Up @@ -17,16 +17,8 @@

package com.webank.defibus.broker.client;

import java.util.List;
import java.util.Set;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Predicate;

import com.webank.defibus.broker.DeFiBrokerController;
import io.netty.channel.Channel;
import com.webank.defibus.common.DeFiBusConstant;

import org.apache.rocketmq.broker.client.ConsumerGroupInfo;
import org.apache.rocketmq.common.MixAll;
Expand All @@ -37,7 +29,15 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.webank.defibus.common.DeFiBusConstant;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Predicate;

import io.netty.channel.Channel;

public class AdjustQueueNumStrategy {
private static final Logger log = LoggerFactory.getLogger(LoggerName.BROKER_LOGGER_NAME);
Expand Down Expand Up @@ -234,7 +234,7 @@ private int scaleQueueSize(Set<String> cidList) {
int scaleQueueSize = 0;
long nearbyClients = nearbyClients(cidList);
if (nearbyClients != 0) {
scaleQueueSize = new Long(nearbyClients).intValue();
scaleQueueSize = Long.valueOf(nearbyClients).intValue();
} else if (isAllClientsHaveNotIDCSurffix(cidList)) {
scaleQueueSize = cidList.size();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@
package com.webank.defibus.broker.client;

import com.webank.defibus.common.util.ReflectUtil;
import io.netty.channel.Channel;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import org.apache.rocketmq.broker.client.ClientChannelInfo;
import org.apache.rocketmq.broker.client.ConsumerGroupEvent;
import org.apache.rocketmq.broker.client.ConsumerGroupInfo;
Expand All @@ -39,6 +34,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import io.netty.channel.Channel;

public class DeFiConsumerManager extends ConsumerManager {
private static final Logger log = LoggerFactory.getLogger(LoggerName.BROKER_LOGGER_NAME);
private static final long CHANNEL_EXPIRED_TIMEOUT = 1000 * 120;
Expand All @@ -47,6 +50,7 @@ public class DeFiConsumerManager extends ConsumerManager {
private final ConsumerIdsChangeListener consumerIdsChangeListener;
private final AdjustQueueNumStrategy adjustQueueNumStrategy;

@SuppressWarnings("unchecked")
public DeFiConsumerManager(final ConsumerIdsChangeListener consumerIdsChangeListener,
final AdjustQueueNumStrategy strategy) {
super(consumerIdsChangeListener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@

import com.webank.defibus.client.impl.factory.DeFiBusClientInstance;
import com.webank.defibus.common.util.ReflectUtil;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;

import org.apache.rocketmq.client.impl.consumer.DefaultMQPushConsumerImpl;
import org.apache.rocketmq.client.impl.consumer.MQConsumerInner;
import org.apache.rocketmq.client.impl.consumer.PullMessageService;
Expand All @@ -33,6 +28,13 @@
import org.apache.rocketmq.common.utils.ThreadUtils;
import org.apache.rocketmq.logging.InternalLogger;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;

public class DeFiBusPullMessageService extends PullMessageService {
private final InternalLogger log = ClientLogger.getLog();
private final DeFiBusClientInstance mQClientFactory;
Expand All @@ -47,6 +49,7 @@ public Thread newThread(Runnable r) {
}
});

@SuppressWarnings("unchecked")
public DeFiBusPullMessageService(DeFiBusClientInstance deFiBusClientInstance) {
super(deFiBusClientInstance);
this.mQClientFactory = deFiBusClientInstance;
Expand Down