cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [4/6] git commit: merge from 1.2
Date Wed, 02 Oct 2013 15:39:06 GMT
merge from 1.2


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

Branch: refs/heads/trunk
Commit: 02d5ef3e765a34c738bc26796f2761e8cc7b715a
Parents: 88944ff 64890d8
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Oct 2 10:38:08 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Oct 2 10:38:39 2013 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../org/apache/cassandra/config/KSMetaData.java |  2 +-
 .../apache/cassandra/tracing/TraceState.java    | 16 +++++---
 .../org/apache/cassandra/tracing/Tracing.java   | 40 ++++++++++++++++----
 4 files changed, 45 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/02d5ef3e/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index a1acc94,5267709..f012ed1
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,21 -1,5 +1,22 @@@
 -1.2.11
 +2.0.2
 + * Add configurable metrics reporting (CASSANDRA-4430)
 + * drop queries exceeding a configurable number of tombstones (CASSANDRA-6117)
 + * Track and persist sstable read activity (CASSANDRA-5515)
 + * Fixes for speculative retry (CASSANDRA-5932)
 + * Improve memory usage of metadata min/max column names (CASSANDRA-6077)
 + * Fix thrift validation refusing row markers on CQL3 tables (CASSANDRA-6081)
 + * Fix insertion of collections with CAS (CASSANDRA-6069)
 + * Correctly send metadata on SELECT COUNT (CASSANDRA-6080)
 + * Track clients' remote addresses in ClientState (CASSANDRA-6070)
 + * Create snapshot dir if it does not exist when migrating
 +   leveled manifest (CASSANDRA-6093)
 + * make sequential nodetool repair the default (CASSANDRA-5950)
 + * Add more hooks for compaction strategy implementations (CASSANDRA-6111)
 + * Fix potential NPE on composite 2ndary indexes (CASSANDRA-6098)
 + * Delete can potentially be skipped in batch (CASSANDRA-6115)
 + * Allow alter keyspace on system_traces (CASSANDRA-6016)
 +Merged from 1.2:
+  * Tracing should log write failure rather than raw exceptions (CASSANDRA-6133)
   * lock access to TM.endpointToHostIdMap (CASSANDRA-6103)
   * Allow estimated memtable size to exceed slab allocator size (CASSANDRA-6078)
   * Start MeteredFlusher earlier to prevent OOM during CL replay (CASSANDRA-6087)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02d5ef3e/src/java/org/apache/cassandra/config/KSMetaData.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02d5ef3e/src/java/org/apache/cassandra/tracing/TraceState.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tracing/TraceState.java
index 82bda2d,326b351..b7d67a4
--- a/src/java/org/apache/cassandra/tracing/TraceState.java
+++ b/src/java/org/apache/cassandra/tracing/TraceState.java
@@@ -29,9 -28,12 +28,15 @@@ import org.slf4j.helpers.MessageFormatt
  import org.apache.cassandra.concurrent.Stage;
  import org.apache.cassandra.concurrent.StageManager;
  import org.apache.cassandra.config.CFMetaData;
- import org.apache.cassandra.db.*;
++import org.apache.cassandra.db.ArrayBackedSortedColumns;
+ import org.apache.cassandra.db.ColumnFamily;
++import org.apache.cassandra.db.ConsistencyLevel;
+ import org.apache.cassandra.db.RowMutation;
 +import org.apache.cassandra.service.StorageProxy;
