Closed GoogleCodeExporter closed 8 years ago
Results contain also a confirmation for the commit:
> cs_api_v2:process_request_list(cs_api_v2:new_tlog(), [{write, "B", 7},
{commit}]).
{[{rdht_tx_write,"B",value,7,6}],
{results,[{write,"B",{value,7}},commit]}}
The 'commit' is the confirmation for the commit. Otherwise it would have been
'abort'.
In v1 it looked the following:
> cs_api:process_request_list(cs_api:new_tlog(), [{write, "B", 7}, {commit}]).
{[{write,"B",ok,7,2}],
{results,[{write,"B",{value,7}},{commit,ok,{value,"ok"}}]}}
But the ok and {value, ok} are unncessary redundant.
v2 is still experimental until issue 56 is implemented. Then we will switch all
APIs and drop the old tx things in transstore directory.
Original comment by schin...@gmail.com
on 27 Aug 2010 at 1:07
I should have been clear, I'm talking about the JSON response. A single
"commit" poses the problem of not having a associated value. How is that going
to be represented in JSON? So, perhaps, it should be {commit, "ok"} or
something like. Also, v1 had the "reason" of the failed commit.
As for the redundant part, sure.. but at least design a interface that is
consistent. A different style for one out of the three members of the results
is just plain annoying. The less special cases, the better is the programming
model (in languages other than Erlang).
Original comment by natalija...@gmail.com
on 27 Aug 2010 at 5:18
Speaking of redundancy, why is the value (of a write) sent back?
Original comment by natalija...@gmail.com
on 27 Aug 2010 at 5:19
Also, while we wait for issue 56, would it be possible to add _v2 variations
for JSON? It would make testing easier and goes in line with having
cs_api/cs_api_v2. Shouldn't take much effort...
Original comment by natalija...@gmail.com
on 28 Aug 2010 at 11:55
Original comment by nico.kru...@googlemail.com
on 1 Sep 2010 at 3:32
We now have a more clean interface for the transactions, also available via
JSON.
We removed the redundancy and made the results more consistent.
Original comment by schin...@gmail.com
on 7 Mar 2011 at 11:54
the changes have been documented in r1607
Original comment by nico.kru...@googlemail.com
on 25 Mar 2011 at 9:03
Original issue reported on code.google.com by
natalija...@gmail.com
on 27 Aug 2010 at 11:56