>From Murtadha Hubail <[email protected]>:

Murtadha Hubail has submitted this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18777 )

Change subject: [NO ISSUE][STO] Add a way to wait only for flushes
......................................................................

[NO ISSUE][STO] Add a way to wait only for flushes

- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- Add a method that can be used by extentions to wait only for
  pending fllushes on a dataset rather than all IO ops.

Ext-ref: MB-62692
Change-Id: I02daf3cd9680070d02fd133572950e37e68fe319
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18777
Integration-Tests: Jenkins <[email protected]>
Reviewed-by: Murtadha Hubail <[email protected]>
Reviewed-by: Michael Blow <[email protected]>
Tested-by: Murtadha Hubail <[email protected]>
---
M 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
1 file changed, 38 insertions(+), 0 deletions(-)

Approvals:
  Murtadha Hubail: Looks good to me, but someone else must approve; Verified
  Michael Blow: Looks good to me, approved
  Anon. E. Moose #1000171:
  Jenkins: Verified




diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
index 87a3c2f..bb28ef1 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
@@ -280,6 +280,20 @@
         }
     }

+    public void waitForFlushes() throws HyracksDataException {
+        logManager.log(waitLog);
+        synchronized (this) {
+            while (pendingFlushes > 0) {
+                try {
+                    wait();
+                } catch (InterruptedException e) {
+                    Thread.currentThread().interrupt();
+                    throw HyracksDataException.create(e);
+                }
+            }
+        }
+    }
+
     public synchronized int getPendingFlushes() {
         return pendingFlushes;
     }

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18777
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: trinity
Gerrit-Change-Id: I02daf3cd9680070d02fd133572950e37e68fe319
Gerrit-Change-Number: 18777
Gerrit-PatchSet: 3
Gerrit-Owner: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Wail Alkowaileet <[email protected]>
Gerrit-MessageType: merged

Reply via email to