Skip to content

Commit

Permalink
fix(backup/gcs): don't use leading '/' when basePath is not set
Browse files Browse the repository at this point in the history
(cherry picked from commit ce6b1e2)
  • Loading branch information
lenaschoenburg committed Apr 4, 2023
1 parent 8618e28 commit 54c3a4b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ final class FileSetManager {
*
* <ul>
* <li>{@code basePath}
* <li>"contents
* <li>{@code "contents"}
* <li>{@code partitionId}
* <li>{@code checkpointId}
* <li>{@code nodeId}
* <li>{@code fileSetName}
* </ul>
*/
private static final String PATH_FORMAT = "%s/contents/%s/%s/%s/%s/";
private static final String PATH_FORMAT = "%scontents/%s/%s/%s/%s/";

private final Storage client;
private final BucketInfo bucketInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public GcsBackupStore(final GcsBackupConfig config) {

public GcsBackupStore(final GcsBackupConfig config, final Storage client) {
final var bucketInfo = BucketInfo.of(config.bucketName());
final var basePath = Optional.ofNullable(config.basePath()).orElse("");
final var basePath = Optional.ofNullable(config.basePath()).map(s -> s + "/").orElse("");
this.client = client;
executor = Executors.newWorkStealingPool(4);
manifestManager = new ManifestManager(client, bucketInfo, basePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public final class ManifestManager {
* <li>{@code "manifests"}
* </ul>
*/
private static final String MANIFESTS_ROOT_PATH_FORMAT = "%s/manifests/";
private static final String MANIFESTS_ROOT_PATH_FORMAT = "%smanifests/";
/**
* The path format consists of the following elements:
*
Expand Down

0 comments on commit 54c3a4b

Please sign in to comment.