Skip to content
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

Merged
merged 1 commit into from
Apr 23, 2019

Conversation

wenleix
Copy link
Contributor

@wenleix wenleix commented Apr 18, 2019

Loose ends as discussed in #12488 (comment) ; required by recoverable grouped execution (#12124)

Copy link
Member

@arhimondr arhimondr left a 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);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request request = prepareDelete()
.setUri(remoteSourceUri)
.build();
RequestErrorTracker errorTracker = new RequestErrorTracker(
Copy link
Contributor

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?

Copy link
Contributor Author

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 :)

Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or doRemoveRemoteSource ? ;)

@wenleix wenleix force-pushed the refactor_remove_source branch 3 times, most recently from 3ca7131 to 5dad3e2 Compare April 19, 2019 00:25
@wenleix wenleix merged commit e7e8191 into prestodb:master Apr 23, 2019
@wenleix wenleix deleted the refactor_remove_source branch April 23, 2019 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants