-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add CONFIG REWRITE
and CONFIG RESETSTAT
.
#1013
Add CONFIG REWRITE
and CONFIG RESETSTAT
.
#1013
Conversation
@@ -130,6 +132,10 @@ public void transaction_builds_protobuf_request(BaseTransaction<?> transaction) | |||
transaction.scard("key"); | |||
results.add(Pair.of(SCard, ArgsArray.newBuilder().addArgs("key").build())); | |||
|
|||
transaction.configRewrite().configResetStat(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are cheating ;)
public class TestUtilities { | ||
/** Extract integer parameter value from INFO command output */ | ||
public static int getValueFromInfo(String data, String value) { | ||
for (var line : data.split("\r\n")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: suggestion:
Optional<String>
line = Arrays.stream(data.split("\r\n")).filter(l -> l.contains(value)).findFirst();
if (line.isEmpty()) {
fail();
}
return Integer.parseInt(line.get().split(":")[1]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are blank lines between sections
return baseTransaction; | ||
} | ||
|
||
public static Object[] transactionTestResult() { | ||
return new Object[] { | ||
"OK", | ||
OK, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
java/client/src/main/java/glide/api/commands/ServerManagementClusterCommands.java
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/ServerManagementClusterCommands.java
Show resolved
Hide resolved
d1836dc
to
e6d7e25
Compare
* | ||
* @see <a href="https://redis.io/commands/config-rewrite/">redis.io</a> for details. | ||
* @return <code>OK</code> when the configuration was rewritten properly, otherwise an error is | ||
* raised. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raised -> thrown
throughout
* @return <code>OK</code> when the configuration was rewritten properly, otherwise an error is | ||
* raised. | ||
* @example | ||
* <pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throughout - should there be empty spaces before the <pre>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tricks of java linter (spotless)
* Rewrite the configuration file with the current configuration. | ||
* | ||
* @see <a href="https://redis.io/commands/config-rewrite/">redis.io</a> for details. | ||
* @return <code>OK</code> when the configuration was rewritten properly, otherwise an error is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no error will be raised. please check the documentation - sometimes there's a difference between the client docs and transaction docs.
|
||
@Test | ||
@SneakyThrows | ||
public void config_reset_stat() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing the config rewrite tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no IT for
CONFIG REWRITE
, because redis in IT runs without config file
The command fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you seen how the other wrappers implemented these tests?
Please, resolve conflicts |
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
e094f5f
to
23d176a
Compare
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed that before
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. (#95) --------- Signed-off-by: Yury-Fridlyand <[email protected]> Co-authored-by: SanHalacogluImproving <[email protected]>
Features:
CONFIG REWRITE
https://redis.io/commands/config-rewrite/CONFIG RESETSTAT
https://redis.io/commands/config-resetstat/CONFIG REWRITE
, because redis in IT runs without config file