[refactor](log) Remove unused log instance creation (#7249)

This commit is contained in:
Wei
2021-12-02 11:43:29 +08:00
committed by GitHub
parent f51448d60b
commit 5f7c4f903f

View File

@ -17,25 +17,21 @@
package org.apache.doris.http;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.doris.common.path.PathTrie;
import com.google.common.base.Strings;
import io.netty.handler.codec.http.HttpMethod;
public class ActionController {
private static final Logger LOG = LogManager.getLogger(ActionController.class);
private final PathTrie<IAction> getHandlers = new PathTrie<>(WebUtils.REST_DECODER);
private final PathTrie<IAction> postHandlers = new PathTrie<>(WebUtils.REST_DECODER);
private final PathTrie<IAction> putHandlers = new PathTrie<>(WebUtils.REST_DECODER);
private final PathTrie<IAction> deleteHandlers = new PathTrie<>(WebUtils.REST_DECODER);
private final PathTrie<IAction> headHandlers = new PathTrie<>(WebUtils.REST_DECODER);
private final PathTrie<IAction> optionsHandlers = new PathTrie<>(WebUtils.REST_DECODER);
// Registers a rest handler to be execute when the provided method and path match the request.
public void registerHandler(HttpMethod method, String path, IAction handler)
public void registerHandler(HttpMethod method, String path, IAction handler)
throws IllegalArgException {
if (method.equals(HttpMethod.GET)) {
getHandlers.insert(path, handler);
@ -54,7 +50,7 @@ public class ActionController {
"Can't handle [" + method + "] for path [" + path + "]");
}
}
public IAction getHandler(BaseRequest request) {
String path = getPath(request.getRequest().uri());
HttpMethod method = request.getRequest().method();
@ -74,8 +70,8 @@ public class ActionController {
return null;
}
}
// e.g.
// e.g.
// in: /www/system?path=//jobs
// out: /www/system
private String getPath(String uri) {