Skip to content
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

Merged

Conversation

Yury-Fridlyand
Copy link
Collaborator

Features:

@Yury-Fridlyand Yury-Fridlyand added the java issues and fixes related to the java client label Feb 21, 2024
@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner February 21, 2024 20:16
java/client/src/test/java/glide/api/RedisClientTest.java Outdated Show resolved Hide resolved
@@ -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();
Copy link
Collaborator

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")) {
Copy link
Collaborator

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]);

Copy link
Collaborator Author

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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

*
* @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.
Copy link
Contributor

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>
Copy link
Contributor

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>?

Copy link
Collaborator Author

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
Copy link
Contributor

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() {
Copy link
Contributor

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.

Copy link
Collaborator Author

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

Copy link
Contributor

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?

@Yury-Fridlyand
Copy link
Collaborator Author

Please, resolve conflicts

@SanHalacogluImproving SanHalacogluImproving force-pushed the java/integ_yuryf_config_rewrite_reset branch from e094f5f to 23d176a Compare March 5, 2024 20:11
Copy link
Collaborator Author

@Yury-Fridlyand Yury-Fridlyand left a 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

@Yury-Fridlyand Yury-Fridlyand merged commit b0dace0 into valkey-io:main Mar 6, 2024
11 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the java/integ_yuryf_config_rewrite_reset branch March 6, 2024 01:11
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. (#95)

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
Co-authored-by: SanHalacogluImproving <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java issues and fixes related to the java client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants