hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r832259 - /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
Date Tue, 03 Nov 2009 01:50:34 GMT
Author: jdcryans
Date: Tue Nov  3 01:50:34 2009
New Revision: 832259

URL: http://svn.apache.org/viewvc?rev=832259&view=rev
Log:
HBASE-1944 Add a "deferred log flush" attribute to HTD
           caching the boolean

Modified:
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HTableDescriptor.java

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HTableDescriptor.java?rev=832259&r1=832258&r2=832259&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HTableDescriptor.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HTableDescriptor.java Tue Nov  3 01:50:34
2009
@@ -29,6 +29,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
@@ -98,6 +99,7 @@
     
   private volatile Boolean meta = null;
   private volatile Boolean root = null;
+  private Boolean isDeferredLog = null;
 
   // Key is hash of the family name.
   public final Map<byte [], HColumnDescriptor> families =
@@ -374,8 +376,12 @@
   /**
    * @return true if that table's log is hflush by other means
    */
-  public boolean isDeferredLogFlush() {
-    return isSomething(DEFERRED_LOG_FLUSH_KEY, DEFAULT_DEFERRED_LOG_FLUSH);
+  public synchronized boolean isDeferredLogFlush() {
+    if(this.isDeferredLog == null) {
+      this.isDeferredLog =
+          isSomething(DEFERRED_LOG_FLUSH_KEY, DEFAULT_DEFERRED_LOG_FLUSH);
+    }
+    return this.isDeferredLog;
   }
 
   /**



Mime
View raw message