Package org.apache.hadoop.hbase.master
Class MasterStateStore
java.lang.Object
org.apache.hadoop.hbase.master.MasterStateStore
- Direct Known Subclasses:
BooleanStateStore
A state storage which stores the state in master local region.
We used to store some persistent state on zookeeper, so here we provide the ability to migrate
the state from zookeeper.
Since parsing the state may introduce some extra overhead, we make this class abstract and the
get and set state methods protected. Sub classes should store their state in decoded format to
save the extra parsing overhead.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final MasterRegion
private static final byte[]
private final byte[]
-
Constructor Summary
ModifierConstructorDescriptionprotected
MasterStateStore
(MasterRegion masterRegion, String stateName, ZKWatcher watcher, String zkPath) -
Method Summary
-
Field Details
-
LOG
-
QUALIFIER
-
masterRegion
-
stateName
-
-
Constructor Details
-
MasterStateStore
protected MasterStateStore(MasterRegion masterRegion, String stateName, ZKWatcher watcher, String zkPath) throws IOException, org.apache.zookeeper.KeeperException - Throws:
IOException
org.apache.zookeeper.KeeperException
-
-
Method Details
-
getState
- Throws:
IOException
-
setState
- Throws:
IOException
-
get
- Throws:
IOException
-
update
- Throws:
IOException
-
migrate
private byte[] migrate(ZKWatcher watcher, String zkPath) throws org.apache.zookeeper.KeeperException, IOException - Throws:
org.apache.zookeeper.KeeperException
IOException
-
tryMigrate
private void tryMigrate(ZKWatcher watcher, String zkPath) throws IOException, org.apache.zookeeper.KeeperException - Throws:
IOException
org.apache.zookeeper.KeeperException
-