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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBooleanStateStore(MasterRegion masterRegion, String stateName, ZKWatcher watcher, String zkPath) -
Method Summary
Modifier and TypeMethodDescriptionbooleanget()Returns true if the flag is on, otherwise falseprotected abstract booleanparseFrom(byte[] bytes) booleanset(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:
IOExceptionorg.apache.zookeeper.KeeperExceptionDeserializationException
-
-
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
-