accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <...@git.apache.org>
Subject [GitHub] accumulo pull request: ACCUMULO-4143 Make protective copy of migra...
Date Thu, 11 Feb 2016 22:31:23 GMT
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/68#discussion_r52678587
  
    --- Diff: server/master/src/main/java/org/apache/accumulo/master/Master.java ---
    @@ -1336,7 +1332,11 @@ public void assignedTablet(KeyExtent extent) {
       }
     
       @Override
    -  public Collection<KeyExtent> migrations() {
    -    return migrations.keySet();
    +  public Set<KeyExtent> migrations() {
    +    Set<KeyExtent> migrationsCopy = new HashSet<KeyExtent>();
    +    synchronized (migrations) {
    +      migrationsCopy.addAll(migrations.keySet());
    +    }
    +    return migrationsCopy;
    --- End diff --
    
    > We could change the interface method name to "migrationsSnapshot()" to be clear,
though, and to avoid careless future impl changes which change that semantics.
    
    :+1: I like this general approach. I think migrations are just one place that we follow
this pattern and could benefit from more descriptive method names.


---
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.
---

Mime
View raw message