Search in sources :

Example 1 with CellInfo

use of dmg.cells.nucleus.CellInfo in project dcache by dCache.

the class PoolInfoRequestHandler method getCellInfoRequest.

private CellData getCellInfoRequest() {
    CellData request = new CellData();
    CellInfo info = supplier.get();
    request.setCreationTime(info.getCreationTime());
    request.setDomainName(info.getDomainName());
    request.setCellType(info.getCellType());
    request.setCellName(info.getCellName());
    request.setCellClass(info.getCellClass());
    request.setEventQueueSize(info.getEventQueueSize());
    request.setExpectedQueueTime(info.getExpectedQueueTime());
    request.setLabel("Cell Info");
    CellVersion version = info.getCellVersion();
    request.setRelease(version.getRelease());
    request.setRevision(version.getRevision());
    request.setVersion(version.toString());
    request.setState(info.getState());
    request.setThreadCount(info.getThreadCount());
    return request;
}
Also used : CellInfo(dmg.cells.nucleus.CellInfo) CellVersion(dmg.cells.nucleus.CellVersion) CellData(org.dcache.cells.json.CellData)

Example 2 with CellInfo

use of dmg.cells.nucleus.CellInfo in project dcache by dCache.

the class WebCollectorV3 method messageArrived.

@Override
public void messageArrived(CellMessage message) {
    Object reply = message.getMessageObject();
    int modified = 0;
    if (reply instanceof LoginBrokerInfo) {
        LoginBrokerInfo brokerInfo = (LoginBrokerInfo) reply;
        synchronized (_infoLock) {
            LOGGER.debug("Login broker reports: {}@{}", brokerInfo.getCellName(), brokerInfo.getDomainName());
            if (addQuery(new CellAddressCore(brokerInfo.getCellName(), brokerInfo.getDomainName()))) {
                modified++;
            }
        }
    } else if (reply instanceof PingMessage) {
        synchronized (_infoLock) {
            addQuery(message.getSourceAddress());
        }
    } else {
        CellPath path = message.getSourcePath();
        CellAddressCore address = path.getSourceAddress();
        CellQueryInfo info;
        synchronized (_infoLock) {
            info = _infoMap.get(address);
            if (info == null) {
                // We may have registered the cell as a well known cell
                info = _infoMap.get(new CellAddressCore(address.getCellName()));
                if (info == null) {
                    LOGGER.info("Unexpected reply arrived from: {}", path);
                    return;
                }
            }
        }
        if (reply instanceof CellInfo) {
            LOGGER.debug("CellInfo: {}", ((CellInfo) reply).getCellName());
            info.infoArrived((CellInfo) reply);
        }
        if (reply instanceof PoolManagerCellInfo) {
            Set<CellAddressCore> pools = ((PoolManagerCellInfo) reply).getPoolCells();
            synchronized (_infoLock) {
                for (CellAddressCore pool : pools) {
                    if (addQuery(pool)) {
                        modified++;
                    }
                }
            }
        }
    }
    _sleepHandler.topologyChanged(modified > 0);
}
Also used : CellPath(dmg.cells.nucleus.CellPath) CellAddressCore(dmg.cells.nucleus.CellAddressCore) PoolManagerCellInfo(diskCacheV111.poolManager.PoolManagerCellInfo) HashSet(java.util.HashSet) Set(java.util.Set) PoolCellInfo(diskCacheV111.pools.PoolCellInfo) PoolManagerCellInfo(diskCacheV111.poolManager.PoolManagerCellInfo) CellInfo(dmg.cells.nucleus.CellInfo) PingMessage(dmg.cells.network.PingMessage) LoginBrokerInfo(dmg.cells.services.login.LoginBrokerInfo)

Example 3 with CellInfo

use of dmg.cells.nucleus.CellInfo in project dcache by dCache.

the class WebCollectorV3 method ac_dump_info_$_0_1.

