@Test void sentinelFileForEmptyParentPathHasTableNameSuffix() { String testTable = "test" + tableName; String partitionSentinel = testTable + "/id1/partition_1_$folder$"; String partitionParentSentinel = testTable + "/id1_$folder$"; String partitionAbsolutePath = "s3: amazonS3.putObject(bucket, partitionSentinel, ""); amazonS3.putObject(bucket, partitionParentSentinel, ""); s3SentinelFilesCleaner.deleteSentinelFiles(partitionAbsolutePath); assertThat(amazonS3.doesObjectExist(bucket, partitionSentinel)).isFalse(); assertThat(amazonS3.doesObjectExist(bucket, partitionParentSentinel)).isTrue(); }
@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);  }