@Override
  public GetSpaceQuotaRegionSizesResponse getSpaceQuotaRegionSizes(RpcController controller,
    GetSpaceQuotaRegionSizesRequest request) throws ServiceException {
    try {
      server.checkInitialized();
      MasterQuotaManager quotaManager = this.server.getMasterQuotaManager();
      GetSpaceQuotaRegionSizesResponse.Builder builder =
        GetSpaceQuotaRegionSizesResponse.newBuilder();
      if (quotaManager != null) {
        Map<RegionInfo, Long> regionSizes = quotaManager.snapshotRegionSizes();
        Map<TableName, Long> regionSizesByTable = new HashMap<>();
        // Translate hregioninfo+long -> tablename+long
        for (Entry<RegionInfo, Long> entry : regionSizes.entrySet()) {
          final TableName tableName = entry.getKey().getTable();
          Long prevSize = regionSizesByTable.get(tableName);
          if (prevSize == null) {
            prevSize = 0L;
          }
          regionSizesByTable.put(tableName, prevSize + entry.getValue());
        }
        // Serialize them into the protobuf
        for (Entry<TableName, Long> tableSize : regionSizesByTable.entrySet()) {
          builder.addSizes(
            RegionSizes.newBuilder().setTableName(ProtobufUtil.toProtoTableName(tableSize.getKey()))
              .setSize(tableSize.getValue()).build());
        }
        return builder.build();
      } else {
        LOG.debug("Received space quota region size report but HMaster is not ready to process it,"
          + "skipping");
      }
      return builder.build();
    } catch (Exception e) {
      throw new ServiceException(e);
    }
  }
@return LOCKED, if procedure is found and it has the lock; else UNLOCKED.
@throws ServiceException if given proc id is found but it is not a LockProcedure.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java