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 support for STRALGO #1282

Closed
wants to merge 5 commits into from
Closed

Add support for STRALGO #1282

wants to merge 5 commits into from

Conversation

dengliming
Copy link
Contributor

@dengliming dengliming commented May 3, 2020

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

#1280

@codecov
Copy link

codecov bot commented May 3, 2020

Codecov Report

Merging #1282 into main will decrease coverage by 0.03%.
The diff coverage is 84.61%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1282      +/-   ##
============================================
- Coverage     80.30%   80.26%   -0.04%     
- Complexity     6000     6118     +118     
============================================
  Files           423      432       +9     
  Lines         19753    20120     +367     
  Branches       2234     2274      +40     
============================================
+ Hits          15862    16149     +287     
- Misses         2858     2924      +66     
- Partials       1033     1047      +14     
Impacted Files Coverage Δ Complexity Δ
...c/main/java/io/lettuce/core/StringMatchResult.java 80.64% <80.64%> (ø) 7.00 <7.00> (?)
src/main/java/io/lettuce/core/StrAlgoArgs.java 84.61% <84.61%> (ø) 13.00 <13.00> (?)
...o/lettuce/core/output/StringMatchResultOutput.java 84.61% <84.61%> (ø) 10.00 <10.00> (?)
...va/io/lettuce/core/AbstractRedisAsyncCommands.java 96.50% <100.00%> (+0.03%) 418.00 <1.00> (+4.00)
...io/lettuce/core/AbstractRedisReactiveCommands.java 89.37% <100.00%> (-0.13%) 409.00 <1.00> (+3.00) ⬇️
...main/java/io/lettuce/core/RedisCommandBuilder.java 94.48% <100.00%> (+0.29%) 456.00 <1.00> (+6.00)
...ain/java/io/lettuce/core/protocol/CommandType.java 100.00% <100.00%> (ø) 3.00 <0.00> (ø)
...o/lettuce/core/models/role/RedisSlaveInstance.java 55.55% <0.00%> (-44.45%) 2.00% <0.00%> (-6.00%)
...ttuce/core/support/ClientResourcesFactoryBean.java 46.66% <0.00%> (-13.34%) 4.00% <0.00%> (-1.00%)
...core/masterslave/MasterSlaveConnectionWrapper.java 29.03% <0.00%> (-11.71%) 5.00% <0.00%> (-2.00%)
... and 72 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd72456...3329f85. Read the comment docs.

@mp911de mp911de added this to the 6.0 RC1 milestone Jun 8, 2020
@mp911de
Copy link
Collaborator

mp911de commented Jun 8, 2020

Thanks for the pull request. STRALGO indicates a series of commands where it makes sense to model each command with its own method. So rather LCS being part of StrAlgoArgs, we should have a stralgoLcs(StrAlgoArgs) method and remove LCS from StrAlgoArgs. So StringAlgorithm isn't needed as type.

It also makes sense to provide a Charset option for the String-based variant.

@mp911de mp911de added the type: feature A new feature label Jun 8, 2020
@dengliming
Copy link
Contributor Author

Thanks for the pull request. STRALGO indicates a series of commands where it makes sense to model each command with its own method. So rather LCS being part of StrAlgoArgs, we should have a stralgoLcs(StrAlgoArgs) method and remove LCS from StrAlgoArgs. So StringAlgorithm isn't needed as type.

It also makes sense to provide a Charset option for the String-based variant.

Thanks for reviewing. I will fix it later.

@dengliming
Copy link
Contributor Author

@mp911de I'm a little confused here. It also makes sense to provide a Charset option for the String-based variant. You mean like this?

public StrAlgoArgs charset(Charset charset) {
        this.charset = charset;
        return this;
    }

io.lettuce.core.StrAlgoArgs#build

 for (String key : keys) {
            args.add(key.getBytes(charset));
        }

@mp911de mp911de changed the base branch from master to main June 13, 2020 10:20
@mp911de
Copy link
Collaborator

mp911de commented Jun 19, 2020

Yes, something along the lines but for STRINGS and not KEYS, so the code would be strings(Charset charset, String... strings) while keys(…) remains as-is.

@dengliming
Copy link
Contributor Author

Yes, something along the lines but for STRINGS and not KEYS, so the code would be strings(Charset charset, String... strings) while keys(…) remains as-is.

@mp911de Thanks. fixed it at lastest commit. please re-review.

@mp911de mp911de modified the milestones: 6.0 RC1, 5.3.2 Jun 24, 2020
mp911de pushed a commit that referenced this pull request Jun 25, 2020
Original pull request: #1282.
mp911de added a commit that referenced this pull request Jun 25, 2020
Add since tags. Tweak Javadoc. Make output immutable. Refactor StrAlgoArgs assertions.

Original pull request: #1282.
mp911de pushed a commit that referenced this pull request Jun 25, 2020
Original pull request: #1282.
mp911de added a commit that referenced this pull request Jun 25, 2020
Add since tags. Tweak Javadoc. Make output immutable. Refactor StrAlgoArgs assertions.

Original pull request: #1282.
@mp911de
Copy link
Collaborator

mp911de commented Jun 25, 2020

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants