TeslaCN commented on code in PR #24524:
URL: https://github.com/apache/shardingsphere/pull/24524#discussion_r1135621186
##########
proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java:
##########
@@ -89,8 +123,12 @@ private void accept(final List<ChannelFuture> futures)
throws InterruptedExcepti
}
private void createEventLoopGroup() {
- bossGroup = Epoll.isAvailable() ? new EpollEventLoopGroup(1) : new
NioEventLoopGroup(1);
- workerGroup = getWorkerGroup();
+ if (null == bossGroup) {
Review Comment:
EventLoopGroup could be created once and used in both ServerBootstrap.
Please avoid null check here.
##########
proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java:
##########
@@ -56,6 +58,7 @@
/**
* Authentication engine for MySQL.
*/
+@Slf4j
Review Comment:
Please remove unused annotation.
##########
proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java:
##########
@@ -147,6 +150,10 @@ private boolean authorizeDatabase(final AuthorityRule
rule, final Grantee grante
}
private String getHostAddress(final ChannelHandlerContext context) {
+ if (context.channel() instanceof EpollDomainSocketChannel) {
+ return context.channel().parent().localAddress().toString();
+ }
+
Review Comment:
Please remove the blank line.
##########
proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/arguments/BootstrapArguments.java:
##########
@@ -97,4 +118,13 @@ private String paddingWithSlash(final String pathArg) {
}
return result.toString();
}
+
+ private boolean isValidPath(final String path) {
+ try {
+ Paths.get(path);
+ } catch (InvalidPathException | NullPointerException ex) {
+ return false;
Review Comment:
I prefer throwing an exception if path was invalid.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]