cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [7/7] cassandra git commit: Merge branch 'cassandra-2.1' into trunk
Date Wed, 15 Apr 2015 15:25:20 GMT
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: f6b424ff7c7cf1777c4beca4127fe57d31a5205b
Parents: ea6004e 7b50213
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Apr 15 10:24:01 2015 -0500
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed Apr 15 10:24:01 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../io/sstable/AbstractSSTableSimpleWriter.java |   9 ++
 .../cassandra/io/sstable/CQLSSTableWriter.java  |  26 ++++-
 .../io/sstable/SSTableSimpleUnsortedWriter.java |  10 +-
 .../io/sstable/CQLSSTableWriterLongTest.java    | 106 +++++++++++++++++++
 .../io/sstable/CQLSSTableWriterTest.java        |  12 ++-
 6 files changed, 156 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f6b424ff/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f6b424ff/src/java/org/apache/cassandra/io/sstable/AbstractSSTableSimpleWriter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f6b424ff/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f6b424ff/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
index 6bfe05b,4d7f4fa..5998044
--- a/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
@@@ -119,10 -119,10 +119,10 @@@ public class SSTableSimpleUnsortedWrite
  
          // We don't want to sync in writeRow() only as this might blow up the bufferSize
for wide rows.
          if (currentSize > bufferSize)
-             sync();
+             replaceColumnFamily();
      }
  
 -    protected ColumnFamily getColumnFamily() throws IOException
 +    protected ColumnFamily getColumnFamily()
      {
          ColumnFamily previous = buffer.get(currentKey);
          // If the CF already exist in memory, we'll just continue adding to it

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f6b424ff/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
index 6278b45,a7b751e..850f46d
--- a/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
@@@ -140,21 -140,18 +140,23 @@@ public class CQLSSTableWriterTes
          // Check that the write respect the buffer size even if we only insert rows withing
the same partition (#7360)
          // To do that simply, we use a writer with a buffer of 1MB, and write 2 rows in
the same partition with a value
          // > 1MB and validate that this created more than 1 sstable.
 +        String KS = "ks";
 +        String TABLE = "test";
 +
          File tempdir = Files.createTempDir();
 +        File dataDir = new File(tempdir.getAbsolutePath() + File.separator + KS + File.separator
+ TABLE);
 +        assert dataDir.mkdirs();
          String schema = "CREATE TABLE ks.test ("
-                       + "  k int PRIMARY KEY,"
-                       + "  v blob"
+                       + "  k int,"
+                       + "  c int,"
+                       + "  v blob,"
+                       + "  PRIMARY KEY (k,c)"
                        + ")";
-         String insert = "INSERT INTO ks.test (k, v) VALUES (?, ?)";
+         String insert = "INSERT INTO ks.test (k, c, v) VALUES (?, ?, ?)";
          CQLSSTableWriter writer = CQLSSTableWriter.builder()
 -                                                  .inDirectory(tempdir)
 +                                                  .inDirectory(dataDir)
                                                    .forTable(schema)
 -                                                  .withPartitioner(StorageService.instance.getPartitioner())
 +                                                  .withPartitioner(StorageService.getPartitioner())
                                                    .using(insert)
                                                    .withBufferSizeInMB(1)
                                                    .build();


Mime
View raw message