Add RestoreCommand as CliCommand#29
Draft
narendly wants to merge 1 commit intolinkedin:li-dev/release-3.6.2-1-backupfrom
Draft
Add RestoreCommand as CliCommand#29narendly wants to merge 1 commit intolinkedin:li-dev/release-3.6.2-1-backupfrom
narendly wants to merge 1 commit intolinkedin:li-dev/release-3.6.2-1-backupfrom
Conversation
This commit adds restore as one of the ZkCli commands. We want to support this in the command line client so that it will be easy to use for ZK operators along with other CLI commands. Note that this commit only adds the skeleton and the main restoration logic will have to be implemented in a future commit.
junkaixue
reviewed
Feb 22, 2021
| */ | ||
| public void parseArgs(String[] args) throws ConfigException { | ||
| // Check the num of args | ||
| if (args.length != 4 && args.length != 5) { |
There was a problem hiding this comment.
From a cli perspective, it is not a good idea to fix the number of arguments. Also order of arguments should not matter. The better way could be scanning the input arguments to find whether there is a matching option.
| try { | ||
| zxidToRestore = Long.parseLong(numStr, base); | ||
| } catch (NumberFormatException nfe) { | ||
| System.err.println("Invalid number specified for restore point"); |
There was a problem hiding this comment.
NIT: you may output the numStr as well.
mgao0
reviewed
Feb 24, 2021
| // TODO: Construct a BackupConfig | ||
| BackupConfig backupConfig = new BackupConfig.Builder().build().get(); | ||
|
|
||
| storage = new FileSystemBackupStorage(backupConfig); |
There was a problem hiding this comment.
Can we use reflection to make this flexible too?
a5f3e48 to
8b16e3e
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit adds restore as one of the ZkCli commands. We want to support this in the command line client so that it will be easy to use for ZK operators along with other CLI commands. Note that this commit only adds the skeleton and the main restoration logic will have to be implemented in a future commit.