cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [13/16] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2
Date Wed, 30 Sep 2015 18:48:31 GMT
Merge branch 'cassandra-2.1' into cassandra-2.2

Conflicts:
	src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
	src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
	src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java


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

Branch: refs/heads/trunk
Commit: 25de92e321604626d6c098233082904832c07814
Parents: 7452b20 c37562e
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Wed Sep 30 19:47:14 2015 +0100
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Wed Sep 30 19:47:14 2015 +0100

----------------------------------------------------------------------
 .../io/sstable/AbstractSSTableSimpleWriter.java |   2 +
 .../cassandra/io/sstable/CQLSSTableWriter.java  |  15 +
 .../io/sstable/SSTableSimpleUnsortedWriter.java |   6 +
 .../io/sstable/SSTableSimpleWriter.java         |  13 +
 .../io/sstable/format/SSTableReader.java        |  17 +
 .../cassandra/io/util/ByteBufferDataInput.java  |   8 +-
 .../cassandra/io/util/MmappedSegmentedFile.java | 275 ++++++++++++----
 .../apache/cassandra/io/util/SegmentedFile.java |   1 +
 .../sstable/LongSegmentedFileBoundaryTest.java  | 324 +++++++++++++++++++
 9 files changed, 605 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25de92e3/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
index 4181ed0,c364171..8873f88
--- a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
@@@ -370,20 -376,22 +380,25 @@@ public class CQLSSTableWriter implement
              }
          }
  
+         CFMetaData metadata()
+         {
+             return schema;
+         }
+ 
          /**
 -         * Adds the specified column family to the specified keyspace.
 +         * Creates the keyspace with the specified table.
           *
 -         * @param ksm the keyspace meta data
 -         * @param cfm the column family meta data
 +         * @param the table the table that must be created.
           */
 -        private static void addTableToKeyspace(KSMetaData ksm, CFMetaData cfm)
 +        private static void createKeyspaceWithTable(CFMetaData table)
          {
 -            ksm = KSMetaData.cloneWith(ksm, Iterables.concat(ksm.cfMetaData().values(),
Collections.singleton(cfm)));
 -            Schema.instance.load(cfm);
 -            Schema.instance.setKeyspaceDefinition(ksm);
 +            KSMetaData ksm;
 +            ksm = KSMetaData.newKeyspace(table.ksName,
 +                                         AbstractReplicationStrategy.getClass("org.apache.cassandra.locator.SimpleStrategy"),
 +                                         ImmutableMap.of("replication_factor", "1"),
 +                                         true,
 +                                         Collections.singleton(table));
 +            Schema.instance.load(ksm);
          }
  
          /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25de92e3/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
index 4bb75bc,25ec354..534e77b
--- a/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
@@@ -143,7 -140,13 +143,13 @@@ public class SSTableSimpleUnsortedWrite
          return previous;
      }
  
+     public Descriptor getCurrentDescriptor()
+     {
+         // can be implemented, but isn't necessary
+         throw new UnsupportedOperationException();
+     }
+ 
 -    protected ColumnFamily createColumnFamily() throws IOException
 +    protected ColumnFamily createColumnFamily()
      {
          return ArrayBackedSortedColumns.factory.create(metadata);
      }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25de92e3/src/java/org/apache/cassandra/io/sstable/SSTableSimpleWriter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/SSTableSimpleWriter.java
index 2601d6d,23da501..f81e57d
--- a/src/java/org/apache/cassandra/io/sstable/SSTableSimpleWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableSimpleWriter.java
@@@ -26,7 -24,6 +26,8 @@@ import org.apache.cassandra.db.*
  import org.apache.cassandra.db.marshal.AbstractType;
  import org.apache.cassandra.dht.IPartitioner;
  import org.apache.cassandra.io.FSError;
++import org.apache.cassandra.io.sstable.format.SSTableReader;
 +import org.apache.cassandra.io.sstable.format.SSTableWriter;
  
  /**
   * A SSTable writer that assumes rows are in (partitioner) sorted order.
@@@ -71,6 -65,13 +72,13 @@@ public class SSTableSimpleWriter extend
          writer = getWriter();
      }
  
+     SSTableReader closeAndOpenReader()
+     {
+         if (currentKey != null)
+             writeRow(currentKey, columnFamily);
 -        return writer.closeAndOpenReader();
++        return writer.finish(true);
+     }
+ 
      public void close()
      {
          try


Mime
View raw message