target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void checkSupportsHdfsUpperCase() { sourceLocation = hdfsPath.toUpperCase(); replicaLocation = hdfsPath.toUpperCase(); assertTrue(dataManipulatorFactory.supportsSchemes(sourceLocation, replicaLocation)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... |
@Test public void copyOneObject() throws Exception { client.putObject("source", "data", inputData); Path sourceBaseLocation = new Path("s3: Path replicaLocation = new Path("s3: List<Path> sourceSubLocations = new ArrayList<>(); S3S3Copier s3s3Copier = newS3S3Copier(sourceBaseLocation, sourceSubLocations, replicaLocatio... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test public void checkSupportsS3ToHdfs() { sourceLocation = s3Path; replicaLocation = hdfsPath; assertTrue(dataManipulatorFactory.supportsSchemes(sourceLocation, replicaLocation)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... |
@Test public void checkSupportsS3() { sourceLocation = s3Path; replicaLocation = s3Path; assertTrue(dataManipulatorFactory.supportsSchemes(sourceLocation, replicaLocation)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... |
@Test public void checkSupportsHdfsToS3() { sourceLocation = hdfsPath; replicaLocation = s3Path; assertTrue(dataManipulatorFactory.supportsSchemes(sourceLocation, replicaLocation)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... |
@Test public void checkSupportsRandomPaths() { sourceLocation = "<path>"; replicaLocation = "<path>"; assertTrue(dataManipulatorFactory.supportsSchemes(sourceLocation, replicaLocation)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); } | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... | HdfsDataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return true; } @Autowired HdfsDataManipulatorFactory(@Value("#{replicaHiveConf}") Configuration conf); @Override DataManipulator newInstance(Path path, Map<String, Object... |
@Test public void defaults() { assertDefaultValues(parser.parse(defaultOptions())); } | protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emptyList(), FileAttribut... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... |
@Test public void nullCopierOptions() { assertDefaultValues(parser.parse(null)); } | protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emptyList(), FileAttribut... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... |
@Test public void emptyCopierOptions() { assertDefaultValues(parser.parse(Collections.<String, Object> emptyMap())); } | protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emptyList(), FileAttribut... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... |
@Test public void typical() { Map<String, Object> options = defaultOptions(); options.put(FILE_ATTRIBUTES, Arrays.asList("replication", "blocksize", "user", "group", "permission", "checksumtype", "acl", "xattr", "times")); options.put(PRESERVE_RAW_XATTRS, "true"); options.put(ATOMIC_COMMIT, "false"); options.put(ATOMIC... | protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emptyList(), FileAttribut... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... |
@Test(expected = IllegalArgumentException.class) public void zeroMapBandwidth() { Map<String, Object> options = defaultOptions(); options.put(TASK_BANDWIDTH, "0"); parser.parse(options); options.put(MAX_MAPS, "2"); } | protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emptyList(), FileAttribut... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... |
@Test(expected = IllegalArgumentException.class) public void negativeMapBandwidth() { Map<String, Object> options = defaultOptions(); options.put(TASK_BANDWIDTH, "-1"); parser.parse(options); } | protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emptyList(), FileAttribut... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... |
@Test public void copyOneFile() throws Exception { client.putObject("source", "data", inputData); Path sourceBaseLocation = new Path("s3: Path replicaLocation = new Path("s3: List<Path> sourceSubLocations = new ArrayList<>(); S3S3Copier s3s3Copier = newS3S3Copier(sourceBaseLocation, sourceSubLocations, replicaLocation)... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test(expected = IllegalArgumentException.class) public void zeroMaxMaps() { Map<String, Object> options = defaultOptions(); options.put(MAX_MAPS, "0"); parser.parse(options); } | protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emptyList(), FileAttribut... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... |
@Test(expected = IllegalArgumentException.class) public void negativeMaxMaps() { Map<String, Object> options = defaultOptions(); options.put(MAX_MAPS, "-1"); parser.parse(options); } | protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emptyList(), FileAttribut... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... | DistCpOptionsParser { protected DistCpOptions parse(Map<String, Object> copierOptions) { if (copierOptions == null) { LOG.debug("Null copier options: nothing to parse"); return distCpOptions; } List<FileAttribute> fileAttributes = MoreMapUtils.getListOfEnum(copierOptions, FILE_ATTRIBUTES, Collections.<FileAttribute>emp... |
@Test public void typical() throws IOException { when(status.isFile()).thenReturn(false); FileStatus fileStatus = new FileStatus(); when(fileSystem.listStatus(any(Path.class))).thenReturn(new FileStatus[] { fileStatus }); Iterable<FileStatus> children = traverser.children(status); verify(fileSystem).listStatus(any(Path... | @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.of(); } return ImmutableList.copyOf(listStatus); } catch (IO... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... |
@Test public void noChildren() throws IOException { when(status.isFile()).thenReturn(false); when(fileSystem.listStatus(any(Path.class))).thenReturn(new FileStatus[] {}); Iterable<FileStatus> children = traverser.children(status); verify(fileSystem).listStatus(any(Path.class)); assertThat(Iterables.size(children), is(0... | @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.of(); } return ImmutableList.copyOf(listStatus); } catch (IO... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... |
@Test public void nullListStatus() throws IOException { when(status.isFile()).thenReturn(false); when(fileSystem.listStatus(any(Path.class))).thenReturn(null); Iterable<FileStatus> children = traverser.children(status); verify(fileSystem).listStatus(any(Path.class)); assertThat(Iterables.size(children), is(0)); } | @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.of(); } return ImmutableList.copyOf(listStatus); } catch (IO... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... |
@Test public void rootIsFile() throws IOException { when(status.isFile()).thenReturn(true); Iterable<FileStatus> children = traverser.children(status); verify(fileSystem, never()).listStatus(any(Path.class)); assertThat(Iterables.size(children), is(0)); } | @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.of(); } return ImmutableList.copyOf(listStatus); } catch (IO... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... |
@Test(expected = CircusTrainException.class) public void fileSystemException() throws IOException { when(status.isFile()).thenReturn(false); doThrow(IOException.class).when(fileSystem).listStatus(any(Path.class)); traverser.children(status); } | @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.of(); } return ImmutableList.copyOf(listStatus); } catch (IO... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... | FileStatusTreeTraverser extends TreeTraverser<FileStatus> { @Override public Iterable<FileStatus> children(FileStatus root) { if (root.isFile()) { return ImmutableList.of(); } try { FileStatus[] listStatus = fileSystem.listStatus(root.getPath()); if (listStatus == null || listStatus.length == 0) { return ImmutableList.... |
@Test public void typical() throws Exception { copier = new DistCpCopier(conf, sourceDataBaseLocation, sourceDataLocations, replicaDataLocation, null, registry); Metrics metrics = copier.copy(); assertThat(metrics, not(nullValue())); String outputPath = replicaDataLocation.toUri().getPath(); File outputSub2Data = new F... | @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {}", distCpOptions); CircusTrainCo... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... |
@Test public void typicalOneFile() throws Exception { Path inputFile = new Path(sourceDataBaseLocation, "sub1/sub2/data"); Path targetFile = new Path(replicaDataLocation, "output.txt"); copier = new DistCpCopier(conf, inputFile, Collections.<Path>emptyList(), targetFile, null, registry); Metrics metrics = copier.copy()... | @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {}", distCpOptions); CircusTrainCo... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... |
@Test public void cleanUpOnFailure() throws Exception { Map<String, Object> copierOptions = new HashMap<>(); copierOptions.put("file-attribute", "xattr"); copier = new DistCpCopier(conf, sourceDataBaseLocation, sourceDataLocations, replicaDataLocation, copierOptions, registry); try { copier.copy(); fail("Expecting copi... | @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {}", distCpOptions); CircusTrainCo... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... | DistCpCopier implements Copier { @Override public Metrics copy() throws CircusTrainException { LOG.info("Copying table data."); LOG.debug("Invoking DistCp: {} -> {}", sourceDataBaseLocation, replicaDataLocation); DistCpOptions distCpOptions = parseCopierOptions(copierOptions); LOG.debug("Invoking DistCp with options: {... |
@Test public void copyOneObjectUsingKeys() throws Exception { client.putObject("source", "bar/data", inputData); Path sourceBaseLocation = new Path("s3: Path replicaLocation = new Path("s3: List<Path> sourceSubLocations = new ArrayList<>(); S3S3Copier s3s3Copier = newS3S3Copier(sourceBaseLocation, sourceSubLocations, r... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test public void useCorrectReplicaTableName() throws Exception { SourceHiveEndpoint replicaDiffEndpoint = new SourceHiveEndpoint("name", hiveConf, metastoreSupplier); when(metastoreSupplier.get()).thenReturn(metastoreClient); when(metastoreClient.getTable("dbname", "tableName")).thenReturn(table); when(table.getSd()).... | @Override public TableAndStatistics getTableAndStatistics(TableReplication tableReplication) { SourceTable sourceTable = tableReplication.getSourceTable(); return super.getTableAndStatistics(sourceTable.getDatabaseName(), sourceTable.getTableName()); } | SourceHiveEndpoint extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(TableReplication tableReplication) { SourceTable sourceTable = tableReplication.getSourceTable(); return super.getTableAndStatistics(sourceTable.getDatabaseName(), sourceTable.getTableName()); } } | SourceHiveEndpoint extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(TableReplication tableReplication) { SourceTable sourceTable = tableReplication.getSourceTable(); return super.getTableAndStatistics(sourceTable.getDatabaseName(), sourceTable.getTableName()); } SourceHiveEndpoint(
... | SourceHiveEndpoint extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(TableReplication tableReplication) { SourceTable sourceTable = tableReplication.getSourceTable(); return super.getTableAndStatistics(sourceTable.getDatabaseName(), sourceTable.getTableName()); } SourceHiveEndpoint(
... | SourceHiveEndpoint extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(TableReplication tableReplication) { SourceTable sourceTable = tableReplication.getSourceTable(); return super.getTableAndStatistics(sourceTable.getDatabaseName(), sourceTable.getTableName()); } SourceHiveEndpoint(
... |
@Test public void typical() { Path sourceRootPath = new Path("/root/"); Path path = new Path("/root/foo/bar/"); when(fileStatus.getPath()).thenReturn(path); String relativePath = new RelativePathFunction(sourceRootPath).apply(fileStatus); assertThat(relativePath, is("/foo/bar")); } | @Override public String apply(@Nonnull FileStatus fileStatus) { return DistCpUtils.getRelativePath(sourceRootPath, fileStatus.getPath()); } | RelativePathFunction implements Function<FileStatus, String> { @Override public String apply(@Nonnull FileStatus fileStatus) { return DistCpUtils.getRelativePath(sourceRootPath, fileStatus.getPath()); } } | RelativePathFunction implements Function<FileStatus, String> { @Override public String apply(@Nonnull FileStatus fileStatus) { return DistCpUtils.getRelativePath(sourceRootPath, fileStatus.getPath()); } RelativePathFunction(Path sourceRootPath); } | RelativePathFunction implements Function<FileStatus, String> { @Override public String apply(@Nonnull FileStatus fileStatus) { return DistCpUtils.getRelativePath(sourceRootPath, fileStatus.getPath()); } RelativePathFunction(Path sourceRootPath); @Override String apply(@Nonnull FileStatus fileStatus); } | RelativePathFunction implements Function<FileStatus, String> { @Override public String apply(@Nonnull FileStatus fileStatus) { return DistCpUtils.getRelativePath(sourceRootPath, fileStatus.getPath()); } RelativePathFunction(Path sourceRootPath); @Override String apply(@Nonnull FileStatus fileStatus); } |
@Test public void copyListingClass() { CircusTrainCopyListing.setAsCopyListingClass(conf); assertThat(conf.get(DistCpConstants.CONF_LABEL_COPY_LISTING_CLASS), is(CircusTrainCopyListing.class.getName())); } | static void setAsCopyListingClass(Configuration conf) { conf.setClass(CONF_LABEL_COPY_LISTING_CLASS, CircusTrainCopyListing.class, CopyListing.class); } | CircusTrainCopyListing extends SimpleCopyListing { static void setAsCopyListingClass(Configuration conf) { conf.setClass(CONF_LABEL_COPY_LISTING_CLASS, CircusTrainCopyListing.class, CopyListing.class); } } | CircusTrainCopyListing extends SimpleCopyListing { static void setAsCopyListingClass(Configuration conf) { conf.setClass(CONF_LABEL_COPY_LISTING_CLASS, CircusTrainCopyListing.class, CopyListing.class); } CircusTrainCopyListing(Configuration configuration, Credentials credentials); } | CircusTrainCopyListing extends SimpleCopyListing { static void setAsCopyListingClass(Configuration conf) { conf.setClass(CONF_LABEL_COPY_LISTING_CLASS, CircusTrainCopyListing.class, CopyListing.class); } CircusTrainCopyListing(Configuration configuration, Credentials credentials); @Override void doBuildListing(Path pat... | CircusTrainCopyListing extends SimpleCopyListing { static void setAsCopyListingClass(Configuration conf) { conf.setClass(CONF_LABEL_COPY_LISTING_CLASS, CircusTrainCopyListing.class, CopyListing.class); } CircusTrainCopyListing(Configuration configuration, Credentials credentials); @Override void doBuildListing(Path pat... |
@Test(expected = CircusTrainException.class) public void rootPathNotSet() { CircusTrainCopyListing.getRootPath(conf); } | static Path getRootPath(Configuration conf) { String pathString = conf.get(CONF_ROOT_PATH); if (pathString == null) { throw new CircusTrainException("No root path was set."); } return new Path(pathString); } | CircusTrainCopyListing extends SimpleCopyListing { static Path getRootPath(Configuration conf) { String pathString = conf.get(CONF_ROOT_PATH); if (pathString == null) { throw new CircusTrainException("No root path was set."); } return new Path(pathString); } } | CircusTrainCopyListing extends SimpleCopyListing { static Path getRootPath(Configuration conf) { String pathString = conf.get(CONF_ROOT_PATH); if (pathString == null) { throw new CircusTrainException("No root path was set."); } return new Path(pathString); } CircusTrainCopyListing(Configuration configuration, Credentia... | CircusTrainCopyListing extends SimpleCopyListing { static Path getRootPath(Configuration conf) { String pathString = conf.get(CONF_ROOT_PATH); if (pathString == null) { throw new CircusTrainException("No root path was set."); } return new Path(pathString); } CircusTrainCopyListing(Configuration configuration, Credentia... | CircusTrainCopyListing extends SimpleCopyListing { static Path getRootPath(Configuration conf) { String pathString = conf.get(CONF_ROOT_PATH); if (pathString == null) { throw new CircusTrainException("No root path was set."); } return new Path(pathString); } CircusTrainCopyListing(Configuration configuration, Credentia... |
@Test public void closeSilentlyNoCloseable() { IoUtil.closeSilently(logger); verifyNoMoreInteractions(logger); } | public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); static void closeSilently(Closeable... closeables); static void closeSilently(Logger log, Closeable... closeables); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); static void closeSilently(Closeable... closeables); static void closeSilently(Logger log, Closeable... closeables); } |
@Test public void closeSilentlyTypical() throws Exception { IoUtil.closeSilently(logger, closeable); verify(closeable).close(); verifyNoMoreInteractions(logger); } | public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); static void closeSilently(Closeable... closeables); static void closeSilently(Logger log, Closeable... closeables); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); static void closeSilently(Closeable... closeables); static void closeSilently(Logger log, Closeable... closeables); } |
@Test public void closeSilentlyWhenCloseThrowsException() throws Exception { RuntimeException e = new RuntimeException(); doThrow(e).when(closeable).close(); IoUtil.closeSilently(logger, closeable); verify(closeable).close(); verify(logger).debug(anyString(), eq(closeable), eq(e)); } | public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); static void closeSilently(Closeable... closeables); static void closeSilently(Logger log, Closeable... closeables); } | IoUtil { public static void closeSilently(Closeable... closeables) { closeSilently(null, closeables); } private IoUtil(); static void closeSilently(Closeable... closeables); static void closeSilently(Logger log, Closeable... closeables); } |
@Test public void publish() { class T { @Override public String toString() { return "Hello world!"; } } ConfigurationUtil.publish(config, "a.b.c", new T()); assertThat(config.get("a.b.c"), is("Hello world!")); } | public static <T> void publish(Configuration configuration, String label, T value) { configuration.set(label, String.valueOf(value)); } | ConfigurationUtil { public static <T> void publish(Configuration configuration, String label, T value) { configuration.set(label, String.valueOf(value)); } } | ConfigurationUtil { public static <T> void publish(Configuration configuration, String label, T value) { configuration.set(label, String.valueOf(value)); } private ConfigurationUtil(); } | ConfigurationUtil { public static <T> void publish(Configuration configuration, String label, T value) { configuration.set(label, String.valueOf(value)); } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getInt(Configuration configuration, String label);... | ConfigurationUtil { public static <T> void publish(Configuration configuration, String label, T value) { configuration.set(label, String.valueOf(value)); } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getInt(Configuration configuration, String label);... |
@Test(expected = AssertionError.class) public void getUnknownIntProperty() { ConfigurationUtil.getInt(config, "a.b.c"); } | public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } | ConfigurationUtil { public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } } | ConfigurationUtil { public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); } | ConfigurationUtil { public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getInt(Co... | ConfigurationUtil { public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getInt(Co... |
@Test public void getIntProperty() { config.set("a.b.c", "1024"); assertThat(ConfigurationUtil.getInt(config, "a.b.c"), is(1024)); } | public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } | ConfigurationUtil { public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } } | ConfigurationUtil { public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); } | ConfigurationUtil { public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getInt(Co... | ConfigurationUtil { public static int getInt(Configuration configuration, String label) { int value = configuration.getInt(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getInt(Co... |
@Test(expected = AssertionError.class) public void getUnknownLongProperty() { ConfigurationUtil.getLong(config, "a.b.c"); } | public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } | ConfigurationUtil { public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } } | ConfigurationUtil { public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); } | ConfigurationUtil { public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getIn... | ConfigurationUtil { public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getIn... |
@Test public void copyOneObjectPartitioned() throws Exception { client.putObject("source", "year=2016/data", inputData); Path sourceBaseLocation = new Path("s3: Path replicaLocation = new Path("s3: List<Path> sourceSubLocations = Lists.newArrayList(new Path(sourceBaseLocation, "year=2016")); S3S3Copier s3s3Copier = new... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test public void getLongProperty() { config.set("a.b.c", "1234567890"); assertThat(ConfigurationUtil.getLong(config, "a.b.c"), is(1234567890L)); } | public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } | ConfigurationUtil { public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } } | ConfigurationUtil { public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); } | ConfigurationUtil { public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getIn... | ConfigurationUtil { public static long getLong(Configuration configuration, String label) { long value = configuration.getLong(label, -1); assert value >= 0 : "Couldn't find " + label; return value; } private ConfigurationUtil(); static void publish(Configuration configuration, String label, T value); static int getIn... |
@Test public void getDefaultStrategy() { S3MapReduceCpOptions options = new S3MapReduceCpOptions(); assertThat(ConfigurationUtil.getStrategy(config, options), is(CoreMatchers.<Class<?>> equalTo(UniformSizeInputFormat.class))); } | public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputFormat.class, InputFo... | ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputF... | ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputF... | ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputF... | ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputF... |
@Test public void getCustomStrategy() { class CustomInputFormat extends InputFormat<Text, CopyListingFileStatus> { @Override public List<InputSplit> getSplits(JobContext context) throws IOException, InterruptedException { return null; } @Override public RecordReader<Text, CopyListingFileStatus> createRecordReader(Input... | public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputFormat.class, InputFo... | ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputF... | ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputF... | ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputF... | ConfigurationUtil { public static Class<? extends InputFormat> getStrategy(Configuration conf, S3MapReduceCpOptions options) { String confLabel = "com.hotels.bdp.circustrain.s3mapreducecp." + options.getCopyStrategy().toLowerCase(Locale.getDefault()) + ".strategy.impl"; return conf.getClass(confLabel, UniformSizeInputF... |
@Test public void getRelativePathRoot() { Path root = new Path("/"); Path child = new Path("/a"); assertThat(PathUtil.getRelativePath(root, child), is("/a")); } | public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()); } | PathUtil { public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()... | PathUtil { public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()... | PathUtil { public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()... | PathUtil { public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()... |
@Test public void relativePath() { Path root = new Path("/tmp/abc"); Path child = new Path("/tmp/abc/xyz/file"); assertThat(PathUtil.getRelativePath(root, child), is("/xyz/file")); } | public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()); } | PathUtil { public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()... | PathUtil { public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()... | PathUtil { public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()... | PathUtil { public static String getRelativePath(Path sourceRootPath, Path childPath) { String childPathString = childPath.toUri().getPath(); String sourceRootPathString = sourceRootPath.toUri().getPath(); return "/".equals(sourceRootPathString) ? childPathString : childPathString.substring(sourceRootPathString.length()... |
@Test public void nullPathToString() { assertThat(PathUtil.toString(null), is(nullValue())); } | public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } | PathUtil { public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } } | PathUtil { public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } private PathUtil(); } | PathUtil { public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Path path); static String toBucketName(URI uri); static String toBucketKey(URI uri); static boolea... | PathUtil { public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Path path); static String toBucketName(URI uri); static String toBucketKey(URI uri); static boolea... |
@Test public void pathToString() { assertThat(PathUtil.toString(new Path("/foo/bar/")), is("/foo/bar")); assertThat(PathUtil.toString(new Path("s3: } | public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } | PathUtil { public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } } | PathUtil { public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } private PathUtil(); } | PathUtil { public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Path path); static String toBucketName(URI uri); static String toBucketKey(URI uri); static boolea... | PathUtil { public static String toString(Path path) { return path == null ? null : path.toUri().toString(); } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Path path); static String toBucketName(URI uri); static String toBucketKey(URI uri); static boolea... |
@Test(expected = NullPointerException.class) public void nullUriToBucketName() { PathUtil.toBucketName(null); } | public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... |
@Test(expected = IllegalArgumentException.class) public void protocolOnlyUriToBucketName() { PathUtil.toBucketName(URI.create("s3: } | public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... |
@Test(expected = IllegalArgumentException.class) public void uriWithNoAuthorityToBucketName() { PathUtil.toBucketName(URI.create("/foo/bar")); } | public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... |
@Test public void copyOneObjectPartitionedSourceBaseNested() throws Exception { client.putObject("source", "nested/year=2016/data", inputData); Path sourceBaseLocation = new Path("s3: Path replicaLocation = new Path("s3: List<Path> sourceSubLocations = Lists.newArrayList(new Path(sourceBaseLocation, "year=2016")); S3S3... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test public void uriToBucketName() { assertThat(PathUtil.toBucketName(URI.create("s3: } | public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... |
@Test(expected = NullPointerException.class) public void nullUriToBucketKey() { PathUtil.toBucketKey(null); } | public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Pat... | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Pat... |
@Test(expected = IllegalArgumentException.class) public void protocolOnlyUriToBucketKey() { PathUtil.toBucketName(URI.create("s3: } | public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); } | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... | PathUtil { public static String toBucketName(URI uri) { String authority = uri.getAuthority(); if (authority == null) { throw new IllegalArgumentException("URI " + uri + " has no authority part"); } return authority; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static Strin... |
@Test public void uriWithNoAuthorityToBucketKey() { assertThat(PathUtil.toBucketKey(URI.create("/foo/bar")), is("foo/bar")); } | public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Pat... | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Pat... |
@Test public void uriToBucketKey() { assertThat(PathUtil.toBucketKey(URI.create("s3: } | public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Pat... | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Pat... |
@Test(expected = IllegalArgumentException.class) public void uriWithNoPathToBucketKey() { PathUtil.toBucketKey(URI.create("s3: } | public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); } | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Pat... | PathUtil { public static String toBucketKey(URI uri) { String key = uri.getPath().substring(1); if (key.isEmpty()) { throw new IllegalArgumentException("URI " + uri + " has no path part"); } return key; } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Pat... |
@Test public void isFile() { assertThat(PathUtil.isFile(URI.create("s3: assertThat(PathUtil.isFile(URI.create("s3: } | public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } | PathUtil { public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } } | PathUtil { public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } private PathUtil(); } | PathUtil { public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Path path); static String toBucketName(URI uri); static String toBucketKey(URI uri); static boolean isFile(URI path... | PathUtil { public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Path path); static String toBucketName(URI uri); static String toBucketKey(URI uri); static boolean isFile(URI path... |
@Test public void isDirectory() { assertThat(PathUtil.isFile(URI.create("s3: } | public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } | PathUtil { public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } } | PathUtil { public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } private PathUtil(); } | PathUtil { public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Path path); static String toBucketName(URI uri); static String toBucketKey(URI uri); static boolean isFile(URI path... | PathUtil { public static boolean isFile(URI path) { return !path.toString().endsWith("/"); } private PathUtil(); static String getRelativePath(Path sourceRootPath, Path childPath); static String toString(Path path); static String toBucketName(URI uri); static String toBucketKey(URI uri); static boolean isFile(URI path... |
@Test public void bytes() { assertThat(BytesFormatter.getStringDescriptionFor(100L), is("100.0B")); } | public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return getFormatter().form... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... |
@Test public void kilobytes() { assertThat(BytesFormatter.getStringDescriptionFor(1024L), is("1.0K")); assertThat(BytesFormatter.getStringDescriptionFor(2256L), is("2.2K")); } | public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return getFormatter().form... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... |
@Test public void copyOneObjectPartitionedHandlingS3ASchemes() throws Exception { client.putObject("source", "year=2016/data", inputData); Path sourceBaseLocation = new Path("s3a: Path replicaLocation = new Path("s3a: List<Path> sourceSubLocations = Lists.newArrayList(new Path(sourceBaseLocation, "year=2016")); S3S3Cop... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test public void megabytes() { assertThat(BytesFormatter.getStringDescriptionFor(1024L * 1024L), is("1.0M")); assertThat(BytesFormatter.getStringDescriptionFor((2024L * 1024L) + (256L * 1024L)), is("2.2M")); } | public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return getFormatter().form... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... |
@Test public void gigabytes() { assertThat(BytesFormatter.getStringDescriptionFor(1024L * 1024L * 1024L), is("1.0G")); } | public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return getFormatter().form... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... |
@Test public void terabytes() { assertThat(BytesFormatter.getStringDescriptionFor(1024L * 1024L * 1024L * 1024L), is("1.0T")); } | public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return getFormatter().form... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... |
@Test public void petabytes() { assertThat(BytesFormatter.getStringDescriptionFor(1024L * 1024L * 1024L * 1024L * 1024L), is("1.0P")); } | public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return getFormatter().form... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... | BytesFormatter { public static String getStringDescriptionFor(long nBytes) { char[] units = { 'B', 'K', 'M', 'G', 'T', 'P' }; double current = nBytes; double prev = current; int index = 0; while ((current = current / 1024) >= 1) { prev = current; ++index; } assert index < units.length : "Too large a number."; return ge... |
@Test public void read() { File tmpFile; File outFile; try { tmpFile = createFile(1024); outFile = createFile(); tmpFile.deleteOnExit(); outFile.deleteOnExit(); long maxBandwidth = copyAndAssert(tmpFile, outFile, 0, 1, -1, CB.BUFFER); copyAndAssert(tmpFile, outFile, maxBandwidth, 20, 0, CB.BUFFER); copyAndAssert(tmpFil... | @Override public int read() throws IOException { throttle(); int data = rawStream.read(); if (data != -1) { bytesRead++; } return data; } | ThrottledInputStream extends InputStream { @Override public int read() throws IOException { throttle(); int data = rawStream.read(); if (data != -1) { bytesRead++; } return data; } } | ThrottledInputStream extends InputStream { @Override public int read() throws IOException { throttle(); int data = rawStream.read(); if (data != -1) { bytesRead++; } return data; } ThrottledInputStream(InputStream rawStream); ThrottledInputStream(InputStream rawStream, long maxBytesPerSec); } | ThrottledInputStream extends InputStream { @Override public int read() throws IOException { throttle(); int data = rawStream.read(); if (data != -1) { bytesRead++; } return data; } ThrottledInputStream(InputStream rawStream); ThrottledInputStream(InputStream rawStream, long maxBytesPerSec); @Override void close(); @Ov... | ThrottledInputStream extends InputStream { @Override public int read() throws IOException { throttle(); int data = rawStream.read(); if (data != -1) { bytesRead++; } return data; } ThrottledInputStream(InputStream rawStream); ThrottledInputStream(InputStream rawStream, long maxBytesPerSec); @Override void close(); @Ov... |
@Test public void typical() { try { new MyRetriableCommand(5).execute(0); Assert.assertTrue(false); } catch (Exception e) { Assert.assertTrue(true); } try { new MyRetriableCommand(3).execute(0); Assert.assertTrue(true); } catch (Exception e) { Assert.assertTrue(false); } try { new MyRetriableCommand(5, RetryPolicies.re... | public T execute(Object... arguments) throws Exception { Exception latestException; int counter = 0; while (true) { try { return doExecute(arguments); } catch (Exception exception) { LOG.error("Failure in Retriable command: {}", description, exception); latestException = exception; } counter++; RetryAction action = ret... | RetriableCommand { public T execute(Object... arguments) throws Exception { Exception latestException; int counter = 0; while (true) { try { return doExecute(arguments); } catch (Exception exception) { LOG.error("Failure in Retriable command: {}", description, exception); latestException = exception; } counter++; Retry... | RetriableCommand { public T execute(Object... arguments) throws Exception { Exception latestException; int counter = 0; while (true) { try { return doExecute(arguments); } catch (Exception exception) { LOG.error("Failure in Retriable command: {}", description, exception); latestException = exception; } counter++; Retry... | RetriableCommand { public T execute(Object... arguments) throws Exception { Exception latestException; int counter = 0; while (true) { try { return doExecute(arguments); } catch (Exception exception) { LOG.error("Failure in Retriable command: {}", description, exception); latestException = exception; } counter++; Retry... | RetriableCommand { public T execute(Object... arguments) throws Exception { Exception latestException; int counter = 0; while (true) { try { return doExecute(arguments); } catch (Exception exception) { LOG.error("Failure in Retriable command: {}", description, exception); latestException = exception; } counter++; Retry... |
@Test public void getSplits() throws Exception { S3MapReduceCpOptions options = getOptions(); Configuration configuration = new Configuration(); configuration.set("mapred.map.tasks", String.valueOf(options.getMaxMaps())); CopyListing.getCopyListing(configuration, CREDENTIALS, options).buildListing(new Path( cluster.get... | @Override public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException { LOG.info("DynamicInputFormat: Getting splits for job: {}", jobContext.getJobID()); return createSplits(jobContext, splitCopyListingIntoChunksWithShuffle(jobContext)); } | DynamicInputFormat extends InputFormat<K, V> { @Override public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException { LOG.info("DynamicInputFormat: Getting splits for job: {}", jobContext.getJobID()); return createSplits(jobContext, splitCopyListingIntoChunksWithShuffle(jobContext... | DynamicInputFormat extends InputFormat<K, V> { @Override public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException { LOG.info("DynamicInputFormat: Getting splits for job: {}", jobContext.getJobID()); return createSplits(jobContext, splitCopyListingIntoChunksWithShuffle(jobContext... | DynamicInputFormat extends InputFormat<K, V> { @Override public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException { LOG.info("DynamicInputFormat: Getting splits for job: {}", jobContext.getJobID()); return createSplits(jobContext, splitCopyListingIntoChunksWithShuffle(jobContext... | DynamicInputFormat extends InputFormat<K, V> { @Override public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException { LOG.info("DynamicInputFormat: Getting splits for job: {}", jobContext.getJobID()); return createSplits(jobContext, splitCopyListingIntoChunksWithShuffle(jobContext... |
@Test public void getSplitRatio() throws Exception { assertEquals(1, DynamicInputFormat.getSplitRatio(1, 1000000000)); assertEquals(2, DynamicInputFormat.getSplitRatio(11000000, 10)); assertEquals(4, DynamicInputFormat.getSplitRatio(30, 700)); assertEquals(2, DynamicInputFormat.getSplitRatio(30, 200)); Configuration co... | private static int getSplitRatio(Configuration conf) { int splitRatio = conf .getInt(S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, S3MapReduceCpConstants.SPLIT_RATIO_DEFAULT); if (splitRatio <= 0) { LOG .warn("{} should be positive. Fall back to default value: {}", S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, S3MapR... | DynamicInputFormat extends InputFormat<K, V> { private static int getSplitRatio(Configuration conf) { int splitRatio = conf .getInt(S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, S3MapReduceCpConstants.SPLIT_RATIO_DEFAULT); if (splitRatio <= 0) { LOG .warn("{} should be positive. Fall back to default value: {}", S3MapR... | DynamicInputFormat extends InputFormat<K, V> { private static int getSplitRatio(Configuration conf) { int splitRatio = conf .getInt(S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, S3MapReduceCpConstants.SPLIT_RATIO_DEFAULT); if (splitRatio <= 0) { LOG .warn("{} should be positive. Fall back to default value: {}", S3MapR... | DynamicInputFormat extends InputFormat<K, V> { private static int getSplitRatio(Configuration conf) { int splitRatio = conf .getInt(S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, S3MapReduceCpConstants.SPLIT_RATIO_DEFAULT); if (splitRatio <= 0) { LOG .warn("{} should be positive. Fall back to default value: {}", S3MapR... | DynamicInputFormat extends InputFormat<K, V> { private static int getSplitRatio(Configuration conf) { int splitRatio = conf .getInt(S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, S3MapReduceCpConstants.SPLIT_RATIO_DEFAULT); if (splitRatio <= 0) { LOG .warn("{} should be positive. Fall back to default value: {}", S3MapR... |
@Test public void typical() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: assertThat(options.isHelp(), is(false)); assertThat(options.isBlocking(), is(true)); assertThat(options.getSources(), is(Arrays.asList(new Path("hdfs: assertThat(options.getTarget(), is(URI.create("hdfs: assertThat(options.... | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void help() { S3MapReduceCpOptions options = parser.parse("--help"); assertThat(options.isHelp(), is(true)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void copyMultipleObjects() throws Exception { ListObjectsRequestFactory mockListObjectRequestFactory = Mockito.mock(ListObjectsRequestFactory.class); when(mockListObjectRequestFactory.newInstance()).thenReturn(new ListObjectsRequest().withMaxKeys(1)); client.putObject("source", "bar/data1", inputData); cli... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test public void blocking() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.isBlocking(), is(false)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void missingSourcePath() { parser.parse("--dest", "hdfs: "jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void relativeSourcePath() { parser.parse("--src", "./source/first", "--dest", "hdfs: "jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void multipleSourcePaths() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "--dest", "hdfs: assertThat(options.getSources(), is(Arrays.asList(new Path("hdfs: new Path("hdfs: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void multipleSourcePathsOneOfWhichIsRelative() { parser.parse("--src", "hdfs: "--dest", "hdfs: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void missingTargetPath() { parser.parse("--src", "hdfs: "jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void relativeTargetPath() { parser.parse("--src", "hdfs: "jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void credentialsProvider() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getCredentialsProvider(), is(URI.create("jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void invalidCredentialsProvider() { parser.parse("--src", "hdfs: "--credentialsProvider", "abs"); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void multipartUploadPartSize() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getMultipartUploadPartSize(), is(654321L)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void copyCheckTransferManagerIsShutdown() throws Exception { client.putObject("source", "data", inputData); Path sourceBaseLocation = new Path("s3: Path replicaLocation = new Path("s3: List<Path> sourceSubLocations = new ArrayList<>(); TransferManagerFactory mockedTransferManagerFactory = Mockito.mock(Tran... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test(expected = IllegalArgumentException.class) public void zeroMultipartUploadPartSize() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: "0"); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void negativeMultipartUploadPartSize() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: "-123"); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void s3ServerSideEncryption() { S3MapReduceCpOptions options = new OptionsParser().parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.isS3ServerSideEncryption(), is(true)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void storageClass() { for (StorageClass storageClass : StorageClass.values()) { S3MapReduceCpOptions options = new OptionsParser().parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getStorageClass(), is(storageClass.toString())); } } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void invalidStorageClass() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void maxBandwidth() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getMaxBandwidth(), is(123456L)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void zeroMaxBandwidth() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void negativeMaxBandwidth() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void numberOfUploadWorkers() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getNumberOfUploadWorkers(), is(33)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void zeroNumberOfUploadWorkers() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: "0"); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void copySafelyShutDownTransferManagerWhenNotInitialised() throws Exception { Path sourceBaseLocation = new Path("s3: Path replicaLocation = new Path("s3: List<Path> sourceSubLocations = new ArrayList<>(); TransferManagerFactory mockedTransferManagerFactory = Mockito.mock(TransferManagerFactory.class); whe... | @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } finally { if (transferManager !... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... | S3S3Copier implements Copier { @Override public Metrics copy() throws CircusTrainException { registerRunningMetrics(bytesReplicated); try { try { initialiseAllCopyRequests(); processAllCopyJobs(); return gatherMetrics(); } catch (AmazonClientException e) { throw new CircusTrainException("Error in S3S3Copier:", e); } } ... |
@Test(expected = IllegalArgumentException.class) public void negativeNumberOfUploadWorkers() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: "-1"); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void multipartUploadThreshold() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getMultipartUploadThreshold(), is(48L)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void zeroMultipartUploadThreshold() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: "0"); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void negativeMultipartUploadThreshold() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: "-1"); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void maxMaps() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getMaxMaps(), is(15)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void zeroMaxMaps() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getMaxMaps(), is(1)); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test(expected = IllegalArgumentException.class) public void negativeMaxMaps() { parser.parse("--src", "hdfs: "--credentialsProvider", "jceks: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void copyStrategy() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getCopyStrategy(), is("mycopystrategy")); } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
@Test public void logPath() { S3MapReduceCpOptions options = parser.parse("--src", "hdfs: "hdfs: "jceks: assertThat(options.getLogPath(), is(new Path("hdfs: } | public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.getSources()) { i... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... | OptionsParser { public S3MapReduceCpOptions parse(String... args) throws IllegalArgumentException { try { jCommander.parse(args); } catch (Exception e) { throw new IllegalArgumentException("Unable to parse arguments: " + Arrays.toString(args), e); } if (options.isHelp()) { return options; } for (Path source : options.g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.