Package org.apache.hadoop.hbase.master
Class BooleanStateStore
java.lang.Object
org.apache.hadoop.hbase.master.MasterStateStore
org.apache.hadoop.hbase.master.BooleanStateStore
- Direct Known Subclasses:
LoadBalancerStateStore
,RegionNormalizerStateStore
,ReplicationPeerModificationStateStore
,SnapshotCleanupStateStore
,SplitOrMergeStateStore.SwitchStateStore
Store a boolean state.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
BooleanStateStore
(MasterRegion masterRegion, String stateName, ZKWatcher watcher, String zkPath) -
Method Summary
Modifier and TypeMethodDescriptionboolean
get()
Returns true if the flag is on, otherwise falseprotected abstract boolean
parseFrom
(byte[] bytes) boolean
set
(boolean on) Set the flag on/off.protected abstract byte[]
toByteArray
(boolean on) Methods inherited from class org.apache.hadoop.hbase.master.MasterStateStore
getState, setState
-
Field Details
-
on
-
-
Constructor Details
-
BooleanStateStore
protected BooleanStateStore(MasterRegion masterRegion, String stateName, ZKWatcher watcher, String zkPath) throws IOException, org.apache.zookeeper.KeeperException, DeserializationException - Throws:
IOException
org.apache.zookeeper.KeeperException
DeserializationException
-
-
Method Details
-
get
Returns true if the flag is on, otherwise false -
set
Set the flag on/off.- Parameters:
on
- true if the flag should be on, false otherwise- Returns:
- returns the previous state
- Throws:
IOException
- if the operation fails
-
toByteArray
-
parseFrom
- Throws:
DeserializationException
-