-
Notifications
You must be signed in to change notification settings - Fork 5
feat: restore dry run #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Logaka
wants to merge
53
commits into
main
Choose a base branch
from
feat/restore-dryRun
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
07e49bd
feat: expand filtering
Logaka 9765ff6
refactor: rewrite dynamic SQL filter
Logaka e0963a5
Merge branch 'main' into feat/backupV2-add-complex-filtering
Logaka f665ab3
feat: add NotEmptyFilter validation to Filter class
Logaka af1004a
feat: expanded filtering for external databases
Logaka 5563e44
feat: add dryRun
Logaka b011b17
Merge branch 'refs/heads/main' into feat/restore-dryRun
Logaka 31e33e7
feat: change restore classifier variable
Logaka fb32b57
Merge branch 'main' into feat/backupV2-add-complex-filtering
Logaka 6b56a7d
fix: prevent empty filter from generating invalid WHERE clause
Logaka 891c12f
fix: prevent state-changing logic during dry-run in findSimilarDbByCl…
Logaka 9ba3487
test: add tests for dry-run
Logaka 7380508
refactor: reorganize packages
Logaka d279bd2
refactor: remove attemptCount, duration fields
Logaka 987e061
Merge branch 'main' into feat/retry-restore
Logaka 398e385
feat: implement retry restore
Logaka ed61408
refactor: conditional return to stream map
Logaka a20d0e6
Merge branch 'feat/restore-dryRun' into feat/retry-restore
Logaka ea34805
refactor: prevent lock method duplication
Logaka e912a3f
refactor: add validation for RestoreRequest
Logaka 8ad5d86
refactor: make databaseKind join conditional
Logaka 9f6d293
refactor: make kinds validation flexible
Logaka 371fb8a
feat: add new attribute to Classifier entity
Logaka f405a8e
refactor: change restore processing exceptions
Logaka 8034dbe
refactor: rewrite collision catching logic
Logaka 2ec4e9d
Merge branch 'feat/backupV2-add-complex-filtering' into feat/restore-…
Logaka a0bf7cd
Merge branch 'feat/retry-restore' into feat/restore-dryRun
Logaka 8856251
chore: reformat code
Logaka 1d55eac
feat: add validation annotations for dto
Logaka 76cdd39
chore: rename method, logs, error messages
Logaka b108e69
refactor: simplify mapping by removing BackupExternalDelegate
Logaka 5d63dca
feat: prevent restore empty databases
Logaka 2194470
Merge branch 'main' into feat/restore-dryRun
Logaka 5862147
fix: adding missed statuses for OpenApi
Logaka b85d622
refactor: separate mapping, enriching classifiers operation
Logaka b3fbe74
fix: remove NOT_STARTED status from aggregate method and fix mapping
Logaka b56a238
style: remove redundant required attribute
Logaka 98874ae
style: fix OpenApi spec
Logaka 1260506
feat: add new flyway migration that mark all status fields in entitie…
Logaka 09d947b
fix: add default status to logical backup
Logaka d4a010f
fix: take out try catch block from transactional method
Logaka 76838e3
chore: remove unused imports
Logaka ed2b81e
refactor: invert methods
Logaka ec959f2
refactor: replace entity builder with constructor
Logaka d313d81
refactor: replace entity builder with constructor
Logaka 8d49e74
feat: replace auto generating id to manually
Logaka 4a4b0ab
feat: rewrite retryRestore
Logaka a1d76c3
Merge branch 'main' into feat/restore-dryRun
ArkuNC 157b3a0
style: detailed OpenApi
Logaka 0b72355
chore: rename entities and dtos
Logaka d14faa0
style: update OpenApi
Logaka b4d300b
chore: update entity
Logaka 948be71
refactor: simplify first classifier selection
Logaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dbaas-aggregator/src/main/java/com/netcracker/cloud/dbaas/dto/backupV2/BackupRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Logaka marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...-aggregator/src/main/java/com/netcracker/cloud/dbaas/dto/backupV2/ClassifierResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package com.netcracker.cloud.dbaas.dto.backupV2; | ||
|
|
||
| import com.netcracker.cloud.dbaas.enums.ClassifierType; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.util.SortedMap; | ||
|
|
||
| @Data | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class ClassifierResponse { | ||
| private ClassifierType type; | ||
| private SortedMap<String, Object> classifier; | ||
| private SortedMap<String, Object> classifierBeforeMapper; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Logaka marked this conversation as resolved.
Show resolved
Hide resolved
Logaka marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Logaka marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...baas-aggregator/src/main/java/com/netcracker/cloud/dbaas/dto/backupV2/RestoreRequest.java
Logaka marked this conversation as resolved.
Show resolved
Hide resolved
Logaka marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Logaka marked this conversation as resolved.
Show resolved
Hide resolved
Logaka marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../src/main/java/com/netcracker/cloud/dbaas/entity/dto/backupV2/BackupDatabaseDelegate.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| package com.netcracker.cloud.dbaas.entity.dto.backupV2; | ||
|
|
||
| import com.netcracker.cloud.dbaas.entity.pg.backupV2.Classifier; | ||
| import com.netcracker.cloud.dbaas.entity.pg.backupV2.BackupDatabase; | ||
|
|
||
| import java.util.List; | ||
| import java.util.SortedMap; | ||
|
|
||
|
|
||
| public record BackupDatabaseDelegate(BackupDatabase backupDatabase, | ||
| List<SortedMap<String, Object>> classifiers) {} | ||
| List<Classifier> classifiers) {} |
9 changes: 9 additions & 0 deletions
9
.../src/main/java/com/netcracker/cloud/dbaas/entity/dto/backupV2/BackupExternalDelegate.java
Logaka marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.netcracker.cloud.dbaas.entity.dto.backupV2; | ||
|
|
||
| import com.netcracker.cloud.dbaas.entity.pg.backupV2.Classifier; | ||
| import com.netcracker.cloud.dbaas.entity.pg.backupV2.BackupExternalDatabase; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record BackupExternalDelegate(BackupExternalDatabase backupExternalDatabase, List<Classifier> classifiers) { | ||
| } |
29 changes: 29 additions & 0 deletions
29
...as-aggregator/src/main/java/com/netcracker/cloud/dbaas/entity/pg/backupV2/Classifier.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.netcracker.cloud.dbaas.entity.pg.backupV2; | ||
|
|
||
| import com.netcracker.cloud.dbaas.enums.ClassifierType; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.util.Objects; | ||
| import java.util.SortedMap; | ||
|
|
||
| @Data | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class Classifier { | ||
Logaka marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| private ClassifierType type; | ||
| private SortedMap<String, Object> classifier; | ||
| private SortedMap<String, Object> classifierBeforeMapper; | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (!(o instanceof Classifier that)) return false; | ||
| return type == that.type && Objects.equals(classifier, that.classifier) && Objects.equals(classifierBeforeMapper, that.classifierBeforeMapper); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(type, classifier, classifierBeforeMapper); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
dbaas/dbaas-aggregator/src/main/java/com/netcracker/cloud/dbaas/enums/ClassifierType.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.netcracker.cloud.dbaas.enums; | ||
|
|
||
| public enum ClassifierType { | ||
| NEW, REPLACED, TRANSIENT_REPLACED | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.