/** * Returns the file name of the program JAR. */ String getProgramJarName() { return new Path(getProgramJarURI()).getName(); }
/** * Returns the file name of the program JAR. */ String getProgramJarName() { return new Path(getProgramJarURI()).getName(); }
/** * Creates a {@link Program} instance based on the information from the {@link MapReduceContextConfig}, using * the given program ClassLoader. */ private Program createProgram(MapReduceContextConfig contextConfig, ClassLoader programClassLoader) { Location programLocation; LocationFactory locationFactory = new LocalLocationFactory(); if (isLocal(contextConfig.getHConf())) { // Just create a local location factory. It's for temp usage only as the program location is always absolute. programLocation = locationFactory.create(contextConfig.getProgramJarURI()); } else { // In distributed mode, the program jar is localized to the container programLocation = locationFactory.create(new File(contextConfig.getProgramJarName()).getAbsoluteFile().toURI()); } return new DefaultProgram(new ProgramDescriptor(contextConfig.getProgramId(), contextConfig.getApplicationSpecification()), programLocation, programClassLoader); }