@Override
  protected void chore() {
    try {
      // check whether quotaTable is present or not.
      if (!quotaTablePresent && !checkQuotaTableExists()) {
        LOG.info("Quota table not found, skipping quota manager cache refresh.");
        return;
      }
      // since quotaTable is present so setting the flag as true.
      quotaTablePresent = true;
      if (LOG.isTraceEnabled()) {
        LOG.trace("Reading current quota snapshots from hbase:quota.");
      }
      // Get the snapshots that the quota manager is currently aware of
      final Map<TableName, SpaceQuotaSnapshot> currentSnapshots = getManager().copyQuotaSnapshots();
      // Read the new snapshots from the quota table
      final Map<TableName, SpaceQuotaSnapshot> newSnapshots = fetchSnapshotsFromQuotaTable();
      if (LOG.isTraceEnabled()) {
        LOG.trace(currentSnapshots.size() + " table quota snapshots are collected, " + "read "
          + newSnapshots.size() + " from the quota table.");
      }
      // Iterate over each new quota snapshot
      for (Entry<TableName, SpaceQuotaSnapshot> entry : newSnapshots.entrySet()) {
        final TableName tableName = entry.getKey();
        final SpaceQuotaSnapshot newSnapshot = entry.getValue();
        // May be null!
        final SpaceQuotaSnapshot currentSnapshot = currentSnapshots.get(tableName);
        if (LOG.isTraceEnabled()) {
          LOG.trace(tableName + ": current=" + currentSnapshot + ", new=" + newSnapshot);
        }
        if (!newSnapshot.equals(currentSnapshot)) {
          // We have a new snapshot.
          // We might need to enforce it or disable the enforcement or switch policy
          boolean currInViolation = isInViolation(currentSnapshot);
          boolean newInViolation = newSnapshot.getQuotaStatus().isInViolation();
          if (!currInViolation && newInViolation) {
            if (LOG.isTraceEnabled()) {
              LOG.trace("Enabling " + newSnapshot + " on " + tableName);
            }
            getManager().enforceViolationPolicy(tableName, newSnapshot);
          } else if (currInViolation && !newInViolation) {
            if (LOG.isTraceEnabled()) {
              LOG.trace("Removing quota violation policy on " + tableName);
            }
            getManager().disableViolationPolicyEnforcement(tableName);
          } else if (currInViolation && newInViolation) {
            if (LOG.isTraceEnabled()) {
              LOG.trace("Switching quota violation policy on " + tableName + " from "
                + currentSnapshot + " to " + newSnapshot);
            }
            getManager().enforceViolationPolicy(tableName, newSnapshot);
          }
        }
      }

      // Disable violation policy for all such tables which have been removed in new snapshot
      for (TableName tableName : currentSnapshots.keySet()) {
        // check whether table was removed in new snapshot
        if (!newSnapshots.containsKey(tableName)) {
          if (LOG.isTraceEnabled()) {
            LOG.trace("Removing quota violation policy on " + tableName);
          }
          getManager().disableViolationPolicyEnforcement(tableName);
        }
      }

      // We're intentionally ignoring anything extra with the currentSnapshots. If we were missing
      // information from the RegionServers to create an accurate SpaceQuotaSnapshot in the Master,
      // the Master will generate a new SpaceQuotaSnapshot which represents this state. This lets
      // us avoid having to do anything special with currentSnapshots here.

      // Update the snapshots in the manager
      getManager().updateQuotaSnapshot(newSnapshots);
    } catch (IOException e) {
      LOG.warn("Caught exception while refreshing enforced quota violation policies, will retry.",
        e);
    }
  }
A {@link ScheduledChore} which periodically updates the {@link RegionServerSpaceQuotaManager}
with information from the hbase:quota.
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/SpaceQuotaRefresherChore.java