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

(#2120) GeoRadius support store and storedist option with params #2157

Merged
merged 3 commits into from
Dec 6, 2020

Conversation

yangbodong22011
Copy link
Collaborator

@yangbodong22011 yangbodong22011 commented Mar 2, 2020

Resolves #2120
Different from #2140, it is implemented with params.

Closes #2140

@sazzad16
Copy link
Collaborator

sazzad16 commented Mar 2, 2020

LGTM!

@sazzad16 sazzad16 added this to the 3.3.0 milestone Mar 2, 2020
@sazzad16 sazzad16 requested a review from gkorland March 6, 2020 16:31
import redis.clients.jedis.util.SafeEncoder;

public class GeoRadiusStoreParam extends Params {
private static final String STORE = "store";
Copy link
Contributor

Choose a reason for hiding this comment

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

@yangbodong22011 I would have set these (STORE &STOREDIST) as Keywords so you won't have to re-serialize them on each call

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm afraid I don't understand what you mean. Can you give an example?

Copy link
Contributor

Choose a reason for hiding this comment

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

See redis.clients.jedis.Protocol.Keyword

Copy link
Collaborator

Choose a reason for hiding this comment

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

@gkorland (Almost?) None of the Params classes use Keyword yet. May be we can create a separate issue to improve this?

}

public byte[][] getByteParams(byte[]... args) {
ArrayList<byte[]> byteParams = new ArrayList<byte[]>();
Copy link
Contributor

Choose a reason for hiding this comment

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

When is that method used?

Copy link
Collaborator Author

@yangbodong22011 yangbodong22011 Mar 16, 2020

Choose a reason for hiding this comment

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

When is that method used?

It is currently useless, I followed GeoRadiusParam.

}

public byte[][] getByteKeys(byte[] key) {
List<byte[]> keys = new LinkedList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think list it an over kill here, you can easily find if you need an array of 2 or 1


public GeoRadiusStoreParam store(String key) {
if (key != null) {
addParam(STORE, key);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need it to be Params? it can only be one of the two options.
Params seems like a waste here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@gkorland It was actually my idea. You can check alternate implementation #2140

@yangbodong22011
Copy link
Collaborator Author

@gkorland @sazzad16 Hello, I want to continue to improve PR, please give me some specific suggestions.

@sazzad16
Copy link
Collaborator

@yangbodong22011 Please bear some patience. I'm sure @gkorland would jump in whenever he gets some free time. BTW, thanks for your enthusiasm!

@yangbodong22011
Copy link
Collaborator Author

@sazzad16 OK, I will be patient and thank you very much for your reply.

@sazzad16 sazzad16 modified the milestones: 3.3.0, 3.4.0 Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

please implements GeoRadius [STORE key] [STOREDIST key] param!
3 participants