Skip to content

Use Guava Compatible immediate executor service#6815

Merged
b-slim merged 8 commits intoapache:masterfrom
drcrallen:guava/directexec
Jan 11, 2019
Merged

Use Guava Compatible immediate executor service#6815
b-slim merged 8 commits intoapache:masterfrom
drcrallen:guava/directexec

Conversation

@drcrallen
Copy link
Copy Markdown
Contributor

@drcrallen drcrallen commented Jan 7, 2019

As a follow on to #5413 this PR copies the DirectExecutorService implementation from more recent Guava versions (18 and later).

I think this is the last change to make the druid code base work for a HUGE swath of Guava versions.

@jihoonson
Copy link
Copy Markdown
Contributor

Is it worth to make Druid compatible with various Guava version? Why don't we implement our own direct executor (as you did in #5413) or simply copy the latest Guava implementation?

@b-slim
Copy link
Copy Markdown
Contributor

b-slim commented Jan 7, 2019

i Agree with @jihoonson i think moving away from Guava by copying pasting code or doing our own stuff is far more worth it than trying to support multiple guava versions.

@drcrallen
Copy link
Copy Markdown
Contributor Author

@jihoonson I tried the "our own implementation" route, and there was too much nuance that I didn't want to deal with. Just fetching the guava stuff correctly was much easier, and puts the maintenance of proper implementation on the Guava libs instead of us.

@jihoonson
Copy link
Copy Markdown
Contributor

Then why don't we copy the latest (or whatever with less bugs) Guava implementation? I don't see the point of supporting various Guava versions at run time.

@gianm
Copy link
Copy Markdown
Contributor

gianm commented Jan 8, 2019

+1 for c/p'ing the latest Guava implementation as-is, like we did with Closer and splitToList. At least then we'll know what we're dealing with.

@drcrallen
Copy link
Copy Markdown
Contributor Author

Not failing on arbitrary guava versions is a problem on our side related to things like gRPC extensions and building Druid libs in with Beam workloads. Making the Druid libs at least support a wide range of versions greatly reduces the surprising library conflicts that have to be resolved, and eliminates the temptation to shade-shade-shade a whole bunch of stuff.

@drcrallen
Copy link
Copy Markdown
Contributor Author

I would love to, for example, be able to have my internal fork of Druid run on the more recent Guava versions to be compatible with whatever extensions we want to use. But such a thing is not a drop-in exercise until issues like this one are resolved.

@drcrallen
Copy link
Copy Markdown
Contributor Author

Copied over the Direct Executor Service. Luckily it isn't doing any package private mumbo jumbo, so the copy was pretty straight forward

@drcrallen
Copy link
Copy Markdown
Contributor Author

I can't see why teamcity is failing

@gianm
Copy link
Copy Markdown
Contributor

gianm commented Jan 10, 2019

@drcrallen It looks like there's a reference to CallerRunsPolicy in a javadoc, a class that was not copied over. (You should be able to see this stuff by registering for a TeamCity acct.) Probably the right thing to do is edit the javadoc.

image

@drcrallen
Copy link
Copy Markdown
Contributor Author

oh! login as guest works well now.

Copy link
Copy Markdown
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

LGTM other than the question about GroupByQueryRunnerTest.java.

@@ -29,7 +29,6 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.MoreExecutors;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Were the changes in this file all autoformatter changes? They are hard to follow so I'd rather ask than try to figure that out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Either auto-formatter or MoreExecutors.sameThreadExecutor() --> Execs.directExecutor(), yes

@drcrallen
Copy link
Copy Markdown
Contributor Author

Ugh, if the import is there, failure because unused import (even though it is used in javadoc). If the import is not there it gets failure in teamcity due to unknown reference.

@gianm
Copy link
Copy Markdown
Contributor

gianm commented Jan 10, 2019

I have never really found a good way around that particular weirdness with imports + javadocs. I usually deal with it by using fully qualified class names in javadocs (rather than import + short name). Or by avoiding @link.

Copy link
Copy Markdown
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

LGTM.

@b-slim
Copy link
Copy Markdown
Contributor

b-slim commented Jan 11, 2019

@drcrallen thanks for doing this!

@b-slim b-slim merged commit 5d2947c into apache:master Jan 11, 2019
@drcrallen drcrallen deleted the guava/directexec branch January 29, 2019 17:08
@leventov leventov mentioned this pull request Feb 1, 2019
@drcrallen
Copy link
Copy Markdown
Contributor Author

For future folks: #6948 adds more compat up to 27.0.1

@jon-wei jon-wei added this to the 0.14.0 milestone Feb 20, 2019
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.

5 participants