JSON serial number for arbitrary HashMaps in Voldemort

I am trying to configure the Voldemort keystore configuration. Now I would like to be able to store arbitrary hashmaps in it, but I have not found a way to do this (or, if possible).

According to the documentation, I have to use this syntax:

{"fname":"string", "lname":"string", "id":"int32", "emails":["string"]}

To specify that I want to save the view HashMap Java bean, but with restrictions on the permitted keys (only fname, lname, idand emails) and their types.

I will need to be able to store an arbitrary card as follows:

{"name":"fred", "id":15}

or like this:

{"apples":"50$", "oranges":"15€"}

(Map values ​​are meaningless, just an illustration of maps with different key names and value types)

Is there a way to determine a scheme that will accept an arbitrary hash file?

+3
1

, , - ( [] ) . ( Jackson):

  ObjectMapper mapper = new ObjectMapper();
  // to store:
  byte[] data = mapper.writeValueAsBytes(myMap);
  // and when retrieving back:
  Map<String,Object> data = mapper.readValue(data, Map.class);

Voldemort "JSON-like" ( JSON, , ), , , .

+3

Source: https://habr.com/ru/post/1778552/


All Articles