use of diskCacheV111.vehicles.PoolManagerGetPoolMonitor in project dcache by dCache.
the class InstanceData method loadStorage.
private OptionalLong loadStorage() {
PoolMonitor monitor;
OptionalLong space = OptionalLong.empty();
try {
monitor = poolManagerStub.sendAndWait(new PoolManagerGetPoolMonitor(), 20000, CellEndpoint.SendFlag.RETRY_ON_NO_ROUTE_TO_CELL).getPoolMonitor();
CostModule costModule = monitor.getCostModule();
Collection<PoolCostInfo> costInfos = costModule.getPoolCostInfos();
space = OptionalLong.of(costModule.getPoolCostInfos().stream().map(PoolCostInfo::getSpaceInfo).mapToLong(PoolCostInfo.PoolSpaceInfo::getTotalSpace).sum());
} catch (CacheException | InterruptedException | NoRouteToCellException e) {
LOGGER.error("Could not get storage information; set storage to -1.0. This was caused by: ", e);
}
return space;
}
Aggregations