mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(s3): resolve file/folder name collision on persistent filesystem (#134)
* fix(s3): resolve file/folder name collision on local filesystem When using floci persistent option with Scala Spark. Spark creates S3 keys doing a PutObject for something like `output.parquet/part-0001.parquet` and then another PutObject for `output.parquet`. It work on S3 since it allows it. Append a `.s3data` suffix to all stored data files on disk to prevent collision * fix(s3): add test for object marker and child file conflict resolution * fix(s3): refactor versioned file test to use separate S3Service instance
This commit is contained in:
1 parent
f44d3bc05e
commit
020a54642d
3 files changed
+70
-6
No files matched your search
@@ -1283,12 +1283,14 @@ public class S3Service {
|
||||
return bucketName + "/" + key + "#v#" + versionId;
|
||||
}
|
||||
|
||||
private static final String DATA_SUFFIX = ".s3data";
|
||||
|
||||
private Path resolveObjectPath(String bucketName, String key) {
|
||||
return dataRoot.resolve(bucketName).resolve(key);
|
||||
return dataRoot.resolve(bucketName).resolve(key + DATA_SUFFIX);
|
||||
}
|
||||
|
||||
private Path resolveVersionedPath(String bucketName, String key, String versionId) {
|
||||
return dataRoot.resolve(".versions").resolve(bucketName).resolve(key).resolve(versionId);
|
||||
return dataRoot.resolve(".versions").resolve(bucketName).resolve(key).resolve(versionId + DATA_SUFFIX);
|
||||
}
|
||||
|
||||
private void writeVersionedFile(String bucketName, String key, String versionId, byte[] data) {
|
||||
|
||||
Reference in new issue
Block a user