-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Move removeRemoteSource from RemoteTaskFactory to RemoteTask #12691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % 2 nits
@@ -103,9 +112,10 @@ | |||
public final class HttpRemoteTask | |||
implements RemoteTask | |||
{ | |||
private static final Logger log = Logger.get(HttpRemoteTask.class); | |||
private static final Logger LOG = Logger.get(HttpRemoteTask.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are ~160 occurrences of Logger log
vs ~20 occurrences of Logger LOG
. I would stick with log
, as upper case is rather used for constants. Logger
object is not a data object, so it is hard to call it a constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presto-main/src/main/java/com/facebook/presto/server/remotetask/HttpRemoteTask.java
Outdated
Show resolved
Hide resolved
Request request = prepareDelete() | ||
.setUri(remoteSourceUri) | ||
.build(); | ||
RequestErrorTracker errorTracker = new RequestErrorTracker( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to create tracker here or maybe we should create this tracker in removeRemoteSourceHelper
given the only usage is to pass this variable inside?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shixuan-fan : Remember removeRemoteSourceHelper
recursively calls itself, so we don't want to create RequestErrorTracker
inside it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Didn't see that.
return future; | ||
} | ||
|
||
private void removeRemoteSourceHelper(RequestErrorTracker errorTracker, Request request, SettableFuture<?> future) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method name sounds more like it removes something called remoteSourceHelper. How about handleRemoteSourceRemoval
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or doRemoveRemoteSource
? ;)
3ca7131
to
5dad3e2
Compare
5dad3e2
to
e8195d5
Compare
Loose ends as discussed in #12488 (comment) ; required by recoverable grouped execution (#12124)