asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[release-0.9.3-pre-rc]: [NO ISSUE][TX] Fix DatasetLock for Multiple Index Builds
Date Sat, 11 Nov 2017 18:33:56 GMT
Michael Blow has posted comments on this change.

Change subject: [NO ISSUE][TX] Fix DatasetLock for Multiple Index Builds
......................................................................


Patch Set 4:

(2 comments)

https://asterix-gerrit.ics.uci.edu/#/c/2144/4/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/lock/DatasetLock.java
File asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/lock/DatasetLock.java:

PS4, Line 93:             boolean interrupted = false;
            :             while (indexBuildCounter.getValue() > 0) {
            :                 try {
            :                     indexBuildCounter.wait();
            :                 } catch (InterruptedException e) {
            :                     interrupted = true;
            :                 }
            :             }
            :             synchronized (dsModifyCounter) {
            :                 dsModifyCounter.increment();
            :             }
            :             if (interrupted) {
            :                 Thread.currentThread().interrupt();
            :             }
I think you can use InterruptUtil.doUninterruptibly() to simplify


PS4, Line 141:                 while (!locked) {
             :                     synchronized (dsModifyCounter) {
             :                         if (dsModifyCounter.getValue() == 0) {
             :                             indexBuildCounter.setValue(indexBuildCounter.getValue()
+ 1);
             :                             locked = true;
             :                         }
             :                     }
             :                     if (!locked) {
             :                         try {
             :                             indexBuildCounter.wait();
             :                         } catch (InterruptedException e) {
             :                             interrupted = true;
             :                         }
             :                     }
             :                 }
             :                 if (interrupted) {
             :                     Thread.currentThread().interrupt();
             :                 }
I think you can use InterruptUtil.doUninterruptibly() to simplify


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2144
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3bea3ff2075d952ab13402b0c445c464b431c0f5
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: release-0.9.3-pre-rc
Gerrit-Owner: abdullah alamoudi <bamousaa@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mblow@apache.org>
Gerrit-HasComments: Yes

Mime
View raw message