use of diskCacheV111.pools.PoolCostInfo in project dcache by dCache.
the class SymbolTable method put.
public void put(String name, PoolManagerPoolInformation info) {
PoolCostInfo cost = info.getPoolCostInfo();
put(name + ".name", info.getName());
put(name + ".cpuCost", info.getCpuCost());
put(name + ".free", (cost == null) ? 0 : cost.getSpaceInfo().getFreeSpace());
put(name + ".total", (cost == null) ? 0 : cost.getSpaceInfo().getTotalSpace());
put(name + ".removable", (cost == null) ? 0 : cost.getSpaceInfo().getRemovableSpace());
put(name + ".used", (cost == null) ? 0 : cost.getSpaceInfo().getUsedSpace());
}
use of diskCacheV111.pools.PoolCostInfo in project dcache by dCache.
the class PoolInfoMap method setPoolInfo.
/**
* Called under write lock
*/
private void setPoolInfo(String pool, PoolV2Mode mode, ImmutableMap<String, String> tags, PoolCostInfo cost) {
Integer pindex = safeIndexOf(pool, pools);
PoolInformation entry = new PoolInformation(pool, pindex);
entry.update(mode, tags, cost);
poolInfo.put(pindex, entry);
}
use of diskCacheV111.pools.PoolCostInfo in project dcache by dCache.
the class TestCostModule method buildPoolCost.
private static PoolCostInfo buildPoolCost(String name, int moverActive, int moverMaxActive, int moverQueued, int restoreActive, int restoreMaxActive, int restoreQueued, int storeActive, int storeMaxActive, int storeQueued, long total, long free, long precious, long removable) {
PoolCostInfo poolCost = new PoolCostInfo(name, IoQueueManager.DEFAULT_QUEUE);
poolCost.setQueueSizes(restoreActive, restoreMaxActive, restoreQueued, storeActive, storeMaxActive, storeQueued);
poolCost.addExtendedMoverQueueSizes(IoQueueManager.DEFAULT_QUEUE, moverActive, moverMaxActive, moverQueued, 0, 0);
poolCost.setSpaceUsage(total, free, precious, removable);
return poolCost;
}
use of diskCacheV111.pools.PoolCostInfo in project dcache by dCache.
the class CostModuleTest method buildPoolUpMessageWithCost.
/**
* Create a pool-up message for a pool with the given space parameters
*
* @param poolName name of the pool
* @param totalSpace total capacity of the pool in Gigabytes
* @param freeSpace space not yet used in Gigabytes
* @param preciousSpace space used by files marked precious in Gigabytes
* @param removableSpace space used by files that are removable in Gigabytes
* @return
*/
private static PoolManagerPoolUpMessage buildPoolUpMessageWithCost(String poolName, long totalSpace, long freeSpace, long preciousSpace, long removableSpace) {
PoolV2Mode poolMode = new PoolV2Mode(PoolV2Mode.ENABLED);
PoolCostInfo poolCost = new PoolCostInfo(poolName, IoQueueManager.DEFAULT_QUEUE);
poolCost.setSpaceUsage(GiB.toBytes(totalSpace), GiB.toBytes(freeSpace), GiB.toBytes(preciousSpace), GiB.toBytes(removableSpace));
long serialId = System.currentTimeMillis();
return new PoolManagerPoolUpMessage(poolName, serialId, poolMode, poolCost);
}
use of diskCacheV111.pools.PoolCostInfo in project dcache by dCache.
the class CostModuleTest method buildPoolUpMessageWithCostAndQueue.
/**
* Create a pool-up message for a pool with the given space parameters and mover values
*
* @param poolName name of the pool
* @param totalSpace total capacity of the pool in Gigabytes
* @param freeSpace space not yet used in Gigabytes
* @param preciousSpace space used by files marked precious in Gigabytes
* @param removableSpace space used by files that are removable in Gigabytes ...
* @return
*/
private static PoolManagerPoolUpMessage buildPoolUpMessageWithCostAndQueue(String poolName, long totalSpace, long freeSpace, long preciousSpace, long removableSpace, int moverActive, int moverMaxActive, int moverQueued, int restoreActive, int restoreMaxActive, int restoreQueued, int storeActive, int storeMaxActive, int storeQueued) {
PoolV2Mode poolMode = new PoolV2Mode(PoolV2Mode.ENABLED);
PoolCostInfo poolCost = new PoolCostInfo(poolName, IoQueueManager.DEFAULT_QUEUE);
poolCost.setSpaceUsage(GiB.toBytes(totalSpace), GiB.toBytes(freeSpace), GiB.toBytes(preciousSpace), GiB.toBytes(removableSpace));
poolCost.setQueueSizes(restoreActive, restoreMaxActive, restoreQueued, storeActive, storeMaxActive, storeQueued);
poolCost.addExtendedMoverQueueSizes(IoQueueManager.DEFAULT_QUEUE, moverActive, moverMaxActive, moverQueued, 0, 0);
long serialId = System.currentTimeMillis();
return new PoolManagerPoolUpMessage(poolName, serialId, poolMode, poolCost);
}
Aggregations