@InterfaceAudience.Private public abstract class BooleanStateStore extends MasterStateStore
| Modifier | Constructor and Description |
|---|---|
protected |
BooleanStateStore(MasterRegion masterRegion,
String stateName,
ZKWatcher watcher,
String zkPath) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
get()
Returns true if the flag is on, otherwise false
|
protected abstract boolean |
parseFrom(byte[] bytes) |
boolean |
set(boolean on)
Set the flag on/off.
|
protected abstract byte[] |
toByteArray(boolean on) |
getState, setStateprotected BooleanStateStore(MasterRegion masterRegion, String stateName, ZKWatcher watcher, String zkPath) throws IOException, org.apache.zookeeper.KeeperException, DeserializationException
IOExceptionorg.apache.zookeeper.KeeperExceptionDeserializationExceptionpublic boolean get()
public boolean set(boolean on)
throws IOException
on - true if the flag should be on, false otherwiseIOException - if the operation failsprotected abstract byte[] toByteArray(boolean on)
protected abstract boolean parseFrom(byte[] bytes)
throws DeserializationException
DeserializationExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.