use of org.apache.helix.task.JobConfig in project helix by apache.
the class TaskDataCache method refresh.
/**
* This refreshes the cluster data by re-fetching the data from zookeeper in an efficient way
*
* @param accessor
*
* @return
*/
public synchronized boolean refresh(HelixDataAccessor accessor, Map<String, ResourceConfig> resourceConfigMap) {
refreshJobContexts(accessor);
// update workflow and job configs.
_workflowConfigMap.clear();
_jobConfigMap.clear();
for (Map.Entry<String, ResourceConfig> entry : resourceConfigMap.entrySet()) {
if (entry.getValue().getRecord().getSimpleFields().containsKey(WorkflowConfig.WorkflowConfigProperty.Dag.name())) {
_workflowConfigMap.put(entry.getKey(), new WorkflowConfig(entry.getValue()));
} else if (entry.getValue().getRecord().getSimpleFields().containsKey(WorkflowConfig.WorkflowConfigProperty.WorkflowID.name())) {
_jobConfigMap.put(entry.getKey(), new JobConfig(entry.getValue()));
}
}
return true;
}
Aggregations