You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by lstav <gi...@git.apache.org> on 2016/12/29 15:56:16 UTC

[GitHub] accumulo pull request #196: ACCUMULO-4057 Moved the code to a private static...

GitHub user lstav opened a pull request:

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

    ACCUMULO-4057 Moved the code to a private static method

    Fix for ACCUMULO-4057. Followed @joshelser suggestion on one of the comments on the issue and consolidated the code in a private static method that the public methods now call.

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

    $ git pull https://github.com/lstav/accumulo ACCUMULO-4057

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

    https://github.com/apache/accumulo/pull/196.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 #196
    
----
commit 9a88d9dc01cb85842e3b25b959e8feeda03c00a5
Author: Luis Tavarez <ze...@outlook.com>
Date:   2016-12-29T15:54:08Z

    ACCUMULO-4057 Moved the code to a private static method, and the methods now call the new one

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] accumulo issue #196: ACCUMULO-4057 Moved the code to a private static method

Posted by joshelser <gi...@git.apache.org>.
Github user joshelser commented on the issue:

    https://github.com/apache/accumulo/pull/196
  
    Great, thanks @lstav. I'll merge this one in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] accumulo pull request #196: ACCUMULO-4057 Moved the code to a private static...

Posted by lstav <gi...@git.apache.org>.
Github user lstav commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/196#discussion_r94177224
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java ---
    @@ -235,18 +235,27 @@ private static void mergeOptions(Map<String,Map<String,String>> ssio, Map<String
       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<>(ssiList);
    -    Map<String,Map<String,String>> allOptions = new HashMap<>();
    -    parseIteratorConfiguration(scope, iters, ssio, allOptions, conf);
    -    return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, conf.get(Property.TABLE_CLASSPATH));
    +
    +    return loadIteratorsHelper(scope, source, extent, conf, ssiList, ssio, env, useAccumuloClassLoader, null);
    --- End diff --
    
    Done :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] accumulo pull request #196: ACCUMULO-4057 Moved the code to a private static...

Posted by joshelser <gi...@git.apache.org>.
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/196#discussion_r94176521
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java ---
    @@ -235,18 +235,27 @@ private static void mergeOptions(Map<String,Map<String,String>> ssio, Map<String
       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<>(ssiList);
    -    Map<String,Map<String,String>> allOptions = new HashMap<>();
    -    parseIteratorConfiguration(scope, iters, ssio, allOptions, conf);
    -    return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, conf.get(Property.TABLE_CLASSPATH));
    +
    +    return loadIteratorsHelper(scope, source, extent, conf, ssiList, ssio, env, useAccumuloClassLoader, null);
    --- End diff --
    
    Related comment to below: would recommend switching the `null` back to `conf.get(Property.TABLE_CLASSPATH)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] accumulo pull request #196: ACCUMULO-4057 Moved the code to a private static...

Posted by joshelser <gi...@git.apache.org>.
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/196#discussion_r94176449
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java ---
    @@ -235,18 +235,27 @@ private static void mergeOptions(Map<String,Map<String,String>> ssio, Map<String
       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<>(ssiList);
    -    Map<String,Map<String,String>> allOptions = new HashMap<>();
    -    parseIteratorConfiguration(scope, iters, ssio, allOptions, conf);
    -    return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, conf.get(Property.TABLE_CLASSPATH));
    +
    +    return loadIteratorsHelper(scope, source, extent, conf, ssiList, ssio, env, useAccumuloClassLoader, null);
       }
     
       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 {
    +
    +    return loadIteratorsHelper(scope, source, extent, conf, ssiList, ssio, env, useAccumuloClassLoader, classLoaderContext);
    +  }
    +
    +  private static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIteratorsHelper(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<>(ssiList);
         Map<String,Map<String,String>> allOptions = new HashMap<>();
         parseIteratorConfiguration(scope, iters, ssio, allOptions, conf);
    +    if (classLoaderContext == null) {
    --- End diff --
    
    I think this would make sense to leave in the callers. I'm not a fan of null values having implicit "logic" behind them.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] accumulo pull request #196: ACCUMULO-4057 Moved the code to a private static...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] accumulo issue #196: ACCUMULO-4057 Moved the code to a private static method

Posted by lstav <gi...@git.apache.org>.
Github user lstav commented on the issue:

    https://github.com/apache/accumulo/pull/196
  
    Sure thing, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] accumulo issue #196: ACCUMULO-4057 Moved the code to a private static method

Posted by lstav <gi...@git.apache.org>.
Github user lstav commented on the issue:

    https://github.com/apache/accumulo/pull/196
  
    You are welcome! Just pushed the changes to your comment :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---