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;
}
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;
}
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;
}
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;
}
Aggregations