- import org.apache.cassandra.utils.*;
+ import org.apache.cassandra.utils.ByteBufferUtil;
+ import org.apache.cassandra.utils.FBUtilities;
+ import org.apache.cassandra.utils.UUIDGen;
+ import org.apache.cassandra.utils.WrappedRunnable;
  
  /**
   * ThreadLocal state for a tracing session. The presence of an instance of this class as
a ThreadLocal denotes that an
@@@ -89,12 -91,12 +94,12 @@@ public class TraceStat
  
          StageManager.getStage(Stage.TRACING).execute(new WrappedRunnable()
          {
-             public void runMayThrow() throws Exception
+             public void runMayThrow()
              {
                  CFMetaData cfMeta = CFMetaData.TraceEventsCf;
 -                ColumnFamily cf = ColumnFamily.create(cfMeta);
 +                ColumnFamily cf = ArrayBackedSortedColumns.factory.create(cfMeta);
 +                Tracing.addColumn(cf, Tracing.buildName(cfMeta, eventId, ByteBufferUtil.bytes("activity")),
message);
                  Tracing.addColumn(cf, Tracing.buildName(cfMeta, eventId, ByteBufferUtil.bytes("source")),
FBUtilities.getBroadcastAddress());
 -                Tracing.addColumn(cf, Tracing.buildName(cfMeta, eventId, ByteBufferUtil.bytes("thread")),
threadName);
                  if (elapsed >= 0)
                      Tracing.addColumn(cf, Tracing.buildName(cfMeta, eventId, ByteBufferUtil.bytes("source_elapsed")),
elapsed);
                  Tracing.addColumn(cf, Tracing.buildName(cfMeta, eventId, ByteBufferUtil.bytes("thread")),
threadName);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02d5ef3e/src/java/org/apache/cassandra/tracing/Tracing.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tracing/Tracing.java
index f355c19,a232293..aef3816
--- a/src/java/org/apache/cassandra/tracing/Tracing.java
+++ b/src/java/org/apache/cassandra/tracing/Tracing.java
@@@ -34,8 -33,14 +34,11 @@@ import org.apache.cassandra.concurrent.
  import org.apache.cassandra.concurrent.StageManager;
  import org.apache.cassandra.config.CFMetaData;
  import org.apache.cassandra.cql3.ColumnNameBuilder;
 -import org.apache.cassandra.db.ColumnFamily;
 -import org.apache.cassandra.db.ConsistencyLevel;
 -import org.apache.cassandra.db.ExpiringColumn;
 -import org.apache.cassandra.db.RowMutation;
 +import org.apache.cassandra.db.*;
  import org.apache.cassandra.db.marshal.TimeUUIDType;
+ import org.apache.cassandra.exceptions.OverloadedException;
+ import org.apache.cassandra.exceptions.UnavailableException;
+ import org.apache.cassandra.exceptions.WriteTimeoutException;
  import org.apache.cassandra.net.MessageIn;
  import org.apache.cassandra.net.MessagingService;
  import org.apache.cassandra.service.StorageProxy;
@@@ -161,15 -173,14 +163,23 @@@ public class Tracin
              final int elapsed = state.elapsed();
              final ByteBuffer sessionIdBytes = state.sessionIdBytes;
  
-             StageManager.getStage(Stage.TRACING).execute(new WrappedRunnable()
+             StageManager.getStage(Stage.TRACING).execute(new Runnable()
              {
-                 public void runMayThrow() throws Exception
+                 public void run()
                  {
                      CFMetaData cfMeta = CFMetaData.TraceSessionsCf;
 -                    ColumnFamily cf = ColumnFamily.create(cfMeta);
 +                    ColumnFamily cf = ArrayBackedSortedColumns.factory.create(cfMeta);
                      addColumn(cf, buildName(cfMeta, bytes("duration")), elapsed);
++<<<<<<< HEAD
 +                    RowMutation mutation = new RowMutation(TRACE_KS, sessionIdBytes, cf);
 +                    StorageProxy.mutate(Arrays.asList(mutation), ConsistencyLevel.ANY);
++||||||| merged common ancestors
++                    RowMutation mutation = new RowMutation(TRACE_KS, sessionIdBytes);
++                    mutation.add(cf);
++                    StorageProxy.mutate(Arrays.asList(mutation), ConsistencyLevel.ANY);
++=======
+                     mutateWithCatch(new RowMutation(TRACE_KS, sessionIdBytes, cf));
++>>>>>>> cassandra-1.2
                  }
              });
  
@@@ -200,18 -211,16 +210,17 @@@
          final long started_at = System.currentTimeMillis();
          final ByteBuffer sessionIdBytes = state.get().sessionIdBytes;
  
-         StageManager.getStage(Stage.TRACING).execute(new WrappedRunnable()
+         StageManager.getStage(Stage.TRACING).execute(new Runnable()
          {
-             public void runMayThrow() throws Exception
+             public void run()
              {
                  CFMetaData cfMeta = CFMetaData.TraceSessionsCf;
 -                ColumnFamily cf = ColumnFamily.create(cfMeta);
 +                ColumnFamily cf = TreeMapBackedSortedColumns.factory.create(cfMeta);
                  addColumn(cf, buildName(cfMeta, bytes("coordinator")), FBUtilities.getBroadcastAddress());
 +                addParameterColumns(cf, parameters);
                  addColumn(cf, buildName(cfMeta, bytes("request")), request);
                  addColumn(cf, buildName(cfMeta, bytes("started_at")), started_at);
-                 RowMutation mutation = new RowMutation(TRACE_KS, sessionIdBytes, cf);
-                 StorageProxy.mutate(Arrays.asList(mutation), ConsistencyLevel.ANY);
+                 mutateWithCatch(new RowMutation(TRACE_KS, sessionIdBytes, cf));
              }
          });
      }
@@@ -282,4 -303,26 +291,21 @@@
  
          state.trace(format, args);
      }
+ 
+     static void mutateWithCatch(RowMutation mutation)
+     {
+         try
+         {
+             StorageProxy.mutate(Arrays.asList(mutation), ConsistencyLevel.ANY);
+         }
 -        catch (UnavailableException e)
 -        {
 -            // should never happen; ANY does not throw UAE
 -            throw new AssertionError(e);
 -        }
 -        catch (WriteTimeoutException e)
++        catch (UnavailableException | WriteTimeoutException e)
+         {
 -            // should never happen; ANY does not throw WTE
++            // should never happen; ANY does not throw UAE or WTE
+             throw new AssertionError(e);
+         }
+         catch (OverloadedException e)
+         {
+             logger.warn("Too many nodes are overloaded to save trace events");
+         }
+     }
  }


Mime
View raw message