Skip to content

Commit 9f60f13

Browse files
committed
chore(backup): update status descriptions
1 parent 2657af6 commit 9f60f13

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,11 @@ public void test_lifecycle() throws IOException, TimeoutException {
112112

113113
// Act: delete data and restore backup #1
114114
client.collections.delete(nsA);
115-
client.backup.restore(backup_1, backend, restore -> restore.includeCollections(nsA));
115+
var restoreMe = client.backup.restore(backup_1, backend, restore -> restore.includeCollections(nsA));
116+
restoreMe.waitForCompletion(client);
116117

117118
// Assert: object inserted in the beginning of the test is present
118-
var restore_1 = client.backup.getRestoreStatus(backup_1, backend)
119-
.orElseThrow().waitForCompletion(client);
120-
Assertions.assertThat(restore_1).as("restore backup #1")
119+
Assertions.assertThat(restoreMe).as("restore backup #1")
121120
.returns(BackupStatus.SUCCESS, Backup::status);
122121
Assertions.assertThat(collectionA.size()).as("after restore backup #1").isEqualTo(1);
123122
}
@@ -215,10 +214,10 @@ public void test_lifecycle_async() throws ExecutionException, InterruptedExcepti
215214

216215
// Act: delete data and restore backup #1
217216
async.collections.delete(nsA).join();
218-
async.backup.restore(backup_1, backend, restore -> restore.includeCollections(nsA)).join();
217+
var restore_1 = async.backup.restore(backup_1, backend, restore -> restore.includeCollections(nsA)).join();
219218

220219
// Assert: object inserted in the beginning of the test is present
221-
var restore_1 = async.backup.getRestoreStatus(backup_1, backend)
220+
restore_1 = async.backup.getRestoreStatus(backup_1, backend)
222221
.thenCompose(bak -> bak.orElseThrow().waitForCompletion(async))
223222
.join();
224223
Assertions.assertThat(restore_1).as("restore backup #1")

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public enum BackupStatus {
1111
TRANSFERRING,
1212
/**
1313
* Cancellation has been claimed by a coordinator.
14-
* Used as a distributed lock to prevent race conditions when multiple coordinators
15-
* attempt to cancel the same restore.
14+
* Used as a distributed lock to prevent race conditions when multiple
15+
* coordinators attempt to cancel the same restore.
1616
*/
1717
@SerializedName("CANCELLING")
1818
CANCELLING,
@@ -28,10 +28,7 @@ public enum BackupStatus {
2828
/** Backup creation / restoration failed. */
2929
@SerializedName("FAILED")
3030
FAILED,
31-
/**
32-
* Backup creation canceled.
33-
* This status is never returned for backup restorations.
34-
*/
31+
/** Backup creation canceled. */
3532
@SerializedName("CANCELED")
3633
CANCELED;
3734
}

0 commit comments

Comments
 (0)