riak-scala-client icon indicating copy to clipboard operation
riak-scala-client copied to clipboard

Support for X-Riak-Meta-* headers

Open ajantis opened this issue 8 years ago • 4 comments

According to the official documentation, Riak supports storing X-Riak-Meta-* headers. These are additional metadata headers that can be stored (and retrieved) with the object.

This feature is about being able to store and fetch these headers alongside the RiakValue. It can be useful for storing additional metadata of a value without the need to extend value's (JSON) model.

It can be implemented as an additional RiakValue field.

ajantis avatar Feb 25 '17 18:02 ajantis

since which Riak version is this supported? And if it's fairly recent, can it be implemented in a backwards compatible way of should the library break compatibility?

Breaking backwards compatibility is not necessarily a bad thing, especially if those older Riak versions are not very common anymore. Just something to think about and make a decision about.

agemooij avatar Feb 26 '17 12:02 agemooij

Good point. It looks like it has been supported since at least Riak 1.0.0:

  • Riak 1.0.0: http://docs.basho.com/riak/1.0.0/tutorials/fast-track/Basic-Riak-API-Operations/#Object-Key-Operations ( X-Riak-Meta-YourHeader - any additional metadata headers that should be stored with the object. )
  • Riak 2.2 (latest): http://docs.basho.com/riak/kv/2.2.0/developing/api/http/store-object/

So, actually, there should be any backwards compatibility problems.

ajantis avatar Feb 26 '17 13:02 ajantis

It does ring a bell but as yo know I haven'y used Riak for many years. Are you sure it isn't supported already? If not, then it sounds like a good new feature.

agemooij avatar Feb 26 '17 15:02 agemooij

Yeah, I haven't found it in the client. Only these Riak-specific headers are supported now:

  val `X-Riak-ClientId` = "X-Riak-ClientId"
  val `X-Riak-Vclock` = "X-Riak-Vclock"
  val `X-Riak-Deleted` = "X-Riak-Deleted"

Cool. It won't be super hard to implement, IMO (just some additional constraints for API backwards compatibility, maybe).

ajantis avatar Feb 26 '17 16:02 ajantis