use of org.dcache.vehicles.resilience.RemoveReplicaMessage in project dcache by dCache.
the class FileOperationHandler method removeTarget.
/**
* <p>Synchronously removes from the target location the cache entry of the
* pnfsid associated with this task. This is done via a message sent to a handler for this
* purpose on the pool itself.</p>
*/
private void removeTarget(PnfsId pnfsId, String target) throws CacheException {
RemoveReplicaMessage msg = new RemoveReplicaMessage(target, pnfsId);
LOGGER.trace("Sending RemoveReplicasMessage {}.", msg);
ACTIVITY_LOGGER.info("Removing {} from {}", pnfsId, target);
Future<RemoveReplicaMessage> future = pools.send(new CellPath(target), msg);
try {
msg = future.get();
LOGGER.trace("Returned ReplicationRepRmMessage {}.", msg);
} catch (InterruptedException | ExecutionException e) {
throw CacheExceptionUtils.getCacheException(CacheException.SELECTED_POOL_FAILED, FileTaskCompletionHandler.FAILED_REMOVE_MESSAGE, pnfsId, Type.REMOVE, target, e);
}
CacheException exception = msg.getErrorObject() == null ? null : CacheExceptionFactory.exceptionOf(msg);
if (exception != null && !CacheExceptionUtils.replicaNotFound(exception)) {
throw CacheExceptionUtils.getCacheException(CacheException.SELECTED_POOL_FAILED, FileTaskCompletionHandler.FAILED_REMOVE_MESSAGE, pnfsId, Type.REMOVE, target, exception);
}
}
Aggregations