retrieving avro data from voldemort

172 views
Skip to first unread message

Sukhendu Chakraborty

unread,
Jun 6, 2013, 3:34:18 PM6/6/13
to project-...@googlegroups.com
Here is the key and value schema definition in stores.xml:
<key-serializer>
      <type>avro-generic</type>
      <schema-info>"long"</schema-info>
</key-serializer>
<value-serializer>
      <type>avro-generic</type>
      <schema-info>
    {"type":"array","items":{"type":"record","name":"UserAttribute","namespace":"com.rr.avro","fields":[{"name":"attributeName","type":"string"},{"name":"attributeValues","type":{"type":"array","items":"string"}}]}}
     </schema-info>
</value-serializer>

I was successfully able to bulk load data into this store, however, when I try to retrieve data using, I  encounter the following error. Can you point me to whats going wrong here?
Thanks for your help,
-Sukhendu

get "1"
Unexpected error:
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long
at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:79)
at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:58)
at voldemort.serialization.avro.AvroGenericSerializer.toBytes(AvroGenericSerializer.java:58)
at voldemort.store.serialized.SerializingStore.keyToBytes(SerializingStore.java:74)
at voldemort.store.serialized.SerializingStore.get(SerializingStore.java:103)
at voldemort.store.DelegatingStore.get(DelegatingStore.java:60)
at voldemort.store.versioned.InconsistencyResolvingStore.get(InconsistencyResolvingStore.java:50)
at voldemort.client.DefaultStoreClient.get(DefaultStoreClient.java:133)
at voldemort.client.DefaultStoreClient.get(DefaultStoreClient.java:185)
at voldemort.VoldemortClientShell.processCommands(VoldemortClientShell.java:196)
at voldemort.VoldemortClientShell.main(VoldemortClientShell.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)
get 1
Unexpected error:
java.lang.ClassCastException: java.lang.Byte cannot be cast to java.lang.Long
at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:79)
at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:58)
at voldemort.serialization.avro.AvroGenericSerializer.toBytes(AvroGenericSerializer.java:58)
at voldemort.store.serialized.SerializingStore.keyToBytes(SerializingStore.java:74)
at voldemort.store.serialized.SerializingStore.get(SerializingStore.java:103)
at voldemort.store.DelegatingStore.get(DelegatingStore.java:60)
at voldemort.store.versioned.InconsistencyResolvingStore.get(InconsistencyResolvingStore.java:50)
at voldemort.client.DefaultStoreClient.get(DefaultStoreClient.java:133)
at voldemort.client.DefaultStoreClient.get(DefaultStoreClient.java:185)
at voldemort.VoldemortClientShell.processCommands(VoldemortClientShell.java:196)
at voldemort.VoldemortClientShell.main(VoldemortClientShell.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)

Bertrand Dechoux

unread,
Jun 28, 2013, 4:42:59 AM6/28/13
to project-...@googlegroups.com
I can not confirm that but it seemed to me that the shell client was only able to use a json/string key for querying.
The error is stating that, at least. And I had the same.

If you want to test your value you will have to create your own client which will query Voldemort the right way.

Bertrand

PS : I guess it should be possible to interpret the provided key as a json and transform into avro to query Voldemort but I doubt it has been done so.

Chinmay Soman

unread,
Jul 20, 2013, 7:27:02 PM7/20/13
to project-...@googlegroups.com
Your client might have an outdated schema. Did you change the schema in any way ? Were the clients re-bootstrapped after that ?
Reply all
Reply to author
Forward
0 new messages