org.apache.hadoop.hbase.zookeeper
Class ZKTableReadOnly

java.lang.Object
  extended by org.apache.hadoop.hbase.zookeeper.ZKTableReadOnly

@InterfaceAudience.Private
public class ZKTableReadOnly
extends Object

Non-instantiable class that provides helper functions for clients other than AssignmentManager for reading the state of a table in ZK.

Does not cache state like ZKTable, actually reads from ZK each call.


Method Summary
static Set<TableName> getDisabledOrDisablingTables(ZooKeeperWatcher zkw)
          Gets a list of all the tables set as disabled in zookeeper.
static Set<TableName> getDisabledTables(ZooKeeperWatcher zkw)
          Gets a list of all the tables set as disabled in zookeeper.
static boolean isDisabledTable(ZooKeeperWatcher zkw, TableName tableName)
          Go to zookeeper and see if state of table is ZooKeeperProtos.Table.State#DISABLED.
static boolean isDisablingOrDisabledTable(ZooKeeperWatcher zkw, TableName tableName)
          Go to zookeeper and see if state of table is ZooKeeperProtos.Table.State#DISABLING of ZooKeeperProtos.Table.State#DISABLED.
static boolean isEnabledTable(ZooKeeperWatcher zkw, TableName tableName)
          Go to zookeeper and see if state of table is ZooKeeperProtos.Table.State#ENABLED.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isDisabledTable

public static boolean isDisabledTable(ZooKeeperWatcher zkw,
                                      TableName tableName)
                               throws org.apache.zookeeper.KeeperException
Go to zookeeper and see if state of table is ZooKeeperProtos.Table.State#DISABLED. This method does not use cache. This method is for clients other than AssignmentManager

Parameters:
zkw -
tableName -
Returns:
True if table is enabled.
Throws:
org.apache.zookeeper.KeeperException

isEnabledTable

public static boolean isEnabledTable(ZooKeeperWatcher zkw,
                                     TableName tableName)
                              throws org.apache.zookeeper.KeeperException
Go to zookeeper and see if state of table is ZooKeeperProtos.Table.State#ENABLED. This method does not use cache. This method is for clients other than AssignmentManager

Parameters:
zkw -
tableName -
Returns:
True if table is enabled.
Throws:
org.apache.zookeeper.KeeperException

isDisablingOrDisabledTable

public static boolean isDisablingOrDisabledTable(ZooKeeperWatcher zkw,
                                                 TableName tableName)
                                          throws org.apache.zookeeper.KeeperException
Go to zookeeper and see if state of table is ZooKeeperProtos.Table.State#DISABLING of ZooKeeperProtos.Table.State#DISABLED. This method does not use cache. This method is for clients other than AssignmentManager.

Parameters:
zkw -
tableName -
Returns:
True if table is enabled.
Throws:
org.apache.zookeeper.KeeperException

getDisabledTables

public static Set<TableName> getDisabledTables(ZooKeeperWatcher zkw)
                                        throws org.apache.zookeeper.KeeperException
Gets a list of all the tables set as disabled in zookeeper.

Returns:
Set of disabled tables, empty Set if none
Throws:
org.apache.zookeeper.KeeperException

getDisabledOrDisablingTables

public static Set<TableName> getDisabledOrDisablingTables(ZooKeeperWatcher zkw)
                                                   throws org.apache.zookeeper.KeeperException
Gets a list of all the tables set as disabled in zookeeper.

Returns:
Set of disabled tables, empty Set if none
Throws:
org.apache.zookeeper.KeeperException


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