Astyanax:如果一个MutationBatch中途失败,我有什么保证? [英] Astyanax: If a MutationBatch fails halfway, what guarantees do I have?

查看:233
本文介绍了Astyanax:如果一个MutationBatch中途失败,我有什么保证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道从0.8开始,Cassandra保证行更新是原子的。



但是,如果我准备(使用MutationBatch)几个行修改或修改跨几个列族,是否保证行将更新的顺序设置它们?例如如果我有




  • 更新CF 1第1行

  • 更新CF 1第2行

  • 更新CF 2,第3行



可以更新CF 2,而CF 1




  • >更新CF 1,第1行第A列

  • 更新CF 1第2行

  • 更新CF 2第3行

  • 更新CF 1,第1行第B列



或者,我应该准备三个MutationBatches, ?

解决方案

所有更新都是并行完成的,因此不会保证任何顺序。部分成功将导致批处理接管并完成从1.2开始的批处理: http://www.datastax.com/dev/blog/atomic-batches-in-cassandra-1-2


I know that as of 0.8, Cassandra guarantees that row updates are atomic.

However, if I prepare (using MutationBatch) several row modifications or modifications across several column families, is it guaranteed that the rows will be updated in the order that in which I set them up? e.g. If I have

  • Update CF 1, Row 1
  • Update CF 1, Row 2
  • Update CF 2, Row 3

is it possible for CF 2 to be updated while CF 1 remains unchanged due to failure?

What happens if I had set up:

  • Update CF 1, Row 1, Column A
  • Update CF 1, Row 2
  • Update CF 2, Row 3
  • Update CF 1, Row 1, Column B

Alternatively, should I be preparing instead three MutationBatches and executing them separately?

解决方案

All updates are done in parallel, so no ordering is ever guaranteed. Partial success will result in the batchlog taking over and finishing the batch starting in 1.2: http://www.datastax.com/dev/blog/atomic-batches-in-cassandra-1-2

这篇关于Astyanax:如果一个MutationBatch中途失败,我有什么保证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