-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
There is confusion between bucket types and bucket datatypes that are crdt. I had some issues using strongly consistent types. I suggest saying that Riak.find/3 works with types while Riak.find/4 works with crdt datatypes or redoing the abstraction.
http://docs.basho.com/riak/kv/2.2.3/developing/usage/bucket-types/
# [Already started] 3 node riak cluster
riak-admin bucket-type create strongly_consistent \
'{"props":{"consistent":true}}'
riak-admin bucket-type activate strongly_consistent
# Test if the cluster is working
curl -v 172.17.0.2:8098/types/strongly_consistent/buckets/test/keys/hello \
-X PUT \
-H "Content-type: text/plain" \
-d "world"
curl -v 172.17.0.2:8098/types/strongly_consistent/buckets/test/keys/hello
# Elixir
{:ok, pid} = Riak.Connection.start_link('172.17.0.2', 8087)
{:ok, #PID<0.399.0>}
iex(3)> Riak.find(pid, "strongly_consistent", "test", "hello")
nil
iex(14)> Riak.find(pid, {"strongly_consistent", "test"}, "hello")
%Riak.Object{bucket: {"strongly_consistent", "test"},
content_type: 'text/plain', data: "world", key: "hello",
metadata: {:dict, 3, 16, 16, 8, 80, 48,
{[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []},
{{[], [], [], [], [], [], [], [], [], [],
[["content-type", 116, 101, 120, 116, 47, 112, 108, 97, 105, 110],
["X-Riak-VTag", 51, 66, 120, 87, 50, 84, 53, 68, 117, 97, 117, 71, 72,
85, 89, 101, 80, 55, 65, 109, 109, 118]], [], [],
[["X-Riak-Last-Modified" | {1492, 865281, 773593}]], [], []}}},
type: "strongly_consistent",
vclock: <<107, 206, 97, 96, 96, 96, 204, 96, 74, 97, 96, 73, 45, 78, 45,
204, 96, 202, 99, 101, 112, 0, 9, 1, 105, 198, 179, 249, 151, 248, 178,
0>>}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels