/** * Specify that the input jar should be added to workers' classpath on distributed mode. Jars with lower priority value * will appear first in the classpath. Default priority is 0. */ public EmbeddedGobblin distributeJarByClassWithPriority(Class<?> klazz, int priority) { return distributeJarWithPriority(ClassUtil.findContainingJar(klazz), priority); }
public EmbeddedGobblinDistcp(Path from, Path to) throws JobTemplate.TemplateException, IOException { super("Distcp"); try { setTemplate(ResourceBasedJobTemplate.forResourcePath("templates/distcp.template")); } catch (URISyntaxException | SpecNotFoundException exc) { throw new RuntimeException("Could not instantiate an " + EmbeddedGobblinDistcp.class.getName(), exc); } this.setConfiguration("from", from.toString()); this.setConfiguration("to", to.toString()); // Infer source and target fs uris from the input paths this.setConfiguration(ConfigurationKeys.SOURCE_FILEBASED_FS_URI, from.getFileSystem(new Configuration()).getUri().toString()); this.setConfiguration(ConfigurationKeys.WRITER_FILE_SYSTEM_URI, to.getFileSystem(new Configuration()).getUri().toString()); // add gobblin-data-management jar to distributed jars this.distributeJar(ClassUtil.findContainingJar(CopySource.class)); }
LOGGER.debug("{}:// = {} from {}", fs.getScheme(), fs.getClass(), ClassUtil.findContainingJar(fs.getClass())); ClassUtil.findContainingJar(fs.getClass())); LOGGER.info("Full exception loading: {}", fs, e);
public static void main(String[] args) { LOG.debug("version: "+ getVersion()); System.out.println("Hadoop " + getVersion()); System.out.println("Source code repository " + getUrl() + " -r " + getRevision()); System.out.println("Compiled by " + getUser() + " on " + getDate()); System.out.println("Compiled with protoc " + getProtocVersion()); System.out.println("From source with checksum " + getSrcChecksum()); System.out.println("This command was run using " + ClassUtil.findContainingJar(VersionInfo.class)); } }
String hiveExecJarPath = ClassUtil.findContainingJar(Class.forName("org.apache.hadoop.hive.ql.Driver")); .findContainingJar(Class.forName("org.apache.hive.hcatalog.mapreduce.HCatInputFormat")); StringUtil.appendWithSeparator(kylinDependency, hiveHCatJarPath); logger.debug("hive-catalog jar file: " + hiveHCatJarPath); .findContainingJar(Class.forName("org.apache.hadoop.hive.metastore.api.Table")); StringUtil.appendWithSeparator(kylinDependency, hiveMetaStoreJarPath); logger.debug("hive-metastore jar file: " + hiveMetaStoreJarPath); try { String kafkaClientJarPath = ClassUtil .findContainingJar(Class.forName("org.apache.kafka.clients.consumer.KafkaConsumer")); StringUtil.appendWithSeparator(kylinDependency, kafkaClientJarPath); logger.debug("kafka jar file: " + kafkaClientJarPath);
/** * Find a jar that contains a class of the same name, if any. * It will return a jar file, even if that is not the first thing * on the class path that has a class with the same name. * * @param my_class the class to find. * @return a jar file that contains the class, or null. */ public static String findContainingJar(Class my_class) { return ClassUtil.findContainingJar(my_class); }
/** * Find a jar that contains a class of the same name, if any. * It will return a jar file, even if that is not the first thing * on the class path that has a class with the same name. * * @param my_class the class to find. * @return a jar file that contains the class, or null. */ public static String findContainingJar(Class my_class) { return ClassUtil.findContainingJar(my_class); }
/** * Find a jar that contains a class of the same name, if any. * It will return a jar file, even if that is not the first thing * on the class path that has a class with the same name. * * @param my_class the class to find. * @return a jar file that contains the class, or null. */ public static String findContainingJar(Class my_class) { return ClassUtil.findContainingJar(my_class); }
/** * Find a jar that contains a class of the same name, if any. * It will return a jar file, even if that is not the first thing * on the class path that has a class with the same name. * * @param my_class the class to find. * @return a jar file that contains the class, or null. */ public static String findContainingJar(Class my_class) { return ClassUtil.findContainingJar(my_class); }
/** * Set the job's jar file by finding an example class location. * * @param cls the example class. */ public void setJarByClass(Class cls) { String jar = ClassUtil.findContainingJar(cls); if (jar != null) { setJar(jar); } }
/** * Specify that the input jar should be added to workers' classpath on distributed mode. Jars with lower priority value * will appear first in the classpath. Default priority is 0. */ public EmbeddedGobblin distributeJarByClassWithPriority(Class<?> klazz, int priority) { return distributeJarWithPriority(ClassUtil.findContainingJar(klazz), priority); }
/** * Specify that the input jar should be added to workers' classpath on distributed mode. Jars with lower priority value * will appear first in the classpath. Default priority is 0. */ public EmbeddedGobblin distributeJarByClassWithPriority(Class<?> klazz, int priority) { return distributeJarWithPriority(ClassUtil.findContainingJar(klazz), priority); }
/** * Set the job's jar file by finding an example class location. * * @param cls the example class. */ public void setJarByClass(Class cls) { String jar = ClassUtil.findContainingJar(cls); if (jar != null) { setJar(jar); } }
/** * Set the job's jar file by finding an example class location. * * @param cls the example class. */ public void setJarByClass(Class cls) { String jar = ClassUtil.findContainingJar(cls); if (jar != null) { setJar(jar); } }
/** * Set the job's jar file by finding an example class location. * * @param cls the example class. */ public void setJarByClass(Class cls) { String jar = ClassUtil.findContainingJar(cls); if (jar != null) { setJar(jar); } }
public static void main(String[] args) { if (args.length != 1) { System.err.println("Invalid no. of args. Usage: VersionInfo <component-name>"); System.exit(-1); } VersionInfo versionInfo = new VersionInfo(args[0]); System.out.println("VersionInfo: " + versionInfo.toString()); System.out.println("This command was run using " + ClassUtil.findContainingJar(VersionInfo.class)); }
/** * @param args Command line arguments */ public static void main(String[] args) throws Exception { Client client = new Client(ClassUtil.findContainingJar(ApplicationMaster.class)); System.exit(ToolRunner.run(new YarnConfiguration(), client, args)); }
private static void loadFileSystems() { synchronized (FileSystem.class) { if (!FILE_SYSTEMS_LOADED) { ServiceLoader<FileSystem> serviceLoader = ServiceLoader.load(FileSystem.class); Iterator<FileSystem> it = serviceLoader.iterator(); while (it.hasNext()) { FileSystem fs = null; try { fs = it.next(); try { SERVICE_FILE_SYSTEMS.put(fs.getScheme(), fs.getClass()); } catch (Exception e) { LOG.warn("Cannot load: " + fs + " from " + ClassUtil.findContainingJar(fs.getClass()), e); } } catch (ServiceConfigurationError ee) { LOG.warn("Cannot load filesystem", ee); } } FILE_SYSTEMS_LOADED = true; } } }
private static void loadFileSystems() { synchronized (FileSystem.class) { if (!FILE_SYSTEMS_LOADED) { ServiceLoader<FileSystem> serviceLoader = ServiceLoader.load(FileSystem.class); Iterator<FileSystem> it = serviceLoader.iterator(); while (it.hasNext()) { FileSystem fs = null; try { fs = it.next(); try { SERVICE_FILE_SYSTEMS.put(fs.getScheme(), fs.getClass()); } catch (Exception e) { LOG.warn("Cannot load: " + fs + " from " + ClassUtil.findContainingJar(fs.getClass()), e); } } catch (ServiceConfigurationError ee) { LOG.warn("Cannot load filesystem", ee); } } FILE_SYSTEMS_LOADED = true; } } }
private static void loadFileSystems() { synchronized (FileSystem.class) { if (!FILE_SYSTEMS_LOADED) { ServiceLoader<FileSystem> serviceLoader = ServiceLoader.load(FileSystem.class); Iterator<FileSystem> it = serviceLoader.iterator(); while (it.hasNext()) { FileSystem fs = null; try { fs = it.next(); try { SERVICE_FILE_SYSTEMS.put(fs.getScheme(), fs.getClass()); } catch (Exception e) { LOG.warn("Cannot load: " + fs + " from " + ClassUtil.findContainingJar(fs.getClass()), e); } } catch (ServiceConfigurationError ee) { LOG.warn("Cannot load filesystem", ee); } } FILE_SYSTEMS_LOADED = true; } } }