未验证 提交 1f853910 编写于 作者: H He Wang 提交者: GitHub

cleanup unnecessary dependencies (#24)

上级 ce3379aa
...@@ -31,18 +31,10 @@ See the Mulan PSL v2 for more details. ...@@ -31,18 +31,10 @@ See the Mulan PSL v2 for more details.
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- SLF4J --> <!-- SLF4J -->
<dependency> <dependency>
......
...@@ -26,44 +26,22 @@ See the Mulan PSL v2 for more details. ...@@ -26,44 +26,22 @@ See the Mulan PSL v2 for more details.
<description>The Client for OceanBase Log Proxy.</description> <description>The Client for OceanBase Log Proxy.</description>
<dependencies> <dependencies>
<!-- common dependency -->
<dependency> <dependency>
<groupId>com.oceanbase.logclient</groupId> <groupId>com.oceanbase.logclient</groupId>
<artifactId>common</artifactId> <artifactId>common</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<!-- SLF4J --> <!-- test -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>
<!-- logback -->
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>junit</groupId>
<artifactId>logback-core</artifactId> <artifactId>junit</artifactId>
<scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
</dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -11,12 +11,12 @@ See the Mulan PSL v2 for more details. */ ...@@ -11,12 +11,12 @@ See the Mulan PSL v2 for more details. */
package com.oceanbase.clogproxy.client.config; package com.oceanbase.clogproxy.client.config;
import com.google.common.collect.Maps;
import com.oceanbase.clogproxy.client.util.Validator; import com.oceanbase.clogproxy.client.util.Validator;
import com.oceanbase.clogproxy.common.config.SharedConf; import com.oceanbase.clogproxy.common.config.SharedConf;
import com.oceanbase.clogproxy.common.packet.LogType; import com.oceanbase.clogproxy.common.packet.LogType;
import com.oceanbase.clogproxy.common.util.CryptoUtil; import com.oceanbase.clogproxy.common.util.CryptoUtil;
import com.oceanbase.clogproxy.common.util.Hex; import com.oceanbase.clogproxy.common.util.Hex;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -45,7 +45,7 @@ public class ObReaderConfig extends AbstractConnectionConfig { ...@@ -45,7 +45,7 @@ public class ObReaderConfig extends AbstractConnectionConfig {
/** Constructor with empty arguments. */ /** Constructor with empty arguments. */
public ObReaderConfig() { public ObReaderConfig() {
super(Maps.newHashMap()); super(new HashMap<>());
} }
/** /**
......
...@@ -21,7 +21,6 @@ import java.util.ArrayList; ...@@ -21,7 +21,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -133,7 +132,7 @@ public class ClientStream { ...@@ -133,7 +132,7 @@ public class ClientStream {
/** Start the process thread. */ /** Start the process thread. */
public void start() { public void start() {
// if status listener exist, enable monitor // if status listener exist, enable monitor
context.params.setEnableMonitor(CollectionUtils.isNotEmpty(statusListeners)); context.params.setEnableMonitor(!statusListeners.isEmpty());
if (started.compareAndSet(false, true)) { if (started.compareAndSet(false, true)) {
thread = thread =
......
...@@ -20,10 +20,14 @@ import io.netty.handler.ssl.SslContextBuilder; ...@@ -20,10 +20,14 @@ import io.netty.handler.ssl.SslContextBuilder;
import javax.net.ssl.SSLException; import javax.net.ssl.SSLException;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Ignore @Ignore
public class LogProxyClientTest { public class LogProxyClientTest {
private static final Logger logger = LoggerFactory.getLogger(LogProxyClientTest.class);
@Test @Test
public void testLogProxyClient() { public void testLogProxyClient() {
ObReaderConfig config = new ObReaderConfig(); ObReaderConfig config = new ObReaderConfig();
...@@ -39,14 +43,14 @@ public class LogProxyClientTest { ...@@ -39,14 +43,14 @@ public class LogProxyClientTest {
new RecordListener() { new RecordListener() {
@Override @Override
public void notify(LogMessage record) { public void notify(LogMessage message) {
System.out.println(record); logger.info("LogMessage received: {}", message.toString());
} }
@Override @Override
public void onException(LogProxyClientException e) { public void onException(LogProxyClientException e) {
if (e.needStop()) { if (e.needStop()) {
System.out.println(e.getMessage()); logger.error(e.getMessage());
client.stop(); client.stop();
} }
} }
...@@ -70,14 +74,14 @@ public class LogProxyClientTest { ...@@ -70,14 +74,14 @@ public class LogProxyClientTest {
new RecordListener() { new RecordListener() {
@Override @Override
public void notify(LogMessage record) { public void notify(LogMessage message) {
System.out.println(record); logger.info("LogMessage received: {}", message.toString());
} }
@Override @Override
public void onException(LogProxyClientException e) { public void onException(LogProxyClientException e) {
if (e.needStop()) { if (e.needStop()) {
System.out.println(e.getMessage()); logger.error(e.getMessage());
client.stop(); client.stop();
} }
} }
......
...@@ -70,9 +70,7 @@ See the Mulan PSL v2 for more details. ...@@ -70,9 +70,7 @@ See the Mulan PSL v2 for more details.
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<commons-lang.version>3.12.0</commons-lang.version> <commons-lang.version>3.12.0</commons-lang.version>
<commons-collection.version>4.4</commons-collection.version>
<commons-codec.version>1.15</commons-codec.version> <commons-codec.version>1.15</commons-codec.version>
<guava.version>31.0.1-jre</guava.version>
<netty.version>4.1.68.Final</netty.version> <netty.version>4.1.68.Final</netty.version>
<protobuf.version>3.18.2</protobuf.version> <protobuf.version>3.18.2</protobuf.version>
<lz4.version>1.8.0</lz4.version> <lz4.version>1.8.0</lz4.version>
...@@ -94,21 +92,11 @@ See the Mulan PSL v2 for more details. ...@@ -94,21 +92,11 @@ See the Mulan PSL v2 for more details.
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>${commons-lang.version}</version> <version>${commons-lang.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons-collection.version}</version>
</dependency>
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
<version>${commons-codec.version}</version> <version>${commons-codec.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<!-- net --> <!-- net -->
<dependency> <dependency>
...@@ -135,49 +123,18 @@ See the Mulan PSL v2 for more details. ...@@ -135,49 +123,18 @@ See the Mulan PSL v2 for more details.
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- logback --> <!-- test -->
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>junit</groupId>
<artifactId>logback-core</artifactId> <artifactId>junit</artifactId>
<version>${logback.version}</version> <version>${junit.version}</version>
<scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>${logback.version}</version> <version>${logback.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册