@InterfaceAudience.Private public abstract class BooleanStateStore extends MasterStateStore
Modifier and Type | Field and Description |
---|---|
private boolean |
on |
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) |
void |
set(boolean on)
Set the flag on/off.
|
protected abstract byte[] |
toByteArray(boolean on) |
getState, setState
private volatile boolean on
protected BooleanStateStore(MasterRegion masterRegion, String stateName, ZKWatcher watcher, String zkPath) throws IOException, org.apache.zookeeper.KeeperException, DeserializationException
IOException
org.apache.zookeeper.KeeperException
DeserializationException
public boolean get()
public void 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
DeserializationException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.