datastax/java-driver — pull request #184 by olim7t (2014-06-20 07:23:09+00:00)
Title: Add ResultSet.wasApplied() for conditional queries (JAVA-358).

The flag is computed at construction time by peeking at the first row. For paged results, this assumes that the first page contains at least one row, which I think is always the case.

I didn't want to build a temporary `ArrayBackedRow` just to read a column, so I did it manually. This leads to some code duplication. I have mixed feelings about that, if you prefer it the other way I'll change it.

The method returns `true` whenever the `[applied]` column doesn't exist, the reasoning being that non-conditional statements are always "applied". It could also throw an exception (again I can easily change that).

Finally, as noted in the API docs, this feature is subject to CASSANDRA-7337 for conditional batches.