You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2012/03/23 16:02:57 UTC

[6/12] git commit: merge from 1.0

merge from 1.0


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/5697c399
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5697c399
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5697c399

Branch: refs/heads/cassandra-1.1
Commit: 5697c3997f8c186655d67465f4903280fd3cf5a1
Parents: 643d18a 1e18538
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Mar 23 09:58:40 2012 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Mar 23 09:58:40 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../apache/cassandra/io/sstable/SSTableReader.java |   25 +++++----
 .../org/apache/cassandra/utils/ByteBufferUtil.java |    4 +-
 .../cassandra/io/sstable/SSTableReaderTest.java    |   42 +++++++++++++++
 4 files changed, 60 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5697c399/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 6c82f09,74522ef..0c726fd
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,32 -1,5 +1,33 @@@
 -1.0.9
 +1.1-beta2
 + * rename loaded sstables to avoid conflicts with local snapshots
 +   (CASSANDRA-3967)
 + * start hint replay as soon as FD notifies that the target is back up
 +   (CASSANDRA-3958)
 + * avoid unproductive deserializing of cached rows during compaction
 +   (CASSANDRA-3921)
 + * fix concurrency issues with CQL keyspace creation (CASSANDRA-3903)
 + * Show Effective Owership via Nodetool ring <keyspace> (CASSANDRA-3412)
 + * Update ORDER BY syntax for CQL3 (CASSANDRA-3925)
 + * Fix BulkRecordWriter to not throw NPE if reducer gets no map data from Hadoop (CASSANDRA-3944)
 + * Fix bug with counters in super columns (CASSANDRA-3821)
 + * Remove deprecated merge_shard_chance (CASSANDRA-3940)
 + * add a convenient way to reset a node's schema (CASSANDRA-2963)
 + * fix for intermittent SchemaDisagreementException (CASSANDRA-3884)
 + * ignore deprecated KsDef/CfDef/ColumnDef fields in native schema (CASSANDRA-3963)
 + * CLI to report when unsupported column_metadata pair was given (CASSANDRA-3959)
 + * reincarnate removed and deprecated KsDef/CfDef attributes (CASSANDRA-3953)
 + * Fix race between writes and read for cache (CASSANDRA-3862)
 + * perform static initialization of StorageProxy on start-up (CASSANDRA-3797)
 + * support trickling fsync() on writes (CASSANDRA-3950)
 + * expose counters for unavailable/timeout exceptions given to thrift clients (CASSANDRA-3671)
 + * avoid quadratic startup time in LeveledManifest (CASSANDRA-3952)
 + * Add type information to new schema_ columnfamilies and remove thrift
 +   serialization for schema (CASSANDRA-3792)
 + * add missing column validator options to the CLI help (CASSANDRA-3926)
 + * skip reading saved key cache if CF's caching strategy is NONE or ROWS_ONLY (CASSANDRA-3954)
 + * Unify migration code (CASSANDRA-4017)
 +Merged from 1.0:
+  * improve index sampling performance (CASSANDRA-4023)
   * always compact away deleted hints immediately after handoff (CASSANDRA-3955)
   * delete hints from dropped ColumnFamilies on handoff instead of
     erroring out (CASSANDRA-3975)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5697c399/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5697c399/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5697c399/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
index caefdce,5acfd56..102fccd
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@@ -24,10 -24,8 +24,12 @@@ package org.apache.cassandra.io.sstable
  import java.io.File;
  import java.io.IOException;
  import java.nio.ByteBuffer;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.List;
 +import java.util.concurrent.ExecutionException;
+ import java.util.*;
+ import java.util.concurrent.ExecutionException;
  
  import org.junit.Test;
  
@@@ -242,7 -241,47 +244,47 @@@ public class SSTableReaderTest extends 
          assertIndexQueryWorks(store);
      }
  
+     @Test
+     public void testOpeningSSTable() throws Exception
+     {
+         String ks = "Keyspace1";
+         String cf = "Standard1";
+ 
+         // clear and create just one sstable for this test
+         Table table = Table.open(ks);
+         ColumnFamilyStore store = table.getColumnFamilyStore(cf);
+         store.clearUnsafe();
+         store.disableAutoCompaction();
+ 
+         DecoratedKey firstKey = null, lastKey = null;
+         long timestamp = System.currentTimeMillis();
+         for (int i = 0; i < DatabaseDescriptor.getIndexInterval(); i++) {
+             DecoratedKey key = Util.dk(String.valueOf(i));
+             if (firstKey == null)
+                 firstKey = key;
+             if (lastKey == null)
+                 lastKey = key;
+             if (store.metadata.getKeyValidator().compare(lastKey.key, key.key) < 0)
+                 lastKey = key;
+             RowMutation rm = new RowMutation(ks, key.key);
+             rm.add(new QueryPath(cf, null, ByteBufferUtil.bytes("col")),
+                           ByteBufferUtil.EMPTY_BYTE_BUFFER, timestamp);
+             rm.apply();
+         }
+         store.forceBlockingFlush();
+ 
+         SSTableReader sstable = store.getSSTables().iterator().next();
+         Descriptor desc = sstable.descriptor;
+ 
+         // test to see if sstable can be opened as expected
+         SSTableReader target = SSTableReader.open(desc);
 -        Collection<DecoratedKey> keySamples = target.getKeySamples();
++        Collection<DecoratedKey<?>> keySamples = target.getKeySamples();
+         assert keySamples.size() == 1 && keySamples.iterator().next().equals(firstKey);
+         assert target.first.equals(firstKey);
+         assert target.last.equals(lastKey);
+     }
+ 
 -    private void assertIndexQueryWorks(ColumnFamilyStore indexedCFS)
 +    private void assertIndexQueryWorks(ColumnFamilyStore indexedCFS) throws IOException
      {
          assert "Indexed1".equals(indexedCFS.getColumnFamilyName());