@Test(priority = 2) public void testNegative() throws Exception { cleanUP(); createInvalidData(); Map<Path, FileSystem> consumePaths = new HashMap<Path, FileSystem>(); Path p = service.getDistCPInputFile(consumePaths, testRoot); assert p == null; }
protected Path getDistCPInputFile(Map<Path, FileSystem> consumePaths, Path tmp) throws IOException { Path input = getInputPath(); if (!srcFs.exists(input)) return null; FileStatus[] fileList = srcFs.listStatus(input); if (fileList != null) { Set<String> minFilesSet = new HashSet<String>(); for (int i = 0; i < fileList.length; i++) { Path consumeFilePath = fileList[i].getPath().makeQualified(srcFs); consumePaths.put(consumeFilePath, srcFs); LOG.debug("Reading minutePaths from ConsumePath [" + consumeFilePath + "]"); readConsumePath(srcFs, consumeFilePath, minFilesSet); } Path tmpPath = createInputFileForDISCTP(destFs, srcCluster.getName(), tmp, minFilesSet); return getFinalPathForDistCP(tmpPath, consumePaths); } return null; }
DistcpBaseService extends AbstractService { protected Path getDistCPInputFile(Map<Path, FileSystem> consumePaths, Path tmp) throws IOException { Path input = getInputPath(); if (!srcFs.exists(input)) return null; FileStatus[] fileList = srcFs.listStatus(input); if (fileList != null) { Set<String> minFilesSet = new HashSet<String>(); for (int i = 0; i < fileList.length; i++) { Path consumeFilePath = fileList[i].getPath().makeQualified(srcFs); consumePaths.put(consumeFilePath, srcFs); LOG.debug("Reading minutePaths from ConsumePath [" + consumeFilePath + "]"); readConsumePath(srcFs, consumeFilePath, minFilesSet); } Path tmpPath = createInputFileForDISCTP(destFs, srcCluster.getName(), tmp, minFilesSet); return getFinalPathForDistCP(tmpPath, consumePaths); } return null; } }
DistcpBaseService extends AbstractService { protected Path getDistCPInputFile(Map<Path, FileSystem> consumePaths, Path tmp) throws IOException { Path input = getInputPath(); if (!srcFs.exists(input)) return null; FileStatus[] fileList = srcFs.listStatus(input); if (fileList != null) { Set<String> minFilesSet = new HashSet<String>(); for (int i = 0; i < fileList.length; i++) { Path consumeFilePath = fileList[i].getPath().makeQualified(srcFs); consumePaths.put(consumeFilePath, srcFs); LOG.debug("Reading minutePaths from ConsumePath [" + consumeFilePath + "]"); readConsumePath(srcFs, consumeFilePath, minFilesSet); } Path tmpPath = createInputFileForDISCTP(destFs, srcCluster.getName(), tmp, minFilesSet); return getFinalPathForDistCP(tmpPath, consumePaths); } return null; } DistcpBaseService(DatabusConfig config, String name,
                           Cluster srcCluster,
                           Cluster destCluster); }
DistcpBaseService extends AbstractService { protected Path getDistCPInputFile(Map<Path, FileSystem> consumePaths, Path tmp) throws IOException { Path input = getInputPath(); if (!srcFs.exists(input)) return null; FileStatus[] fileList = srcFs.listStatus(input); if (fileList != null) { Set<String> minFilesSet = new HashSet<String>(); for (int i = 0; i < fileList.length; i++) { Path consumeFilePath = fileList[i].getPath().makeQualified(srcFs); consumePaths.put(consumeFilePath, srcFs); LOG.debug("Reading minutePaths from ConsumePath [" + consumeFilePath + "]"); readConsumePath(srcFs, consumeFilePath, minFilesSet); } Path tmpPath = createInputFileForDISCTP(destFs, srcCluster.getName(), tmp, minFilesSet); return getFinalPathForDistCP(tmpPath, consumePaths); } return null; } DistcpBaseService(DatabusConfig config, String name,
                           Cluster srcCluster,
                           Cluster destCluster); @Override long getMSecondsTillNextRun(long currentTime); }
DistcpBaseService extends AbstractService { protected Path getDistCPInputFile(Map<Path, FileSystem> consumePaths, Path tmp) throws IOException { Path input = getInputPath(); if (!srcFs.exists(input)) return null; FileStatus[] fileList = srcFs.listStatus(input); if (fileList != null) { Set<String> minFilesSet = new HashSet<String>(); for (int i = 0; i < fileList.length; i++) { Path consumeFilePath = fileList[i].getPath().makeQualified(srcFs); consumePaths.put(consumeFilePath, srcFs); LOG.debug("Reading minutePaths from ConsumePath [" + consumeFilePath + "]"); readConsumePath(srcFs, consumeFilePath, minFilesSet); } Path tmpPath = createInputFileForDISCTP(destFs, srcCluster.getName(), tmp, minFilesSet); return getFinalPathForDistCP(tmpPath, consumePaths); } return null; } DistcpBaseService(DatabusConfig config, String name,
                           Cluster srcCluster,
                           Cluster destCluster); @Override long getMSecondsTillNextRun(long currentTime);  }