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;
}
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);
}
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();
}
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() ? "<unknown>" : cellInfo.getDomainName());
}
} catch (Exception e) {
e.printStackTrace();
}
}
_html.endTable();
}
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;
}
Aggregations