Beispiel #1
0
  private void addCredentials(MapWork mapWork, DAG dag) {
    Set<String> paths = mapWork.getPathToAliases().keySet();
    if (paths != null && !paths.isEmpty()) {
      Iterator<URI> pathIterator =
          Iterators.transform(
              paths.iterator(),
              new Function<String, URI>() {
                @Override
                public URI apply(String input) {
                  return new Path(input).toUri();
                }
              });

      Set<URI> uris = new HashSet<URI>();
      Iterators.addAll(uris, pathIterator);

      if (LOG.isDebugEnabled()) {
        for (URI uri : uris) {
          LOG.debug("Marking URI as needing credentials: " + uri);
        }
      }
      dag.addURIsForCredentials(uris);
    }
  }