excludeList.addAll(computeExcludeList(mapPair[1])); } else if (mapPair[0].equals("transitive")) { if (mapPair[1].toLowerCase().equals("true")) {
List<URI> resolveAndDownload(ResourceType t, String value, boolean convertToUnix) throws URISyntaxException, IOException { URI uri = createURI(value); if (getURLType(value).equals("file")) { return Arrays.asList(uri); } else if (getURLType(value).equals("ivy")) { return dependencyResolver.downloadDependencies(uri); } else if (getURLType(value).equals("hdfs")) { return Arrays.asList(createURI(downloadResource(value, convertToUnix))); } else { throw new RuntimeException("Invalid url " + uri); } }
/** * * @param uri * @return List of URIs of downloaded jars * @throws URISyntaxException * @throws IOException */ public List<URI> downloadDependencies(URI uri) throws URISyntaxException, IOException { Map<String, Object> dependencyMap = new HashMap<String, Object>(); String authority = uri.getAuthority(); if (authority == null) { throw new URISyntaxException(authority, "Invalid url: Expected 'org:module:version', found null"); } String[] authorityTokens = authority.toLowerCase().split(":"); if (authorityTokens.length != 3) { throw new URISyntaxException(authority, "Invalid url: Expected 'org:module:version', found " + authority); } dependencyMap.put("org", authorityTokens[0]); dependencyMap.put("module", authorityTokens[1]); dependencyMap.put("version", authorityTokens[2]); Map<String, Object> queryMap = parseQueryString(uri.getQuery()); if (queryMap != null) { dependencyMap.putAll(queryMap); } return grab(dependencyMap); }
public SessionState(HiveConf conf, String userName) { this.conf = conf; this.userName = userName; if (LOG.isDebugEnabled()) { LOG.debug("SessionState user: " + userName); } isSilent = conf.getBoolVar(HiveConf.ConfVars.HIVESESSIONSILENT); ls = new LineageState(); resourceMaps = new ResourceMaps(); dependencyResolver = new DependencyResolver(); // Must be deterministic order map for consistent q-test output across Java versions overriddenConfigurations = new LinkedHashMap<String, String>(); overriddenConfigurations.putAll(HiveConf.getConfSystemProperties()); // if there isn't already a session name, go ahead and create it. if (StringUtils.isEmpty(conf.getVar(HiveConf.ConfVars.HIVESESSIONID))) { conf.setVar(HiveConf.ConfVars.HIVESESSIONID, makeSessionId()); } parentLoader = JavaUtils.getClassLoader(); }