@Test void invalidS3Path() { String invalidS3AbsolutePath = "table/partition_1"; assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> s3SentinelFilesCleaner.deleteSentinelFiles(invalidS3AbsolutePath)) .withMessage("Invalid S3 URI: no hostname: %s", invalidS3AbsolutePath); }
@Override public void deleteSentinelFiles(String absolutePath) { AmazonS3URI s3Path = new AmazonS3URI(absolutePath, true); String bucket = s3Path.getBucket(); String key = s3Path.getKey(); getSentinelFile(bucket, key).ifPresent(sentinelFile -> s3Client.deleteObject(bucket, sentinelFile)); }
S3SentinelFilesCleaner implements SentinelFilesCleaner { @Override public void deleteSentinelFiles(String absolutePath) { AmazonS3URI s3Path = new AmazonS3URI(absolutePath, true); String bucket = s3Path.getBucket(); String key = s3Path.getKey(); getSentinelFile(bucket, key).ifPresent(sentinelFile -> s3Client.deleteObject(bucket, sentinelFile)); } }
S3SentinelFilesCleaner implements SentinelFilesCleaner { @Override public void deleteSentinelFiles(String absolutePath) { AmazonS3URI s3Path = new AmazonS3URI(absolutePath, true); String bucket = s3Path.getBucket(); String key = s3Path.getKey(); getSentinelFile(bucket, key).ifPresent(sentinelFile -> s3Client.deleteObject(bucket, sentinelFile)); } S3SentinelFilesCleaner(S3Client s3Client); }
S3SentinelFilesCleaner implements SentinelFilesCleaner { @Override public void deleteSentinelFiles(String absolutePath) { AmazonS3URI s3Path = new AmazonS3URI(absolutePath, true); String bucket = s3Path.getBucket(); String key = s3Path.getKey(); getSentinelFile(bucket, key).ifPresent(sentinelFile -> s3Client.deleteObject(bucket, sentinelFile)); } S3SentinelFilesCleaner(S3Client s3Client); @Override void deleteSentinelFiles(String absolutePath); }
S3SentinelFilesCleaner implements SentinelFilesCleaner { @Override public void deleteSentinelFiles(String absolutePath) { AmazonS3URI s3Path = new AmazonS3URI(absolutePath, true); String bucket = s3Path.getBucket(); String key = s3Path.getKey(); getSentinelFile(bucket, key).ifPresent(sentinelFile -> s3Client.deleteObject(bucket, sentinelFile)); } S3SentinelFilesCleaner(S3Client s3Client); @Override void deleteSentinelFiles(String absolutePath);  }