HadoopProcessingService implements ProcessingService<JobID> { public static boolean isArchive(Path archivePath) { String filename = archivePath.getName(); return filename.endsWith(".tgz") || filename.endsWith(".tar.gz") || filename.endsWith(".tar") || filename.endsWith(".zip"); } 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; }
@Test public void testIsArchive() throws Exception { assertTrue(HadoopProcessingService.isArchive(new Path("myarchie.tgz"))); assertTrue(HadoopProcessingService.isArchive(new Path("myarchie.zip"))); assertTrue(HadoopProcessingService.isArchive(new Path("myarchie.tar.gz"))); assertTrue(HadoopProcessingService.isArchive(new Path("myarchie.tar"))); assertFalse(HadoopProcessingService.isArchive(new Path("myarchie.TAR"))); assertFalse(HadoopProcessingService.isArchive(new Path("myarchie.sh"))); }