use of org.smartdata.hdfs.action.move.AbstractMoveFileAction in project SSM by Intel-bigdata.
the class CmdletManager method updateStorageIfNeeded.
// Todo: remove this implementation
private void updateStorageIfNeeded(ActionInfo info) throws ActionException {
SmartAction action = ActionRegistry.createAction(info.getActionName());
if (action instanceof AbstractMoveFileAction) {
String policy = ((AbstractMoveFileAction) action).getStoragePolicy();
Map<String, String> args = info.getArgs();
if (policy == null) {
policy = args.get(AbstractMoveFileAction.STORAGE_POLICY);
}
String path = args.get(AbstractMoveFileAction.FILE_PATH);
try {
String result = info.getResult();
result = result == null ? "" : result;
if (!result.contains("UpdateStoragePolicy=false")) {
metaStore.updateFileStoragePolicy(path, policy);
}
} catch (MetaStoreException e) {
LOG.error("Failed to update storage policy {} for file {}", policy, path, e);
}
}
}
Aggregations