jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/3] jena git commit: Rename 'disableWriters' as 'blockWriters'
Date Thu, 14 Jul 2016 14:05:10 GMT
Rename 'disableWriters' as 'blockWriters'


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/ade0f5ac
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/ade0f5ac
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/ade0f5ac

Branch: refs/heads/master
Commit: ade0f5ac133f129bc7e24c5883c391fcc6844887
Parents: ee6a678
Author: Andy Seaborne <andy@apache.org>
Authored: Wed Jul 13 20:23:39 2016 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Wed Jul 13 20:23:39 2016 +0100

----------------------------------------------------------------------
 .../tdb/transaction/TransactionManager.java     | 33 ++++++++++++++------
 1 file changed, 23 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/ade0f5ac/jena-tdb/src/main/java/org/apache/jena/tdb/transaction/TransactionManager.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/transaction/TransactionManager.java
b/jena-tdb/src/main/java/org/apache/jena/tdb/transaction/TransactionManager.java
index 9ed7912..b591b51 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/transaction/TransactionManager.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/transaction/TransactionManager.java
@@ -490,25 +490,38 @@ public class TransactionManager
     }
     
     /** Block until no writers are active.
-     * Must call {@link #enableWriters} later.
-     * Return 'true' if the writers semaphore was grabbed, else false.
-     * This operation must not be nested (will block).
-     * See {@link #tryDisableWriters}.
+     *  When this returns, yhis guarantees that the database is not changing
+     *  and the jounral is flush to disk.
+     * <p> 
+     * The application must call {@link #enableWriters} later.
+     * <p> 
+     * This operation must not be nested (it will block).
+     * 
+     * @see #tryBlockWriters()
+     * @see #enableWriters()
+     * 
      */
-    public void disableWriters() {
+    public void blockWriters() {
         acquireWriterLock(true) ;
     }
 
-    /** Block until no writers are active or, optionally, return if can't at the moment.

-     * Must call {@link #enableWriters} later.
-     * Return 'true' if the writers semaphore was grabbed, else false.
+    /** Block until no writers are active or, optionally, return if can't at the moment.
+     * Return 'true' if the operation succeeded.
+     * <p>
+     * If it returns true, the application must call {@link #enableWriters} later.
+     *  
+     * @see #blockWriters()
+     * @see #enableWriters()
      */
-    public boolean tryDisableWriters() {
+    public boolean tryBlockWriters() {
         return acquireWriterLock(false) ;
     }
 
     /** Allow writers.  
-     * This must be used in conjunction with {@link #disableWriters}
+     * This must be used in conjunction with {@link #blockWriters()} or {@link #tryBlockWriters()}
+     * 
+     * @see #blockWriters()
+     * @see #tryBlockWriters()
      */ 
     public void enableWriters() {
         releaseWriterLock();


Mime
View raw message