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: 4148 inmemorymap counter
Date Mon, 28 Mar 2016 14:08:54 GMT
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/82#discussion_r57574698
  
    --- Diff: server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java ---
    @@ -519,36 +520,25 @@ protected void finalize() throws Throwable {
         }
       }
     
    -  private void _mutate(Mutation mutation, int mutationCount) {
    +  private int _mutate(Mutation mutation, int mutationCount) {
     
         List<ColumnUpdate> updates = mutation.getUpdates();
         if (updates.size() == 1) {
           ColumnUpdate update = updates.get(0);
           singleUpdate(nmPointer, mutation.getRow(), update.getColumnFamily(), update.getColumnQualifier(),
update.getColumnVisibility(), update.getTimestamp(),
    -          update.isDeleted(), update.getValue(), mutationCount);
    +          update.isDeleted(), update.getValue(), mutationCount++);
         } else if (updates.size() > 1) {
           long uid = startUpdate(nmPointer, mutation.getRow());
           for (ColumnUpdate update : updates) {
             update(nmPointer, uid, update.getColumnFamily(), update.getColumnQualifier(),
update.getColumnVisibility(), update.getTimestamp(), update.isDeleted(),
    -            update.getValue(), mutationCount);
    +            update.getValue(), mutationCount++);
           }
    -
         }
    +    return mutationCount;
       }
     
       public void mutate(Mutation mutation, int mutationCount) {
    -    wlock.lock();
    --- End diff --
    
    Is this write lock removal because it was unnecessary? (`mutate(List, int)` was re-grabbing
the same lock)


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