@Test public void testStripArchiveExtension() throws Exception { assertEquals("myarchie", HadoopProcessingService.stripArchiveExtension("myarchie.tgz")); assertEquals("myarchie", HadoopProcessingService.stripArchiveExtension("myarchie.zip")); assertEquals("myarchie", HadoopProcessingService.stripArchiveExtension("myarchie.tar.gz")); assertEquals("myarchie", HadoopProcessingService.stripArchiveExtension("myarchie.tar")); assertEquals(null, HadoopProcessingService.stripArchiveExtension("myarchie.sh")); }
static String stripArchiveExtension(String archiveName) { if (archiveName.endsWith(".tgz") || archiveName.endsWith(".tar") || archiveName.endsWith(".zip")) { return archiveName.substring(0, archiveName.length() - 4); } else if (archiveName.endsWith(".tar.gz")) { return archiveName.substring(0, archiveName.length() - 7); } return null; }
HadoopProcessingService implements ProcessingService<JobID> { static String stripArchiveExtension(String archiveName) { if (archiveName.endsWith(".tgz") || archiveName.endsWith(".tar") || archiveName.endsWith(".zip")) { return archiveName.substring(0, archiveName.length() - 4); } else if (archiveName.endsWith(".tar.gz")) { return archiveName.substring(0, archiveName.length() - 7); } return null; } }
HadoopProcessingService implements ProcessingService<JobID> { static String stripArchiveExtension(String archiveName) { if (archiveName.endsWith(".tgz") || archiveName.endsWith(".tar") || archiveName.endsWith(".zip")) { return archiveName.substring(0, archiveName.length() - 4); } else if (archiveName.endsWith(".tar.gz")) { return archiveName.substring(0, archiveName.length() - 7); } return null; } HadoopProcessingService(JobClientsMap jobClientsMap);  HadoopProcessingService(JobClientsMap jobClientsMap, String softwareDir); }
HadoopProcessingService implements ProcessingService<JobID> { static String stripArchiveExtension(String archiveName) { if (archiveName.endsWith(".tgz") || archiveName.endsWith(".tar") || archiveName.endsWith(".zip")) { return archiveName.substring(0, archiveName.length() - 4); } else if (archiveName.endsWith(".tar.gz")) { return archiveName.substring(0, archiveName.length() - 7); } return null; } HadoopProcessingService(JobClientsMap jobClientsMap);  HadoopProcessingService(JobClientsMap jobClientsMap, String softwareDir); HadoopLaunchHandler getHadoopLaunchHandler(); @Override Timer getTimer(); @Override BundleDescriptor[] getBundles(final String username, final BundleFilter filter); @Override MaskDescriptor[] getMasks(final String username); MaskDescriptor[] getMaskDescriptorsImpl(String username); BundleDescriptor[] getBundleDescriptorsImpl(String username, BundleFilter filter); static BundleDescriptor readBundleDescriptor(FileSystem fileSystem, Path path); void addBundleToClassPath(Path bundlePath, Configuration configuration); static void addBundleToClassPathStatic(Path bundlePath, Configuration configuration, FileSystem fileSystem); final Configuration createJobConfig(String userName); Job createJob(String jobName, Configuration jobConfig); JobClient getJobClient(String username); void clearCache(); @Override JobIdFormat<JobID> getJobIdFormat(); @Override void updateStatuses(String username); @Override ProcessStatus getJobStatus(JobID jobId); @Override boolean killJob(String username, JobID jobId); @Override void close(); @Override String[][] loadRegionDataInfo(String username, String url); FileSystem getFileSystem(String userName); FileSystem getFileSystem(String userName, String path); FileSystem getFileSystem(String userName, Configuration conf, Path path); static void addBundleArchives(Path bundlePath, FileSystem fs, Configuration conf); static boolean isArchive(Path archivePath); static void addBundleLibs(Path bundlePath, FileSystem fs, Configuration conf); static boolean isLib(Path libPath); static InputStream openUrlAsStream(String url, Configuration conf); @Override void invalidateBundleCache(); }
HadoopProcessingService implements ProcessingService<JobID> { static String stripArchiveExtension(String archiveName) { if (archiveName.endsWith(".tgz") || archiveName.endsWith(".tar") || archiveName.endsWith(".zip")) { return archiveName.substring(0, archiveName.length() - 4); } else if (archiveName.endsWith(".tar.gz")) { return archiveName.substring(0, archiveName.length() - 7); } return null; } HadoopProcessingService(JobClientsMap jobClientsMap);  HadoopProcessingService(JobClientsMap jobClientsMap, String softwareDir); HadoopLaunchHandler getHadoopLaunchHandler(); @Override Timer getTimer(); @Override BundleDescriptor[] getBundles(final String username, final BundleFilter filter); @Override MaskDescriptor[] getMasks(final String username); MaskDescriptor[] getMaskDescriptorsImpl(String username); BundleDescriptor[] getBundleDescriptorsImpl(String username, BundleFilter filter); static BundleDescriptor readBundleDescriptor(FileSystem fileSystem, Path path); void addBundleToClassPath(Path bundlePath, Configuration configuration); static void addBundleToClassPathStatic(Path bundlePath, Configuration configuration, FileSystem fileSystem); final Configuration createJobConfig(String userName); Job createJob(String jobName, Configuration jobConfig); JobClient getJobClient(String username); void clearCache(); @Override JobIdFormat<JobID> getJobIdFormat(); @Override void updateStatuses(String username); @Override ProcessStatus getJobStatus(JobID jobId); @Override boolean killJob(String username, JobID jobId); @Override void close(); @Override String[][] loadRegionDataInfo(String username, String url); FileSystem getFileSystem(String userName); FileSystem getFileSystem(String userName, String path); FileSystem getFileSystem(String userName, Configuration conf, Path path); static void addBundleArchives(Path bundlePath, FileSystem fs, Configuration conf); static boolean isArchive(Path archivePath); static void addBundleLibs(Path bundlePath, FileSystem fs, Configuration conf); static boolean isLib(Path libPath); static InputStream openUrlAsStream(String url, Configuration conf); @Override void invalidateBundleCache(); static final String CALVALUS_SOFTWARE_PATH; static final String DEFAULT_CALVALUS_BUNDLE; static final String DEFAULT_SNAP_BUNDLE; static final String BUNDLE_DESCRIPTOR_XML_FILENAME; }