listWork.set(index, localwork);
conditionalWork.setListWorks(listWork);
ConditionalResolver resolver = conditionalTask.getResolver();
if (resolver instanceof ConditionalResolverSkewJoin) {
// get bigKeysDirToTaskMap
ConditionalResolverSkewJoinCtx context = (ConditionalResolverSkewJoinCtx) conditionalTask
.getResolverCtx();
HashMap<Path, Task<? extends Serializable>> bigKeysDirToTaskMap = context
.getDirToTaskMap();
// to avoid concurrent modify the hashmap
HashMap<Path, Task<? extends Serializable>> newbigKeysDirToTaskMap = new HashMap<Path, Task<? extends Serializable>>();
// reset the resolver
for (Map.Entry<Path, Task<? extends Serializable>> entry : bigKeysDirToTaskMap
.entrySet()) {
Task<? extends Serializable> task = entry.getValue();
Path key = entry.getKey();
if (task.equals(currTask)) {
newbigKeysDirToTaskMap.put(key, localTask);
} else {
newbigKeysDirToTaskMap.put(key, task);
}
}
context.setDirToTaskMap(newbigKeysDirToTaskMap);
conditionalTask.setResolverCtx(context);
} else if (resolver instanceof ConditionalResolverCommonJoin) {
// get bigKeysDirToTaskMap
ConditionalResolverCommonJoinCtx context = (ConditionalResolverCommonJoinCtx) conditionalTask
.getResolverCtx();
HashMap<Task<? extends Serializable>, Set<String>> taskToAliases = context.getTaskToAliases();
// to avoid concurrent modify the hashmap
HashMap<Task<? extends Serializable>, Set<String>> newTaskToAliases =
new HashMap<Task<? extends Serializable>, Set<String>>();
// reset the resolver
for (Map.Entry<Task<? extends Serializable>, Set<String>> entry : taskToAliases.entrySet()) {
Task<? extends Serializable> task = entry.getKey();
Set<String> key = new HashSet<String>(entry.getValue());
if (task.equals(currTask)) {
newTaskToAliases.put(localTask, key);
} else {
newTaskToAliases.put(task, key);
}
}
context.setTaskToAliases(newTaskToAliases);
conditionalTask.setResolverCtx(context);
}
}
}
// make current task depends on this new generated localMapJoinTask