/** * 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. * * @param context * the Accumulo client context * @param tableId * the table id * @param clearCachedState * if true clear the table state in zookeeper before checking status * @return the table state. */ public static TableState getTableState(ClientContext context, Table.ID tableId, boolean clearCachedState) { String statePath = context.getZooKeeperRoot() + Constants.ZTABLES + "/" + tableId.canonicalID() + Constants.ZTABLE_STATE; if (clearCachedState) { Tables.clearCacheByPath(context, statePath); } ZooCache zc = getZooCache(context); byte[] state = zc.get(statePath); if (state == null) return TableState.UNKNOWN; return TableState.valueOf(new String(state, UTF_8)); }