accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-4057) Duplicated code in IteratorUtil
Date Tue, 17 Nov 2015 21:39:11 GMT

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

Josh Elser commented on ACCUMULO-4057:
--------------------------------------

Yes, I see that they have unique signatures (it wouldn't compile if they didn't). My point
is that the contents of the methods are duplicated. These should be consolidated -- e.g. one
private static method which both of these public static methods call.

> Duplicated code in IteratorUtil
> -------------------------------
>
>                 Key: ACCUMULO-4057
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-4057
>             Project: Accumulo
>          Issue Type: Improvement
>            Reporter: Josh Elser
>            Priority: Trivial
>
> Duplicated code in https://github.com/apache/accumulo/blob/master/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java#L236
> {code}
>   public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V>
loadIterators(IteratorScope scope,
>       SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration
conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
>       IteratorEnvironment env, boolean useAccumuloClassLoader) throws IOException {
>     List<IterInfo> iters = new ArrayList<IterInfo>(ssiList);
>     Map<String,Map<String,String>> allOptions = new HashMap<String,Map<String,String>>();
>     parseIteratorConfiguration(scope, iters, ssio, allOptions, conf);
>     return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, conf.get(Property.TABLE_CLASSPATH));
>   }
>   public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V>
loadIterators(IteratorScope scope,
>       SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration
conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
>       IteratorEnvironment env, boolean useAccumuloClassLoader, String classLoaderContext)
throws IOException {
>     List<IterInfo> iters = new ArrayList<IterInfo>(ssiList);
>     Map<String,Map<String,String>> allOptions = new HashMap<String,Map<String,String>>();
>     parseIteratorConfiguration(scope, iters, ssio, allOptions, conf);
>     return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, classLoaderContext);
>   }
> {code}
> I thought I had commented on https://github.com/apache/accumulo/pull/51 about this, but
maybe I forgot.



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

Mime
View raw message