Pregunta

Riak supports auto generated keys when storing an object:

http://wiki.basho.com/Basic-Riak-API-Operations.html:

Store a new object and assign random key #

If your application would rather leave key-generation up to Riak, issue a POST request to the bucket URL instead of a PUT to a bucket/key pair: POST /riak/bucket If you don’t pass Riak a “key” name after the bucket, it will know to create one for you.

is it possible to do the same when using the java client? it seems that key must be provided when storing an object.

¿Fue útil?

Solución

Edited to update: This is now available in the Java client. It was added in the 1.0.7 client release. See: https://github.com/basho/riak-java-client/pull/168


Unfortunately ... right now the Java client doesn't support this.

Someone has opened an issue for this: https://github.com/basho/riak-java-client/issues/141

I agree that it needs to be added. We've got a number of things we're working on at the moment for the Riak 1.2 release that are slightly higher priority, but I hope to work on this and get it added in the near future.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top