Class Tables
- java.lang.Object
-
- org.apache.accumulo.core.client.impl.Tables
-
public class Tables extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
VALID_NAME_REGEX
-
Constructor Summary
Constructors Constructor Description Tables()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
_getTableId(Instance instance, String tableName)
static void
clearCache(Instance instance)
static void
clearCacheByPath(Instance instance, String zooPath)
Clears the zoo cache from instance/root/{PATH}static boolean
exists(Instance instance, String tableId)
static Map<String,String>
getIdToNameMap(Instance instance)
static String
getNamespaceId(Instance instance, String tableId)
Returns the namespace id for a given table ID.static Map<String,String>
getNameToIdMap(Instance instance)
static String
getPrintableTableInfoFromId(Instance instance, String tableId)
static String
getPrintableTableInfoFromName(Instance instance, String tableName)
static String
getPrintableTableNameFromId(Map<String,String> tidToNameMap, String tableId)
static String
getTableId(Instance instance, String tableName)
static String
getTableName(Instance instance, String tableId)
static TableState
getTableState(Instance instance, String tableId)
static TableState
getTableState(Instance instance, String tableId, boolean clearCachedState)
Get the current state of the table using the tableid.static String
qualified(String tableName)
static String
qualified(String tableName, String defaultNamespace)
static Pair<String,String>
qualify(String tableName)
static Pair<String,String>
qualify(String tableName, String defaultNamespace)
-
-
-
Field Detail
-
VALID_NAME_REGEX
public static final String VALID_NAME_REGEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTableId
public static String getTableId(Instance instance, String tableName) throws TableNotFoundException
- Throws:
TableNotFoundException
-
_getTableId
public static String _getTableId(Instance instance, String tableName) throws NamespaceNotFoundException, TableNotFoundException
-
getTableName
public static String getTableName(Instance instance, String tableId) throws TableNotFoundException
- Throws:
TableNotFoundException
-
clearCache
public static void clearCache(Instance instance)
-
clearCacheByPath
public static void clearCacheByPath(Instance instance, String zooPath)
Clears the zoo cache from instance/root/{PATH}- Parameters:
instance
- The Accumulo InstancezooPath
- A zookeeper path
-
getPrintableTableNameFromId
public static String getPrintableTableNameFromId(Map<String,String> tidToNameMap, String tableId)
-
getPrintableTableInfoFromId
public static String getPrintableTableInfoFromId(Instance instance, String tableId)
-
getPrintableTableInfoFromName
public static String getPrintableTableInfoFromName(Instance instance, String tableName)
-
getTableState
public static TableState getTableState(Instance instance, String tableId)
-
getTableState
public static TableState getTableState(Instance instance, String tableId, boolean clearCachedState)
Get the current state of the table using the tableid. The boolean clearCache, if true will clear the table state in zookeeper before fetching the state. Added with ACCUMULO-4574.- Parameters:
instance
- the Accumulo instance.tableId
- the table idclearCachedState
- if true clear the table state in zookeeper before checking status- Returns:
- the table state.
-
getNamespaceId
public static String getNamespaceId(Instance instance, String tableId) throws TableNotFoundException
Returns the namespace id for a given table ID.- Parameters:
instance
- The Accumulo InstancetableId
- The tableId- Returns:
- The namespace id which this table resides in.
- Throws:
IllegalArgumentException
- if the table doesn't exist in ZooKeeperTableNotFoundException
-
-