예제 #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);
 }
예제 #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);
      }
    }
  }
예제 #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);
      }
    }
  }