You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/11/21 03:28:33 UTC

[jira] [Commented] (ACCUMULO-3199) RPC options in client configuration are passed to the RPC layer poorly

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

ASF GitHub Bot commented on ACCUMULO-3199:
------------------------------------------

GitHub user ctubbsii opened a pull request:

    https://github.com/apache/accumulo/pull/19

    ACCUMULO-3199 Internal refactor to add ClientContext

      This patch introduces a new ClientContext object that contains Credentials,
      Instance, and Configuration provided from the client API. This new object is
      passed around internally in place of the previous three objects. An
      AccumuloServerContext is also introduced, which extends the ClientContext.
      Together, these objects ensure the proper configuration, credentials, and
      everything else needed to communicate with other system components are
      available to any RPC-related code.
    
      These new object types also reduce the need to create multiple references to
      commonly used internal objects (such as HdfsZooInstance and
      SystemCredentials), and avoids storing information in static fields. As a
      side-effect, this should allow for better testing with mocked components.
    
      This fixes ACCUMULO-3252, and may lay some groundwork for ACCUMULO-2589.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ctubbsii/accumulo ACCUMULO-3252

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/accumulo/pull/19.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #19
    
----
commit 2355c6379f87f1d891ddfc19a7a4008fe2005631
Author: Christopher Tubbs <ct...@apache.org>
Date:   2014-11-21T01:50:55Z

    ACCUMULO-3199 Internal refactor to add ClientContext
    
      This patch introduces a new ClientContext object that contains Credentials,
      Instance, and Configuration provided from the client API. This new object is
      passed around internally in place of the previous three objects. An
      AccumuloServerContext is also introduced, which extends the ClientContext.
      Together, these objects ensure the proper configuration, credentials, and
      everything else needed to communicate with other system components are
      available to any RPC-related code.
    
      These new object types also reduce the need to create multiple references to
      commonly used internal objects (such as HdfsZooInstance and
      SystemCredentials), and avoids storing information in static fields. As a
      side-effect, this should allow for better testing with mocked components.
    
      This fixes ACCUMULO-3252, and may lay some groundwork for ACCUMULO-2589.

----


> RPC options in client configuration are passed to the RPC layer poorly
> ----------------------------------------------------------------------
>
>                 Key: ACCUMULO-3199
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3199
>             Project: Accumulo
>          Issue Type: Task
>          Components: client
>            Reporter: Christopher Tubbs
>            Assignee: Christopher Tubbs
>             Fix For: 1.7.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The client configuration options for SSL, timeout, and (possibly) other RPC-related options are wrapped into an AccumuloConfiguration object to pass down to the RPC layer. This is done in a bit of a convoluted way, by leveraging the deprecated {{Instance.getConfiguration()}} method and relying on the fact that the {{Instance}} object is already passed through, instead of passing it through the {{Connector}} and internally to the the RPC layer where it's needed.
> The problem with this is that only the {{ZooKeeperInstance}} holds client configuration for this purpose, and simply calling {{instance.getConfiguration()}} will not always work as expected if you don't know what kind of {{Instance}} object you have. Further, this configuration object is occasionally incorrectly used in server code to read the server-side site configuration, when {{new ServerConfigurationFactory(instance).getConfiguration()}} should be used instead. This can lead to unexpected behavior if you are relying on the {{HdfsZooInstance}} implementation to provide the site configuration, but instead you have a different {{Instance}}, because all you'll get back is the {{DefaultConfiguration}}.
> The code that uses {{Instance.getConfiguration()}} needs to be changed, and the RPC-related configuration needs to be passed more explicitly through to the RPC layer, so we are less prone to bugs which make assumptions about which configuration is being retrieved with the deprecated API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)