You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Mingliang Liu (JIRA)" <ji...@apache.org> on 2017/03/14 05:39:41 UTC

[jira] [Commented] (RATIS-39) Avoid using google guava so that it is easier to shade

    [ https://issues.apache.org/jira/browse/RATIS-39?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15923606#comment-15923606 ] 

Mingliang Liu commented on RATIS-39:
------------------------------------

The patch looks good to me. I compiled the patch and all unit tests pass. +1

Minor:
# For the newly added helper methods {{assertTrue}}, it'd be great if we can add javadoc for them for fast lookup
# For the exception assertion, e.g.
{code}
try {
  ...
} catch (Exception e) {
  Assert.assertEquals(IllegalStateException.class, e.getClass());
}
{code}
I think we can only catch {{IllegalStateException}} exception. Other exception will be thrown and test will be fail. That way we won't lose the unexpected exception stack (e.g. IOException).
{code}
try {
  ...
} catch (IllegalStateException ignored) {
  // expected
  // verify the exception by calling GenericTestUtils.assertExceptionContains() in the future
}
{code}

> Avoid using google guava so that it is easier to shade
> ------------------------------------------------------
>
>                 Key: RATIS-39
>                 URL: https://issues.apache.org/jira/browse/RATIS-39
>             Project: Ratis
>          Issue Type: Improvement
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>         Attachments: r39_20170309.patch, r39_20170310.patch
>
>
> In order to allow user application using google guava, we should either not using it or shade it.
> Except for ratis-common, we can replace google guava by:
> - Preconditions: add similar methods in our util.  
> - VisibleForTesting: remove it.
> - ThreadFactoryBuilder: use Daemon::new
> - Charsets: use StandardCharsets
> - Lists, ImmutableList: use java collections
> - Throwables; just throw IOException



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)