You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by David Medinets <da...@gmail.com> on 2013/01/04 03:52:52 UTC

TableLoadBalancer.getTableOperations get instance from HdfsZooInstance ... can it use configuration.getInstance() instead .. to promote unit testing?

In trunk, the abstract TabletBalancer class has a configuration class variable:

  protected ServerConfiguration configuration;

The TableLoadBalancer class has a getTableOperations method that get
an instance value from HdfsZooInstance:

  protected TableOperations getTableOperations() {
    if (tops == null)
      try {
        tops = HdfsZooInstance.getInstance().getConnector(SecurityConstants.getSystemCredentials()).tableOperations();
      } catch (AccumuloException e) {
        log.error("Unable to access table operations from within table
balancer", e);
      } catch (AccumuloSecurityException e) {
        log.error("Unable to access table operations from within table
balancer", e);
      }
    return tops;
  }

Is there any reason why the TableLoadBalancer can't use its
configuration variable to find the accumulo instance?

Re: TableLoadBalancer.getTableOperations get instance from HdfsZooInstance ... can it use configuration.getInstance() instead .. to promote unit testing?

Posted by John Vines <vi...@apache.org>.
Ideally the balancer will have access to all the information it needs
because it's part of the Master, so it shouldn't be making any external
connections to get info.


On Thu, Jan 3, 2013 at 9:52 PM, David Medinets <da...@gmail.com>wrote:

> In trunk, the abstract TabletBalancer class has a configuration class
> variable:
>
>   protected ServerConfiguration configuration;
>
> The TableLoadBalancer class has a getTableOperations method that get
> an instance value from HdfsZooInstance:
>
>   protected TableOperations getTableOperations() {
>     if (tops == null)
>       try {
>         tops =
> HdfsZooInstance.getInstance().getConnector(SecurityConstants.getSystemCredentials()).tableOperations();
>       } catch (AccumuloException e) {
>         log.error("Unable to access table operations from within table
> balancer", e);
>       } catch (AccumuloSecurityException e) {
>         log.error("Unable to access table operations from within table
> balancer", e);
>       }
>     return tops;
>   }
>
> Is there any reason why the TableLoadBalancer can't use its
> configuration variable to find the accumulo instance?
>