You can clone with
HTTPS or Subversion.
While working on an implementation of an indexing scheme atop Astyanax, I came across the following behavior which seems inconsistent. My code starts by deleting a row and then re-populating it with values:
batch.withRow(CF, "key").putEmptyColumn("test", null);
However, this resulted in an empty row, because the same timestamp was used in both mutations. Changing the code a bit fixed that problem:
batch.withRow(CF, "key").delete().putEmptyColumn("test", null);
This is because delete() advances the internal timestamp value. The original example didn't work because withRow() creates a new ThriftColumnFamilyMutationImpl object. This seems error prone and inconsistent as I don't see a reason the behavior should be different between those 2 code segments. Note that the first example, while a bit convoluted, can more naturally happen when the deletion and creation of new values happens in different methods, which also makes using a single withRow() call much harder.
In short, I suggest withRow() returns the same object whenever it is called for the same (CF, key) pair.
A related issue is deleting and updating the same column at the same batch. Again the result is that the column is not created. In this case I think the end result should depend on the order of actions, as follows:
batch.withRow(CF, "key").deleteColumn("test").putEmptyColumn("test", null); // Expected: have an empty column "test"
batch.withRow(CF, "key").putEmptyColumn("test", null).deleteColumn("test"); // Expected: column test is deleted
This would make deleteColumn() and putColumn() behave like remove() and put() from Map.
Will be fixed in 1.56.18
Fix for Netflix/astyanax#103