cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [6/10] git commit: merge from 1.0
Date Tue, 17 Apr 2012 21:27:42 GMT
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/251e0501
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/251e0501
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/251e0501

Branch: refs/heads/cassandra-1.1
Commit: 251e050127fd6be617995dd9a5d61db390649909
Parents: a4a83fc 10a64bd
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Tue Apr 17 16:24:22 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Tue Apr 17 16:25:53 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    4 ++++
 .../io/sstable/AbstractSSTableSimpleWriter.java    |    2 +-
 .../io/sstable/SSTableSimpleUnsortedWriter.java    |    5 ++++-
 .../cassandra/io/sstable/SSTableSimpleWriter.java  |   14 +++++++++++---
 4 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/251e0501/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index f11af3d,814fe99..720289f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,26 -1,6 +1,30 @@@
 -1.0.10
 +1.1-dev
 + * Allow KS and CF names up to 48 characters (CASSANDRA-4157)
 + * Add support for CL.TWO and CL.THREE in CQL (CASSANDRA-4156)
++Merged from 1.0:
+  * avoid streaming empty files with bulk loader if sstablewriter errors out
+    (CASSANDRA-3946)
 +
 +
 +1.1-rc1
 + * (Hadoop) fix wide row iteration when last row read was deleted
 +   (CASSANDRA-4154)
 + * fix read_repair_chance to really default to 0.1 in the cli (CASSANDRA-4114)
 + * Adds caching and bloomFilterFpChange to CQL options (CASSANDRA-4042)
 + * Adds posibility to autoconfigure size of the KeyCache (CASSANDRA-4087)
 + * fix KEYS index from skipping results (CASSANDRA-3996)
 + * Remove sliced_buffer_size_in_kb dead option (CASSANDRA-4076)
 + * make loadNewSStable preserve sstable version (CASSANDRA-4077)
 + * Respect 1.0 cache settings as much as possible when upgrading 
 +   (CASSANDRA-4088)
 + * relax path length requirement for sstable files when upgrading on 
 +   non-Windows platforms (CASSANDRA-4110)
 + * fix terminination of the stress.java when errors were encountered
 +   (CASSANDRA-4128)
 + * Move CfDef and KsDef validation out of thrift (CASSANDRA-4037)
 + * Fix get_paged_slice (CASSANDRA-4136)
 + * CQL3: Support slice with exclusive start and stop (CASSANDRA-3785)
++Merged from 1.0:
   * support PropertyFileSnitch in bulk loader (CASSANDRA-4145)
   * add auto_snapshot option allowing disabling snapshot before drop/truncate
     (CASSANDRA-3710)

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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/251e0501/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
index 9a69ba3,175512e..fd9d3e1
--- a/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableSimpleUnsortedWriter.java
@@@ -131,62 -102,26 +131,65 @@@ public class SSTableSimpleUnsortedWrite
  
      private void sync() throws IOException
      {
 -        if (keys.isEmpty())
 +        if (buffer.isEmpty())
              return;
  
 -        SSTableWriter writer = null;
 +        checkForWriterException();
 +
          try
          {
 -            writer = getWriter();
 -            for (Map.Entry<DecoratedKey, ColumnFamily> entry : keys.entrySet())
 -            {
 -                writer.append(entry.getKey(), entry.getValue());
 -            }
 -            writer.closeAndOpenReader();
 +            writeQueue.put(buffer);
          }
 -        catch (IOException e)
 +        catch (InterruptedException e)
          {
 -            if (writer != null)
 -                writer.abort();
 -            throw e;
 +            throw new RuntimeException(e);
          }
 +        buffer = new Buffer();
          currentSize = 0;
 -        keys.clear();
 +    }
 +
 +    private void checkForWriterException() throws IOException
 +    {
 +        // slightly lame way to report exception from the writer, but that should be good
enough
 +        if (diskWriter.exception != null)
 +        {
 +            if (diskWriter.exception instanceof IOException)
 +                throw (IOException) diskWriter.exception;
 +            else
 +                throw new RuntimeException(diskWriter.exception);
 +        }
 +    }
 +
 +    // typedef
 +    private static class Buffer extends TreeMap<DecoratedKey, ColumnFamily> {}
 +
 +    private class DiskWriter extends Thread
 +    {
 +        volatile Exception exception = null;
 +
 +        public void run()
 +        {
++            SSTableWriter writer = null;
 +            try
 +            {
 +                while (true)
 +                {
 +                    Buffer b = writeQueue.take();
 +                    if (b == SENTINEL)
 +                        return;
 +
-                     SSTableWriter writer = getWriter();
++                    writer = getWriter();
 +                    for (Map.Entry<DecoratedKey, ColumnFamily> entry : b.entrySet())
 +                        writer.append(entry.getKey(), entry.getValue());
 +                    writer.closeAndOpenReader();
 +                }
 +            }
 +            catch (Exception e)
 +            {
++                if (writer != null)
++                    writer.abort();
 +                exception = e;
 +            }
 +        }
      }
  }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/251e0501/src/java/org/apache/cassandra/io/sstable/SSTableSimpleWriter.java
----------------------------------------------------------------------


Mime
View raw message