[ISSUE-#7261] Remove unnecessary logger which is defined at subclass. (#7262)

* remove unnecessary logger which is defined  at subclass.

* code format.
This commit is contained in:
赵延 2021-03-15 22:27:01 +08:00 committed by GitHub
parent 2112edc2aa
commit d9606cf506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 10 additions and 72 deletions

View File

@ -73,7 +73,7 @@ public class ConfigCenterConfig extends AbstractConfig {
private String configFile = CommonConstants.DEFAULT_DUBBO_PROPERTIES;
/* the .properties file under 'configFile' is global shared while .properties under this one is limited only to this application
*/
*/
private String appConfigFile;
/* If the Config Center product you use have some special parameters that is not covered by this class, you can add it to here.

View File

@ -17,8 +17,6 @@
package org.apache.dubbo.config.spring;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.NetUtils;
import org.apache.dubbo.common.utils.UrlUtils;
@ -36,7 +34,6 @@ import java.util.concurrent.ConcurrentMap;
*/
public class SimpleRegistryService extends AbstractRegistryService {
private final static Logger logger = LoggerFactory.getLogger(SimpleRegistryService.class);
private final ConcurrentMap<String, ConcurrentMap<String, URL>> remoteRegistered = new ConcurrentHashMap<String, ConcurrentMap<String, URL>>();
private final ConcurrentMap<String, ConcurrentMap<String, NotifyListener>> remoteListeners = new ConcurrentHashMap<String, ConcurrentMap<String, NotifyListener>>();
private List<String> registries;
@ -139,4 +136,4 @@ public class SimpleRegistryService extends AbstractRegistryService {
this.registries = registries;
}
}
}

View File

@ -17,8 +17,6 @@
package org.apache.dubbo.metadata.test;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.metadata.report.identifier.KeyTypeEnum;
import org.apache.dubbo.metadata.report.identifier.MetadataIdentifier;
import org.apache.dubbo.metadata.report.identifier.ServiceMetadataIdentifier;
@ -37,9 +35,6 @@ import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
*/
public class JTestMetadataReport4Test extends AbstractMetadataReport {
private final static Logger logger = LoggerFactory.getLogger(JTestMetadataReport4Test.class);
public JTestMetadataReport4Test(URL url) {
super(url);
}

View File

@ -18,8 +18,6 @@
package org.apache.dubbo.metadata.store.consul;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.metadata.report.identifier.BaseMetadataIdentifier;
import org.apache.dubbo.metadata.report.identifier.KeyTypeEnum;
@ -42,7 +40,6 @@ import java.util.List;
* metadata report impl for consul
*/
public class ConsulMetadataReport extends AbstractMetadataReport {
private static final Logger logger = LoggerFactory.getLogger(ConsulMetadataReport.class);
private static final int DEFAULT_PORT = 8500;
private ConsulClient client;

View File

@ -34,8 +34,6 @@
package org.apache.dubbo.metadata.store.etcd;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.metadata.report.identifier.BaseMetadataIdentifier;
import org.apache.dubbo.metadata.report.identifier.KeyTypeEnum;
@ -58,8 +56,6 @@ import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR;
*/
public class EtcdMetadataReport extends AbstractMetadataReport {
private final static Logger logger = LoggerFactory.getLogger(EtcdMetadataReport.class);
private final String root;
/**

View File

@ -18,8 +18,6 @@
package org.apache.dubbo.metadata.store.nacos;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.metadata.report.identifier.BaseMetadataIdentifier;
import org.apache.dubbo.metadata.report.identifier.KeyTypeEnum;
@ -67,8 +65,6 @@ import static org.apache.dubbo.common.constants.RemotingConstants.BACKUP_KEY;
*/
public class NacosMetadataReport extends AbstractMetadataReport {
private static final Logger logger = LoggerFactory.getLogger(NacosMetadataReport.class);
private ConfigService configService;
/**

View File

@ -17,8 +17,6 @@
package org.apache.dubbo.metadata.store.redis;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.metadata.report.identifier.BaseMetadataIdentifier;
import org.apache.dubbo.metadata.report.identifier.KeyTypeEnum;
@ -53,7 +51,6 @@ import static org.apache.dubbo.metadata.MetadataConstants.META_DATA_STORE_TAG;
public class RedisMetadataReport extends AbstractMetadataReport {
private final static String REDIS_DATABASE_KEY = "database";
private final static Logger logger = LoggerFactory.getLogger(RedisMetadataReport.class);
JedisPool pool;
Set<HostAndPort> jedisClusterNodes;

View File

@ -18,8 +18,6 @@ package org.apache.dubbo.metadata.store.zookeeper;
import com.google.gson.Gson;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.metadata.MappingChangedEvent;
@ -53,8 +51,6 @@ import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR;
*/
public class ZookeeperMetadataReport extends AbstractMetadataReport {
private final static Logger logger = LoggerFactory.getLogger(ZookeeperMetadataReport.class);
private final String root;
final ZookeeperClient zkClient;

View File

@ -18,8 +18,6 @@ package org.apache.dubbo.registry.dubbo;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.Version;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.ExecutorUtil;
import org.apache.dubbo.common.utils.NamedThreadFactory;
import org.apache.dubbo.common.utils.NetUtils;
@ -43,8 +41,6 @@ import static org.apache.dubbo.registry.Constants.REGISTRY_RECONNECT_PERIOD_KEY;
*/
public class DubboRegistry extends FailbackRegistry {
private final static Logger logger = LoggerFactory.getLogger(DubboRegistry.class);
// Reconnecting detection cycle: 3 seconds (unit:millisecond)
private static final int RECONNECT_PERIOD_DEFAULT = 3 * 1000;

View File

@ -17,8 +17,6 @@
package org.apache.dubbo.registry.dubbo;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.NetUtils;
import org.apache.dubbo.common.utils.UrlUtils;
import org.apache.dubbo.registry.NotifyListener;
@ -36,7 +34,6 @@ import java.util.concurrent.ConcurrentMap;
*/
public class SimpleRegistryService extends AbstractRegistryService {
private final static Logger logger = LoggerFactory.getLogger(SimpleRegistryService.class);
private final ConcurrentMap<String, ConcurrentMap<String, URL>> remoteRegistered = new ConcurrentHashMap<String, ConcurrentMap<String, URL>>();
private final ConcurrentMap<String, ConcurrentMap<String, NotifyListener>> remoteListeners = new ConcurrentHashMap<String, ConcurrentMap<String, NotifyListener>>();
private List<String> registries;
@ -143,4 +140,4 @@ public class SimpleRegistryService extends AbstractRegistryService {
this.registries = registries;
}
}
}

View File

@ -17,8 +17,6 @@
package org.apache.dubbo.registry.etcd;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.ConcurrentHashSet;
import org.apache.dubbo.common.utils.UrlUtils;
import org.apache.dubbo.registry.NotifyListener;
@ -59,8 +57,6 @@ import static org.apache.dubbo.remoting.Constants.CHECK_KEY;
*/
public class EtcdRegistry extends FailbackRegistry {
private final static Logger logger = LoggerFactory.getLogger(EtcdRegistry.class);
private final static int DEFAULT_ETCD_PORT = 2379;
private final static String DEFAULT_ROOT = "dubbo";

View File

@ -17,8 +17,6 @@
package org.apache.dubbo.registry.multicast;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.ConcurrentHashSet;
import org.apache.dubbo.common.utils.ExecutorUtil;
@ -69,9 +67,6 @@ import static org.apache.dubbo.registry.Constants.UNSUBSCRIBE;
*/
public class MulticastRegistry extends FailbackRegistry {
// logging output
private static final Logger logger = LoggerFactory.getLogger(MulticastRegistry.class);
private static final int DEFAULT_MULTICAST_PORT = 1234;
private final InetAddress multicastAddress;

View File

@ -19,8 +19,6 @@ package org.apache.dubbo.registry.nacos;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.URLBuilder;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.common.utils.UrlUtils;
import org.apache.dubbo.registry.NotifyListener;
@ -120,8 +118,6 @@ public class NacosRegistry extends FailbackRegistry {
*/
private volatile ScheduledExecutorService scheduledExecutorService;
private final Logger logger = LoggerFactory.getLogger(getClass());
private final NamingService namingService;
public NacosRegistry(URL url, NamingService namingService) {

View File

@ -18,8 +18,6 @@ package org.apache.dubbo.registry.redis;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.URLBuilder;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.ExecutorUtil;
import org.apache.dubbo.common.utils.NamedThreadFactory;
@ -77,8 +75,6 @@ import static org.apache.dubbo.registry.Constants.UNREGISTER;
*/
public class RedisRegistry extends FailbackRegistry {
private static final Logger logger = LoggerFactory.getLogger(RedisRegistry.class);
private final static String DEFAULT_ROOT = "dubbo";
private final ScheduledExecutorService expireExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("DubboRegistryExpireTimer", true));

View File

@ -17,8 +17,6 @@
package org.apache.dubbo.registry.sofa;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.ConfigUtils;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.registry.NotifyListener;
@ -62,8 +60,6 @@ import static org.apache.dubbo.registry.sofa.SofaRegistryConstants.LOCAL_REGION;
*/
public class SofaRegistry extends FailbackRegistry {
private static final Logger LOGGER = LoggerFactory.getLogger(SofaRegistry.class);
/**
* Cache subscriber by dataId
*/
@ -85,8 +81,8 @@ public class SofaRegistry extends FailbackRegistry {
*/
public SofaRegistry(URL url) {
super(url);
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Build sofa registry by url:" + url);
if (logger.isInfoEnabled()) {
logger.info("Build sofa registry by url:" + url);
}
this.registryClient = buildClient(url);
this.waitAddressTimeout = Integer.parseInt(ConfigUtils.getProperty(ADDRESS_WAIT_TIME_KEY, "5000"));
@ -162,7 +158,7 @@ public class SofaRegistry extends FailbackRegistry {
Subscriber listSubscriber = subscribers.get(serviceName);
if (listSubscriber != null) {
LOGGER.warn("Service name [" + serviceName + "] have bean registered in SOFARegistry.");
logger.warn("Service name [" + serviceName + "] have bean registered in SOFARegistry.");
CountDownLatch countDownLatch = new CountDownLatch(1);
handleRegistryData(listSubscriber.peekData(), listener, countDownLatch);
@ -189,10 +185,10 @@ public class SofaRegistry extends FailbackRegistry {
private void waitAddress(String serviceName, CountDownLatch countDownLatch) {
try {
if (!countDownLatch.await(waitAddressTimeout, TimeUnit.MILLISECONDS)) {
LOGGER.warn("Subscribe data failed by dataId " + serviceName);
logger.warn("Subscribe data failed by dataId " + serviceName);
}
} catch (Exception e) {
LOGGER.error("Error when wait Address!", e);
logger.error("Error when wait Address!", e);
}
}
@ -264,8 +260,8 @@ public class SofaRegistry extends FailbackRegistry {
for (String provider : datas) {
sb.append(" >>> ").append(provider).append("\n");
}
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Receive updated RPC service addresses: service[" + dataId
if (logger.isInfoEnabled()) {
logger.info("Receive updated RPC service addresses: service[" + dataId
+ "]\n .Available target addresses size [" + datas.size() + "]\n"
+ sb.toString());
}

View File

@ -19,8 +19,6 @@ package org.apache.dubbo.registry.zookeeper;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.URLBuilder;
import org.apache.dubbo.common.URLStrParser;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.ConcurrentHashSet;
import org.apache.dubbo.common.utils.UrlUtils;
@ -61,8 +59,6 @@ import static org.apache.dubbo.common.constants.RegistryConstants.ROUTERS_CATEGO
*/
public class ZookeeperRegistry extends FailbackRegistry {
private final static Logger logger = LoggerFactory.getLogger(ZookeeperRegistry.class);
private final static String DEFAULT_ROOT = "dubbo";
private final String root;

View File

@ -17,8 +17,6 @@
package org.apache.dubbo.rpc.protocol.grpc;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.config.ReferenceConfigBase;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.ProtocolServer;
@ -46,8 +44,6 @@ import java.util.concurrent.ConcurrentMap;
*/
public class GrpcProtocol extends AbstractProxyProtocol {
private static final Logger logger = LoggerFactory.getLogger(GrpcProtocol.class);
public final static int DEFAULT_PORT = 50051;
/* <address, gRPC channels> */