Skip to content

Commit bbe4af1

Browse files
authored
Merge pull request #585 from weaviate/feat/incremental_base_backup_id
feat(backup): Support incremental backups
2 parents 5c6b841 + 47e0005 commit bbe4af1

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/it/java/io/weaviate/integration/BackupITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public void test_lifecycle_async() throws ExecutionException, InterruptedExcepti
245245
@Test(expected = IllegalStateException.class)
246246
public void test_waitForCompletion_unknown() throws IOException, TimeoutException {
247247
var backup = new Backup("#1", "/tmp/bak/#1", "filesystem", List.of("Things"), BackupStatus.STARTED,
248-
null, null, null, null, null);
248+
null, null, null, null, null, null);
249249
backup.waitForCompletion(client);
250250
}
251251

src/main/java/io/weaviate/client6/v1/api/backup/Backup.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public record Backup(
3535
@SerializedName("completedAt") OffsetDateTime completedAt,
3636
/** Backup size in GiB. */
3737
@SerializedName("size") Float sizeGiB,
38+
/** Prefix for the incremental backup IDs. */
39+
@SerializedName("incremental_base_backup_id") String prefixIncremental,
3840
/**
3941
* This value indicates if a backup is being created or restored from.
4042
* For operations like LIST this value is null.
@@ -55,6 +57,7 @@ Backup withOperation(Operation operation) {
5557
startedAt,
5658
completedAt,
5759
sizeGiB,
60+
prefixIncremental,
5861
operation);
5962
}
6063

src/main/java/io/weaviate/client6/v1/api/backup/CreateBackupRequest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public static record BackupCreate(
2626
@SerializedName("id") String id,
2727
@SerializedName("include") List<String> includeCollections,
2828
@SerializedName("exclude") List<String> excludeCollections,
29+
@SerializedName("incremental_base_backup_id") String prefixIncremental,
2930
@SerializedName("config") Config config) {
3031

3132
private static record Config(
@@ -48,6 +49,7 @@ public BackupCreate(Builder builder) {
4849
builder.backupId,
4950
builder.includeCollections,
5051
builder.excludeCollections,
52+
builder.prefixIncremental,
5153
new Config(
5254
builder.cpuPercentage,
5355
builder.compressionLevel,
@@ -58,6 +60,7 @@ public BackupCreate(Builder builder) {
5860
public static class Builder implements ObjectBuilder<BackupCreate> {
5961
private final String backupId;
6062

63+
private String prefixIncremental;
6164
private Integer cpuPercentage;
6265
private CompressionLevel compressionLevel;
6366
private String bucket;
@@ -69,6 +72,12 @@ public Builder(String backupId) {
6972
this.backupId = backupId;
7073
}
7174

75+
/** Prefix for incremental backup IDs. */
76+
public Builder prefixIncremental(String prefixIncremental) {
77+
this.prefixIncremental = prefixIncremental;
78+
return this;
79+
}
80+
7281
/** Collection that should be included in the backup. */
7382
public Builder includeCollections(String... includeCollections) {
7483
return includeCollections(Arrays.asList(includeCollections));

0 commit comments

Comments
 (0)