Class RSGroupInfoManagerImpl

java.lang.Object
org.apache.hadoop.hbase.rsgroup.RSGroupInfoManagerImpl
All Implemented Interfaces:
RSGroupInfoManager

@Private final class RSGroupInfoManagerImpl extends Object implements RSGroupInfoManager
This is an implementation of RSGroupInfoManager which makes use of an HBase table as the persistence store for the group information. It also makes use of zookeeper to store group information needed for bootstrapping during offline mode.

Concurrency

RSGroup state is kept locally in Maps. There is a rsgroup name to cached RSGroupInfo Map at rsGroupMap and a Map of tables to the name of the rsgroup they belong too (in tableMap). These Maps are persisted to the hbase:rsgroup table (and cached in zk) on each modification.

Mutations on state are synchronized but reads can continue without having to wait on an instance monitor, mutations do wholesale replace of the Maps on update -- Copy-On-Write; the local Maps of state are read-only, just-in-case (see flushConfig).

Reads must not block else there is a danger we'll deadlock.

Clients of this class, the RSGroupAdminEndpoint for example, want to query and then act on the results of the query modifying cache in zookeeper without another thread making intermediate modifications. These clients synchronize on the 'this' instance so no other has access concurrently. Reads must be able to continue concurrently.