use of org.dcache.pool.migration.TaskParameters in project dcache by dCache.
the class CopyAdjuster method createTask.
/**
* Wraps the creation of a migration {@link Task}. The task is given a static single pool list
* and a degenerate selection strategy, since the target has already been selected.
*/
private synchronized void createTask(PoolManagerPoolInformation targetInfo, String source) {
LOGGER.debug("Configuring migration task for {}, {}.", pnfsId, action);
StaticSinglePoolList list = new StaticSinglePoolList(targetInfo);
TaskParameters taskParameters = new TaskParameters(pools, // PnfsManager cell stub not used
null, pinManager, executorService, new DegenerateSelectionStrategy(), list, // eager; update should not happen
false, // just move the metadata; not relevant here
false, // compute checksum on update; should not happen
false, // force copy even if pool is not readable
false, // maintain atime
true, // only one copy per task
1);
createTask(taskParameters, source);
if (ACTIVITY_LOGGER.isInfoEnabled()) {
List<String> allPools = list.getPools().stream().map(PoolManagerPoolInformation::getName).collect(Collectors.toList());
ACTIVITY_LOGGER.info("Initiating migration for {} of {} from {} to" + " pools: {}, offline: {}", action, pnfsId, source, allPools, list.getOfflinePools());
}
LOGGER.debug("Created migration task for {} of {}: source {}, list {}.", action, pnfsId, source, list);
}
use of org.dcache.pool.migration.TaskParameters in project dcache by dCache.
the class FileOperationHandler method handleMakeOneCopy.
/**
* <p>Wraps the creation of a migration {@link Task}. The task is given
* a static single pool list and a degenerate selection strategy, since the target has already
* been selected by this handler.</p>
*/
public Task handleMakeOneCopy(FileAttributes attributes) {
PnfsId pnfsId = attributes.getPnfsId();
FileOperation operation = fileOpMap.getOperation(pnfsId);
LOGGER.trace("Configuring migration task for {}.", pnfsId);
StaticSinglePoolList list;
try {
list = new StaticSinglePoolList(poolInfoMap.getPoolManagerInfo(operation.getTarget()));
} catch (NoSuchElementException e) {
CacheException exception = CacheExceptionUtils.getCacheException(CacheException.NO_POOL_CONFIGURED, "Copy %s, could not get PoolManager info for %s: %s.", pnfsId, Type.COPY, poolInfoMap.getPool(operation.getTarget()), e);
completionHandler.taskFailed(pnfsId, exception);
return null;
}
String source = poolInfoMap.getPool(operation.getSource());
TaskParameters taskParameters = new TaskParameters(pools, // PnfsManager cell stub not used
null, pinManager, migrationTaskService, taskSelectionStrategy, list, // eager; update should not happen
false, // isMetaOnly; just move the metadata
false, // compute checksum on update; should not happen
false, // force copy even if pool not readable
false, // maintain atime
true, 1);
Task task = new Task(taskParameters, completionHandler, source, pnfsId, ReplicaState.CACHED, ONLINE_STICKY_RECORD, Collections.EMPTY_LIST, attributes, attributes.getAccessTime());
if (ACTIVITY_LOGGER.isInfoEnabled()) {
List<String> allPools = list.getPools().stream().map(PoolManagerPoolInformation::getName).collect(Collectors.toList());
ACTIVITY_LOGGER.info("Initiating replication of {} from {} to" + " pools: {}, offline: {}", pnfsId, source, allPools, list.getOfflinePools());
}
LOGGER.trace("Created migration task for {}: source {}, list {}.", pnfsId, source, list);
return task;
}
Aggregations