Search in sources :

Example 1 with PoolCostInfo

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());
}
Also used : PoolCostInfo(diskCacheV111.pools.PoolCostInfo)

Example 2 with PoolCostInfo

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);
}
Also used : PoolManagerPoolInformation(diskCacheV111.vehicles.PoolManagerPoolInformation)

Example 3 with PoolCostInfo

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;
}
Also used : PoolCostInfo(diskCacheV111.pools.PoolCostInfo)

Example 4 with PoolCostInfo

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);
}
Also used : PoolManagerPoolUpMessage(diskCacheV111.vehicles.PoolManagerPoolUpMessage) PoolV2Mode(diskCacheV111.pools.PoolV2Mode) PoolCostInfo(diskCacheV111.pools.PoolCostInfo)

Example 5 with PoolCostInfo

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);
}
Also used : PoolManagerPoolUpMessage(diskCacheV111.vehicles.PoolManagerPoolUpMessage) PoolV2Mode(diskCacheV111.pools.PoolV2Mode) PoolCostInfo(diskCacheV111.pools.PoolCostInfo)

Aggregations

PoolCostInfo (diskCacheV111.pools.PoolCostInfo)31 Test (org.junit.Test)12 PoolV2Mode (diskCacheV111.pools.PoolV2Mode)9 CellAddressCore (dmg.cells.nucleus.CellAddressCore)9 PoolManagerPoolUpMessage (diskCacheV111.vehicles.PoolManagerPoolUpMessage)8 CellMessage (dmg.cells.nucleus.CellMessage)6 PoolMgrSelectReadPoolMsg (diskCacheV111.vehicles.PoolMgrSelectReadPoolMsg)5 ArrayList (java.util.ArrayList)5 HashSet (java.util.HashSet)5 FileAttributes (org.dcache.vehicles.FileAttributes)5 PnfsId (diskCacheV111.util.PnfsId)4 CellPath (dmg.cells.nucleus.CellPath)4 URI (java.net.URI)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 FileAttribute (org.dcache.namespace.FileAttribute)4 MessageAction (org.dcache.tests.cells.MockCellEndpoint.MessageAction)4 PnfsGetFileAttributes (org.dcache.vehicles.PnfsGetFileAttributes)4 PoolFetchFileMessage (diskCacheV111.vehicles.PoolFetchFileMessage)3 NamedPoolQueueInfo (diskCacheV111.pools.PoolCostInfo.NamedPoolQueueInfo)2 PoolManagerPoolInformation (diskCacheV111.vehicles.PoolManagerPoolInformation)2