geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschuchardt <...@git.apache.org>
Subject [GitHub] geode pull request #444: Feature/gem 1353
Date Mon, 10 Apr 2017 17:08:56 GMT
Github user bschuchardt commented on a diff in the pull request:

    https://github.com/apache/geode/pull/444#discussion_r110708948
  
    --- Diff: geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java ---
    @@ -1261,7 +1333,14 @@ void basicUpdateEntryVersion(EntryEventImpl event) throws EntryNotFoundException
       }
     
       protected void distributeUpdateEntryVersionOperation(EntryEventImpl event) {
    -    new UpdateEntryVersionOperation(event).distribute();
    +    UpdateEntryVersionOperation op = new UpdateEntryVersionOperation(event);
    +    long viewVersion = -1;
    +    try {
    +      viewVersion = op.startOperation();
    --- End diff --
    
    For cases like this one it would be nice to move the try/finally to a new method in DistributedCacheOperation
and just invoke that method.  Maybe call it distribute()???
    
    ```
    public void distributed() {
      long token;
      try {
        token = startOperation();
        _distribute(); // private method
      } finally {
        endOperation(token);
      }
    }
    ```
    If you do this you can revert the changes you've made to a lot of classes.


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