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

Should the type of key in AsyncHBaseByteArrayStore be string instead of Array[Byte]? #272

Open
yaochitc opened this issue Jun 3, 2015 · 4 comments

Comments

@yaochitc
Copy link

yaochitc commented Jun 3, 2015

During the test, I found that the key type of multiput returned map will be Array[Byte] under current implementation, which means it is impossible to get any value from the map through a get method. If I wrapped the store instance with something like Store.convert and call the multiput method on wrapped instance, l'll get an exception. Should this be changed?

@johnynek
Copy link
Collaborator

johnynek commented Jun 3, 2015

I don't follow. Can you link to the specific code? Is the point here that Array[T] has no good hashcode/equals?

If that is the issue, yes, we should work around. We have created wrapper types in the past to give a correct hashcode/equals. I think, for instance, ByteBuffer will work for this case.

Using a String limits us to keys that can be expressed must be valid strings.

@yaochitc
Copy link
Author

yaochitc commented Jun 4, 2015

Yes, that's the problem. As you said, use a wrapped class such as ByteBuffer maybe a better choice :)

@johnynek
Copy link
Collaborator

johnynek commented Jun 4, 2015

@yaochitc would you like to make a pull request? :)

@yaochitc
Copy link
Author

yaochitc commented Jun 8, 2015

Ok, I'll do it after a test. And what is more, I think the library should also make use of hbase'column:)

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