示例#1
0
 /**
  * Computes total quota allocations.
  *
  * @return Total allocated quota.
  * @throws StorageException if there was a problem fetching quotas from storage.
  */
 public Metric computeQuotaAllocationTotals() throws StorageException {
   return storage.read(
       storeProvider -> {
         Metric allocation = new Metric();
         for (IResourceAggregate quota : storeProvider.getQuotaStore().fetchQuotas().values()) {
           allocation.accumulate(quota);
         }
         return allocation;
       });
 }
示例#2
0
 @Override
 protected void accumulate(ITaskConfig task) {
   if (type.filter.apply(task)) {
     super.accumulate(task);
   }
 }