public String ac_dump_info_$_0_1(Args args) {
    long minPingTime = 0;
    StringBuilder buf = new StringBuilder();
    if (args.argc() > 0) {
        minPingTime = Long.parseLong(args.argv(0));
    }
    for (CellQueryInfo info : _infoMap.values()) {
        CellInfo cellInfo = info.getCellInfo();
        long pingTime = info.getPingTime();
        if (pingTime > minPingTime) {
            if (info.isOk()) {
                buf.append("").append(cellInfo.getDomainName()).append(" ").append(cellInfo).append(" ").append(pingTime).append("\n");
            } else if (info.isPresent()) {
                buf.append("").append(cellInfo.getDomainName()).append(" ").append(cellInfo).append("\n");
            }
        }
    }
    return buf.toString();
}
Also used : PoolCellInfo(diskCacheV111.pools.PoolCellInfo) PoolManagerCellInfo(diskCacheV111.poolManager.PoolManagerCellInfo) CellInfo(dmg.cells.nucleus.CellInfo)

Example 4 with CellInfo

use of dmg.cells.nucleus.CellInfo in project dcache by dCache.

the class CellInfoTableWriter method print.

public void print(Collection<PoolCellQueryInfo> itemSet) {
    _html.beginTable("sortable", "cell", "CellName", "domain", "DomainName", "rp", "RP", "th", "TH", "ping", "Ping", "time", "Creation Time", "version", "Version");
    for (Object i : itemSet) {
        try {
            PoolCellQueryInfo info = (PoolCellQueryInfo) i;
            CellInfo cellInfo = info.getPoolCellInfo();
            long pingTime = info.getPingTime();
            if (info.isOk()) {
                printCellInfoRow(cellInfo, pingTime);
            } else {
                printOfflineCellInfoRow(cellInfo.getCellName(), cellInfo.getDomainName().isEmpty() ? "&lt;unknown&gt" : cellInfo.getDomainName());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    _html.endTable();
}
Also used : CellInfo(dmg.cells.nucleus.CellInfo)

Example 5 with CellInfo

use of dmg.cells.nucleus.CellInfo in project dcache by dCache.

the class PoolGroupInfoTableWriter method sumUpSpaces.

private long[] sumUpSpaces(Collection<Object> itemSet) {
    long[] result = new long[4];
    for (Object i : itemSet) {
        try {
            PoolCellQueryInfo info = (PoolCellQueryInfo) i;
            CellInfo cellInfo = info.getPoolCellInfo();
            if (info.isOk() && (cellInfo instanceof PoolCellInfo)) {
                PoolCostInfo.PoolSpaceInfo spaceInfo = ((PoolCellInfo) cellInfo).getPoolCostInfo().getSpaceInfo();
                result[0] += spaceInfo.getTotalSpace();
                result[1] += spaceInfo.getFreeSpace();
                result[2] += spaceInfo.getPreciousSpace();
                result[3] += spaceInfo.getRemovableSpace();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return result;
}
Also used : CellInfo(dmg.cells.nucleus.CellInfo) PoolCellInfo(diskCacheV111.pools.PoolCellInfo) PoolCellInfo(diskCacheV111.pools.PoolCellInfo) PoolCostInfo(diskCacheV111.pools.PoolCostInfo)

Aggregations

CellInfo (dmg.cells.nucleus.CellInfo)13 PoolCellInfo (diskCacheV111.pools.PoolCellInfo)8 PoolManagerCellInfo (diskCacheV111.poolManager.PoolManagerCellInfo)5 PoolCostInfo (diskCacheV111.pools.PoolCostInfo)2 CellPath (dmg.cells.nucleus.CellPath)2 CellVersion (dmg.cells.nucleus.CellVersion)2 StateUpdate (org.dcache.services.info.base.StateUpdate)2 PingMessage (dmg.cells.network.PingMessage)1 CellAddressCore (dmg.cells.nucleus.CellAddressCore)1 InitialisableCellInfo (dmg.cells.nucleus.InitialisableCellInfo)1 GetAllDomainsReply (dmg.cells.services.GetAllDomainsReply)1 GetAllDomainsRequest (dmg.cells.services.GetAllDomainsRequest)1 LoginBrokerInfo (dmg.cells.services.login.LoginBrokerInfo)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Date (java.util.Date)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 TreeMap (java.util.TreeMap)1 ExecutionException (java.util.concurrent.ExecutionException)1