accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjwall <...@git.apache.org>
Subject [GitHub] accumulo pull request: 4148 inmemorymap counter
Date Mon, 28 Mar 2016 16:02:14 GMT
Github user mjwall commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/82#discussion_r57588655
  
    --- 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 --
    
    I made mutate(Mutation, int) simple wrap the mutation in a Collections.singletonList and
call the mutate(List<Mutation>, int) method.  They were slightly different code paths
before.  There is a lock in the mutate(List,int) method, so it was not needing the mutate(Mutation,int)
method any longer.


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