org.apache.hadoop.hbase.replication
Class ReplicationStateImpl

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.ReplicationStateZKBase
      extended by org.apache.hadoop.hbase.replication.ReplicationStateImpl
All Implemented Interfaces:
Closeable, ReplicationStateInterface

public class ReplicationStateImpl
extends ReplicationStateZKBase
implements ReplicationStateInterface

ReplicationStateImpl is responsible for maintaining the replication state znode.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.replication.ReplicationStateZKBase
abortable, conf, DISABLED_ZNODE_BYTES, ENABLED_ZNODE_BYTES, ourClusterKey, peerStateNodeName, peersZNode, queuesZNode, replicationZNode, stateZNode, zookeeper
 
Constructor Summary
ReplicationStateImpl(ZooKeeperWatcher zk, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
           
ReplicationStateImpl(ZooKeeperWatcher zk, org.apache.hadoop.conf.Configuration conf, Abortable abortable, AtomicBoolean replicating)
           
 
Method Summary
 void close()
           
 boolean getState()
          Get the current state of replication (i.e.
 void init()
          Initialize the replication state interface.
 void setState(boolean newState)
          Set the state of replication.
 
Methods inherited from class org.apache.hadoop.hbase.replication.ReplicationStateZKBase
getListOfReplicators, peerExists, toByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationStateImpl

public ReplicationStateImpl(ZooKeeperWatcher zk,
                            org.apache.hadoop.conf.Configuration conf,
                            Abortable abortable,
                            AtomicBoolean replicating)

ReplicationStateImpl

public ReplicationStateImpl(ZooKeeperWatcher zk,
                            org.apache.hadoop.conf.Configuration conf,
                            Abortable abortable)
Method Detail

init

public void init()
          throws org.apache.zookeeper.KeeperException
Description copied from interface: ReplicationStateInterface
Initialize the replication state interface.

Specified by:
init in interface ReplicationStateInterface
Throws:
org.apache.zookeeper.KeeperException

getState

public boolean getState()
                 throws org.apache.zookeeper.KeeperException
Description copied from interface: ReplicationStateInterface
Get the current state of replication (i.e. ENABLED or DISABLED).

Specified by:
getState in interface ReplicationStateInterface
Returns:
true if replication is enabled, false otherwise
Throws:
org.apache.zookeeper.KeeperException

setState

public void setState(boolean newState)
              throws org.apache.zookeeper.KeeperException
Description copied from interface: ReplicationStateInterface
Set the state of replication.

Specified by:
setState in interface ReplicationStateInterface
Throws:
org.apache.zookeeper.KeeperException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.