use of org.dcache.vehicles.qos.ChangeStickyBitMessage in project dcache by dCache.
the class ReplicaStateAdjuster method sendMessageToRepository.
private synchronized void sendMessageToRepository() {
Message msg;
switch(action) {
case UNSET_PRECIOUS_REPLICA:
msg = new ChangePreciousBitMessage(target, pnfsId);
break;
case PERSIST_REPLICA:
msg = new ChangeStickyBitMessage(target, pnfsId, true);
break;
case CACHE_REPLICA:
msg = new ChangeStickyBitMessage(target, pnfsId, false);
break;
default:
throw new RuntimeException("ReplicaStateAdjuster does not handle " + action + "; this is a bug.");
}
LOGGER.debug("Sending {} message to {} for {}.", action, target, pnfsId);
ACTIVITY_LOGGER.info("Sending {} message to {} for {}.", action, target, pnfsId);
future = pools.send(new CellPath(target), msg);
}
use of org.dcache.vehicles.qos.ChangeStickyBitMessage in project dcache by dCache.
the class QoSMessageHandler method messageArrived.
public Reply messageArrived(ChangeStickyBitMessage message) {
long expiry = message.isSticky() ? StickyRecord.NON_EXPIRING : 0L;
PnfsId pnfsId = message.getPnfsId();
MessageReply<Message> reply = new MessageReply<>();
executor.execute(() -> {
try {
repository.setSticky(pnfsId, SYSTEM_OWNER, expiry, true);
reply.reply(message);
} catch (Exception e) {
reply.fail(message, e);
}
});
return reply;
}
Aggregations