HBASE-1944 Add a "deferred log flush" attribute to HTD
caching the boolean git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@832259 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
96dfa4a2bf
commit
4631663ed8
|
@ -29,6 +29,7 @@ import java.util.Iterator;
|
|||
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 @@ public class HTableDescriptor implements WritableComparable<HTableDescriptor> {
|
|||
|
||||
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 @@ public class HTableDescriptor implements WritableComparable<HTableDescriptor> {
|
|||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue