@Test void sentinelFileWithSpaceInKey() { String partition1Sentinel = "table/ /partition_1_$folder$"; String partition1AbsolutePath = "s3: amazonS3.putObject(bucket, partition1Sentinel, ""); s3SentinelFilesCleaner.deleteSentinelFiles(partition1AbsolutePath); assertThat(amazonS3.doesObjectExist(bucket, partition1Sentinel)).isFalse(); }
@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);  }