Skip to content

Add guava compatability up to 27.0.1#6948

Closed
drcrallen wants to merge 10 commits intoapache:masterfrom
drcrallen:guava/compat
Closed

Add guava compatability up to 27.0.1#6948
drcrallen wants to merge 10 commits intoapache:masterfrom
drcrallen:guava/compat

Conversation

@drcrallen
Copy link
Copy Markdown
Contributor

@drcrallen drcrallen commented Jan 29, 2019

Use reflection to ensure guava compatibility.

  • Add a profile to optionally compile against a more recent guava.
  • Add reflection based methodologies for invoking HostAndPort host text getters.
  • Add reflection based methodologies for getting the breaking whitespace char matcher instance.
  • Auto gen (IntelliJ) some toString() methods
  • Add unit tests.
  • Forbid known bad calls.
  • Add guava compatibility to travis code checking.
  • Move future callbacks to use Runnable::run executor directly

Copy link
Copy Markdown
Member

@leventov leventov left a comment

Choose a reason for hiding this comment

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

I commented about this PR in this thread: #6942

*
* @return The result of invoking the method on the object
*/
private static <T> T tryMethods(Object object, Class<T> assignableTo, String... methods)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Documentation should reference the specific commit and the range of lines (as a Github link) in Guava from where this was copied. Same for other non-trivial parts of the copied code.

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.

This part was not copied. The method names in the callers are copied though. I'll add a javadoc here to help make sure a "use the git tag as a reference" pattern is followed in the future for such behaviors.

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.

fixed

@drcrallen
Copy link
Copy Markdown
Contributor Author

Keeping away stale bot, I still hope to have this one merged

@stale
Copy link
Copy Markdown

stale Bot commented May 6, 2019

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@druid.apache.org list. Thank you for your contributions.

@stale stale Bot added the stale label May 6, 2019
@drcrallen
Copy link
Copy Markdown
Contributor Author

go away stale bot!

@stale stale Bot removed the stale label May 8, 2019
@stale
Copy link
Copy Markdown

stale Bot commented Jul 7, 2019

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@druid.apache.org list. Thank you for your contributions.

@stale stale Bot added the stale label Jul 7, 2019
@stale
Copy link
Copy Markdown

stale Bot commented Jul 14, 2019

This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@stale stale Bot closed this Jul 14, 2019
@leventov leventov removed the stale label Jul 15, 2019
}
}
if (matcher == null) {
throw new IllegalStateException("wtf!?");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please make the error message more constructive, or absent altogether

}
},
Execs.directExecutor()
Runnable::run
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's better to create a method like GuavaUtils.directExecutor() which returns Runnable::run. Bare Runnable::run looks somewhat puzzling. There are also other calls to Runnable::run in this PR which are subject for this.

this.segmentWriteOutMediumFactory = segmentWriteOutMediumFactory;
}

private static String computeProcessingID(final String dataSource, final List<DataSegment> segments)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please keep the old method arrangement so that it's visible what have changed in these methods?

@leventov leventov reopened this Jul 15, 2019
java.util.regex.Pattern#matches(java.lang.String,java.lang.CharSequence) @ Use String.startsWith(), endsWith(), contains(), or compile and cache a Pattern explicitly
org.apache.commons.io.FileUtils#getTempDirectory() @ Use org.junit.rules.TemporaryFolder for tests instead

com.google.common.net.HostAndPort#getHostText() @ Use org.apache.druid.common.guava.GuavaUtils#getHostText instead
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be nice to break this file into sections: jackson, guava, jdk, everything else.

@stale
Copy link
Copy Markdown

stale Bot commented Sep 15, 2019

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@druid.apache.org list. Thank you for your contributions.

@stale stale Bot added the stale label Sep 15, 2019
@stale
Copy link
Copy Markdown

stale Bot commented Oct 13, 2019

This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants