geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-1153) BucketOperatorWrapper fails to invoke completion callback.
Date Tue, 05 Apr 2016 22:42:25 GMT

    [ https://issues.apache.org/jira/browse/GEODE-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15227287#comment-15227287
] 

ASF subversion and git services commented on GEODE-1153:
--------------------------------------------------------

Commit 3898a0eda91bfe98e48110aeb8c50257602b6b1b in incubator-geode's branch refs/heads/develop
from [~sboorlagadda]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=3898a0e ]

GEODE-1153: BucketOperatorWrapper fails to invoke completion callback.

  Added ASF headers to BucketOperatorImpl & BucketOperatorWrapper.


> BucketOperatorWrapper fails to invoke completion callback.
> ----------------------------------------------------------
>
>                 Key: GEODE-1153
>                 URL: https://issues.apache.org/jira/browse/GEODE-1153
>             Project: Geode
>          Issue Type: Bug
>          Components: regions
>            Reporter: Sai Boorlagadda
>            Assignee: Sai Boorlagadda
>
> BucketOperatorWrapper.createBucket should invoke completion.onSuccess or completion.onFailure
based on create bucket status.
> In the below code, a completion callback is passed in as a last argument is ignored by
the code.
> {code}
>     @Override
>     public void createRedundantBucket(
>         final InternalDistributedMember targetMember, final int i, 
>         final Map<String, Long> colocatedRegionBytes, final Completion completion)
{
>       
>       if(stats != null) {
>         stats.startBucketCreate(regionCount);
>       }
>       
>       final long start = System.nanoTime();
>       delegate.createRedundantBucket(targetMember, i,  
>           colocatedRegionBytes, new Completion() {
>         @Override
>         public void onSuccess() {
>           long totalBytes = 0;
>           long elapsed= System.nanoTime() - start;
>           if(logger.isDebugEnabled()) {
>             logger.debug("Rebalancing {} redundant bucket {} created on {}", leaderRegion,
i, targetMember);
>           }
>           for (PartitionRebalanceDetailsImpl details : detailSet) {
>             String regionPath = details.getRegionPath();
>             Long lrb = colocatedRegionBytes.get(regionPath);
>             if (lrb != null) { // region could have gone away - esp during shutdow
>               long regionBytes = lrb.longValue();
>               //Only add the elapsed time to the leader region.
>               details.incCreates(regionBytes, 
>                   details.getRegion().equals(leaderRegion) ? elapsed : 0);
>               totalBytes += regionBytes;
>             }
>           }
>           if(stats != null) {
>             stats.endBucketCreate(regionCount, true, totalBytes, elapsed);
>           }
>         }
>         @Override
>         public void onFailure() {
>           long elapsed= System.nanoTime() - start;
>           if (logger.isDebugEnabled()) {
>             logger.debug("Rebalancing {} redundant bucket {} failed creation on {}",
leaderRegion, i, targetMember);
>           }
>           if(stats != null) {
>             stats.endBucketCreate(regionCount, false, 0, elapsed);
>           }
>         }
>       });
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message