Updated Branches: refs/heads/cassandra-1.0 6be70090f -> 67e88da62 refs/heads/cassandra-1.1 1b79d8155 -> 5882ad390 refs/heads/cassandra-1.1.0 2462c6a2a -> b3b6e4a45 refs/heads/trunk 47112b1e5 -> 30a1e07c9
merge from 1.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/30a1e07c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/30a1e07c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/30a1e07c Branch: refs/heads/trunk Commit: 30a1e07c99154b4645a26117c877441f27a0a67d Parents: 47112b1 5882ad3 Author: Jonathan Ellis <jbel...@apache.org> Authored: Mon Apr 2 16:39:51 2012 -0500 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Mon Apr 2 16:39:51 2012 -0500 ---------------------------------------------------------------------- interface/cassandra.thrift | 9 ++++++++ .../apache/cassandra/io/sstable/SSTableReader.java | 1 + .../apache/cassandra/io/sstable/SSTableWriter.java | 17 +++++--------- .../cassandra/utils/IntervalTree/IntervalNode.java | 6 +++++ 4 files changed, 22 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/30a1e07c/src/java/org/apache/cassandra/io/sstable/SSTableReader.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/30a1e07c/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/io/sstable/SSTableWriter.java index fe94116,b1fcc79..8f06f69 --- a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java +++ b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java @@@ -121,19 -123,14 +121,14 @@@ public class SSTableWriter extends SSTa } } + /** + * Perform sanity checks on @param decoratedKey and @return the position in the data file before any data is written + */ - private long beforeAppend(DecoratedKey<?> decoratedKey) throws IOException + private long beforeAppend(DecoratedKey decoratedKey) throws IOException { - if (decoratedKey == null) - { - throw new IOException("Keys must not be null."); - } - if (lastWrittenKey != null && lastWrittenKey.compareTo(decoratedKey) > 0) - { - logger.info("Last written key : " + lastWrittenKey); - logger.info("Current key : " + decoratedKey); - logger.info("Writing into file " + getFilename()); - throw new IOException("Keys must be written in ascending order."); - } + assert decoratedKey != null : "Keys must not be null"; + assert lastWrittenKey == null || lastWrittenKey.compareTo(decoratedKey) < 0 + : "Last written key " + lastWrittenKey + " >= current key " + decoratedKey + " writing into " + getFilename(); return (lastWrittenKey == null) ? 0 : dataFile.getFilePointer(); } http://git-wip-us.apache.org/repos/asf/cassandra/blob/30a1e07c/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java ----------------------------------------------------------------------