accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Fuchs (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-2946) refactor namespace / table operations code to share more code
Date Mon, 11 May 2015 20:10:00 GMT


Adam Fuchs commented on ACCUMULO-2946:

Since the two Helper classes implement two different interfaces the common methods should
be put into a third class, and the abstract *Helper classes should extend the third class
and implement the respective interfaces:

public class TableOrNamespaceConfigurator {
  public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException,
AccumuloException, TableNotFoundException {
    attachIterator(tableName, setting, EnumSet.allOf(IteratorScope.class));

public abstract class TableOperationsHelper extends TableOrNamespaceOperationsHelper implements
TableOperations {
  // anything table-specific here

public abstract class NamespaceOperationsHelper extends TableOrNamespaceOperationsHelper implements
NamespaceOperations {
  // anything namespace-specific here

Assuming the namespace and/or table specific parts are small, there might be another alternative
that gets rid of the two abstract Helper classes and just uses the concrete class. That would
be preferable if it would remove complexity.

> refactor namespace / table operations code to share more code
> -------------------------------------------------------------
>                 Key: ACCUMULO-2946
>                 URL:
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: client
>            Reporter: Adam Fuchs
>            Assignee: Adam Fuchs
>            Priority: Trivial
>             Fix For: 1.8.0
> o.a.a.core.client.impl.NamespaceOperationsHelper and o.a.a.core.client.impl.TableOperationsHelper
have a lot of repeated code between them. Refactor them to remove the duplication. Maybe this
could be done by adding a boolean to the method signatures, representing whether we're configuring
a namespace or a table?

This message was sent by Atlassian JIRA

View raw message