Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt
This commit is contained in:
Sylvain Lebresne 2014-05-07 10:50:54 +02:00
commit 0ca4942403
2 changed files with 10 additions and 5 deletions

View File

@ -81,10 +81,6 @@ Merged from 2.0:
* Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939)
* Log a warning for large batches (CASSANDRA-6487)
* Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
* Continue assassinating even if the endpoint vanishes (CASSANDRA-6787)
* Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980)
* Shutdown batchlog executor in SS#drain() (CASSANDRA-7025)
* Schedule schema pulls on change (CASSANDRA-6971)
* Avoid early loading of non-system keyspaces before compaction-leftovers
cleanup at startup (CASSANDRA-6913)
* Restrict Windows to parallel repairs (CASSANDRA-6907)

View File

@ -104,9 +104,18 @@ public class BatchStatement implements CQLStatement, MeasurableForPreparedCache
if (attrs.isTimeToLiveSet())
throw new InvalidRequestException("Global TTL on the BATCH statement is not supported.");
boolean timestampSet = attrs.isTimestampSet();
if (timestampSet)
{
if (hasConditions)
throw new InvalidRequestException("Cannot provide custom timestamp for conditional BATCH");
if (type == Type.COUNTER)
throw new InvalidRequestException("Cannot provide custom timestamp for counter BATCH");
}
for (ModificationStatement statement : statements)
{
if (attrs.isTimestampSet() && statement.isTimestampSet())
if (timestampSet && statement.isTimestampSet())
throw new InvalidRequestException("Timestamp must be set either on BATCH or individual statements");
}
}