himanshug opened a new pull request #10964:
URL: https://github.com/apache/druid/pull/10964


   Fixes #6942
   
   ### Description
   
   This might look like a large PR but most changes are mechanical i.e. updates 
to import statements and guava dependency in various pom files.
   
   Here is the meaty part...
   
   1.  A new module "shaded-guava" is introduced that produces classes in 
"org.apache.druid.com.google.common" package by shading real guava. See 
`shaded-guava/pom.xml` . 
   2.  pom.xml in all modules are made to depend upon shaded guava jar above 
instead of real guava, that change looks like
   ```
   -      <groupId>com.google.guava</groupId>
   +      <groupId>org.apache.druid.com.google.guava</groupId>
   ```
   3. In all Java files, `import com.google.common.X` is replaced by `import 
org.apache.druid.com.google.guava.X`
   4.  "Organize Imports" is done to all Java files to correct import ordering 
or checkstyles fails
   5. Some imports in `cloudfiles-extensions` and `sql` modules are reverted to 
use `import com.google.common.X` because their dependencies `jclouds-core` and 
`calcite` respectively mandate using real `import com.google.common.X` in 
various methods exposed by those libraries. But this is minimal.
   6. some imports that used `org.apache.curator.shaded.com.google.common.X` , 
i.e. shaded version of guava used by curator, continue to use same. that is 
independent.
   
   (this approach was briefly described in 
https://github.com/apache/druid/issues/6942#issuecomment-791029487 )
   
   End Result is that Druid source code is free from real guava and can use any 
version of guava inside `shaded-guava` module, few exceptions in (5) as 
described above but that is minimal and calcite e.g. ensures that its usage of 
guava is minimal so as to be able to support most guava versions.
   we still ship guava-0.16.1.jar like before, so no external integrations 
should see any impact. User should be able to switch this with their favorite 
version of guava jar at runtime and Druid source code be fine because it uses 
druid-shaded-guava-0.x.y.jar 
   
   Existing Unit, Integration Tests and Travis builds should cover all of the 
changes except for Hadoop Integration that I could not verify due to not having 
quick access to such setup. However, given they way this patch works, Hadoop 
Integration should see no change.
   
   
   <hr>
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not 
all of these items apply to every PR. Remove the items which are not done or 
not relevant to the PR. None of the items from the checklist below are strictly 
necessary, but it would be very helpful if you at least self-review the PR. -->
   
   This PR has:
   - [x] been self-reviewed.
      - [ ] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to