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

Issues getting value from view #83

Closed
burdiyan opened this issue Feb 5, 2018 · 5 comments
Closed

Issues getting value from view #83

burdiyan opened this issue Feb 5, 2018 · 5 comments

Comments

@burdiyan
Copy link
Contributor

burdiyan commented Feb 5, 2018

I'm facing weird issue with views:

I have a topic with 10 partitions, where each message has a string key.

I create a view for this topic, wait until view is recovered, than do Get for a key that I'm really sure exists, and I get nil value and nil error.

BUT, the weirdest thing is that when I create an iterator for that view, I see that there is actually a message for this key.

And even after iterating, when I try to access the same key, I continue seeing nil value and nil error.

Does anyone know what can I be missing?

@burdiyan
Copy link
Contributor Author

burdiyan commented Feb 5, 2018

My bad. The messages in my topic were partitioned using JVM client and it's default hasher, which is not the one Sarama is using by default. When I passed our ported version of the hasher to the view, it worked.

Would you admit a contribution for a JVM compatible hasher? I already ported the algorithm used in JVM clients to Go and it works correctly.

@burdiyan
Copy link
Contributor Author

burdiyan commented Feb 5, 2018

Well, there is a problem with that when you use the view as lookup. There is no way to pass hasher to the lookup view, and the hasher you pass to the processor, is not propagated to the underlying view.

@burdiyan
Copy link
Contributor Author

burdiyan commented Feb 5, 2018

I'll create a separate issue for that. But on the other hand let me know you'd like to see contribution for a JVM compatible hasher. I think it's useful if you're using some of the tools from the Kafka ecosystem, like Kafka Connect.

@burdiyan burdiyan closed this as completed Feb 5, 2018
@db7
Copy link
Collaborator

db7 commented Feb 7, 2018

It would be nice to have the murmur2 hasher available in goka.

@burdiyan
Copy link
Contributor Author

burdiyan commented Feb 8, 2018

I'll try to submit a PR as soon as I can. For now, I have it implemented in my kafkautil library: https://github.com/burdiyan/kafkautil/blob/master/partitioner.go#L27 for those who are interested.

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

No branches or pull requests

2 participants