Search in sources :

Example 1 with CellData

use of org.dcache.cells.json.CellData 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 CellData

use of org.dcache.cells.json.CellData in project dcache by dCache.

the class CellInfoServiceImpl method getCellData.

@Override
public CellData getCellData(String address) {
    CellData cached = cache.read(address);
    if (cached == null) {
        CellAddressCore core = new CellAddressCore(address);
        cached = new CellData();
        cached.setCellName(core.getCellName());
        cached.setDomainName(core.getCellDomainName());
        // "Unknown"
        cached.setState(4);
    }
    return cached;
}
Also used : CellAddressCore(dmg.cells.nucleus.CellAddressCore) CellData(org.dcache.cells.json.CellData)

Example 3 with CellData

use of org.dcache.cells.json.CellData in project dcache by dCache.

the class CellInfoFutureProcessor method process.

@Override
protected CellData process(String key, CellInfo received, long sent) {
    CellData cellData = new CellData();
    cellData.setRoundTripTime(System.currentTimeMillis() - sent);
    update(cellData, received);
    return cellData;
}
Also used : CellData(org.dcache.cells.json.CellData)

Example 4 with CellData

use of org.dcache.cells.json.CellData in project dcache by dCache.

the class PoolDataRequestProcessor method process.

@Override
protected PoolInfoWrapper process(String key, PoolDataRequestMessage message, long sent) {
    Serializable errorObject = message.getErrorObject();
    if (errorObject != null) {
        LOGGER.warn("Problem with retrieval of pool data for {}: {}.", key, errorObject.toString());
        return null;
    }
    PoolData poolData = message.getData();
    CellData cellData = poolData == null ? null : poolData.getCellData();
    if (cellData != null) {
        cellData.setRoundTripTime(System.currentTimeMillis() - sent);
    }
    PoolInfoWrapper info = new PoolInfoWrapper();
    info.setKey(key);
    /*
         *  NB:  the counts histogram for file lifetime will be added
         *  by the historical data method below.
         */
    info.setInfo(poolData);
    try {
        handler.addHistoricalData(info);
    } catch (NoRouteToCellException | InterruptedException | TimeoutCacheException e) {
        LOGGER.debug("Could not add historical data for {}: {}.", key, e.getMessage());
    } catch (CacheException e) {
        LOGGER.error("Could not add historical data for {}: {}.", key, e.getMessage());
    }
    return info;
}
Also used : Serializable(java.io.Serializable) PoolInfoWrapper(org.dcache.pool.json.PoolInfoWrapper) CacheException(diskCacheV111.util.CacheException) TimeoutCacheException(diskCacheV111.util.TimeoutCacheException) NoRouteToCellException(dmg.cells.nucleus.NoRouteToCellException) PoolData(org.dcache.pool.json.PoolData) CellData(org.dcache.cells.json.CellData) TimeoutCacheException(diskCacheV111.util.TimeoutCacheException)

Aggregations

CellData (org.dcache.cells.json.CellData)4 CacheException (diskCacheV111.util.CacheException)1 TimeoutCacheException (diskCacheV111.util.TimeoutCacheException)1 CellAddressCore (dmg.cells.nucleus.CellAddressCore)1 CellInfo (dmg.cells.nucleus.CellInfo)1 CellVersion (dmg.cells.nucleus.CellVersion)1 NoRouteToCellException (dmg.cells.nucleus.NoRouteToCellException)1 Serializable (java.io.Serializable)1 PoolData (org.dcache.pool.json.PoolData)1 PoolInfoWrapper (org.dcache.pool.json.PoolInfoWrapper)1