Ejemplo n.º 1
0
 private String providerIdToName(long providerId, Task task) {
   for (DataSource dataSource : task.getTaskConfig().getDataSources()) {
     if (providerId == dataSource.getProviderId()) {
       return dataSource.getProviderName();
     }
   }
   throw new ProviderNotFoundException(task.getName(), providerId);
 }
Ejemplo n.º 2
0
  private void migrateDataSources(Task task) {
    // replace data source references in other data source lookups
    for (DataSource dataSource : task.getTaskConfig().getDataSources()) {
      for (Lookup lookup : dataSource.getLookup()) {
        String oldVal = lookup.getValue();

        String newVal = replaceTaskValue(oldVal, EXPR_PATTERN, task);
        lookup.setValue(newVal);
      }
    }
  }
Ejemplo n.º 3
0
  private void migrateFilters(Task task) {
    for (FilterSet filterSet : task.getTaskConfig().getFilters()) {
      for (Filter filter : filterSet.getFilters()) {
        // replace data source references in filter expressions
        String oldVal = filter.getExpression();

        String newVal = replaceTaskValue(oldVal, EXPR_PATTERN, task);
        filter.setExpression(newVal);
        // also make sure the key is correct
        oldVal = filter.getKey();

        newVal = replaceTaskValue(oldVal, FILTER_KEY_PATTERN, task);
        filter.setKey(newVal);
      }
    }
  }