cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [2/3] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Date Fri, 19 Dec 2014 18:19:27 GMT
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt
	src/java/org/apache/cassandra/db/HintedHandOffManager.java


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

Branch: refs/heads/trunk
Commit: 6f42afa2bb54bc6a2624d40accab8c6f6db2038f
Parents: 7c6993f 351e35b
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Fri Dec 19 20:38:02 2014 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Fri Dec 19 20:38:02 2014 +0300

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../DebuggableScheduledThreadPoolExecutor.java  |   5 +
 .../JMXEnabledScheduledThreadPoolExecutor.java  | 137 +++++++++++++++++++
 ...EnabledScheduledThreadPoolExecutorMBean.java |  26 ++++
 .../JMXEnabledThreadPoolExecutor.java           |   2 -
 .../cassandra/db/HintedHandOffManager.java      |  38 ++---
 .../cassandra/metrics/ThreadPoolMetrics.java    |   6 +-
 7 files changed, 186 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f42afa2/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 4d88aa9,1ad2de5..ddc25cd
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,46 -1,5 +1,47 @@@
 -2.0.12:
 +2.1.3
 + * Fix regression in SSTableRewriter causing some rows to become unreadable 
 +   during compaction (CASSANDRA-8429)
 + * Run major compactions for repaired/unrepaired in parallel (CASSANDRA-8510)
 + * (cqlsh) Fix compression options in DESCRIBE TABLE output when compression
 +   is disabled (CASSANDRA-8288)
 + * (cqlsh) Fix DESCRIBE output after keyspaces are altered (CASSANDRA-7623)
 + * Make sure we set lastCompactedKey correctly (CASSANDRA-8463)
 + * (cqlsh) Fix output of CONSISTENCY command (CASSANDRA-8507)
 + * (cqlsh) Fixed the handling of LIST statements (CASSANDRA-8370)
 + * Make sstablescrub check leveled manifest again (CASSANDRA-8432)
 + * Check first/last keys in sstable when giving out positions (CASSANDRA-8458)
 + * Disable mmap on Windows (CASSANDRA-6993)
 + * Add missing ConsistencyLevels to cassandra-stress (CASSANDRA-8253)
 + * Add auth support to cassandra-stress (CASSANDRA-7985)
 + * Fix ArrayIndexOutOfBoundsException when generating error message
 +   for some CQL syntax errors (CASSANDRA-8455)
 + * Scale memtable slab allocation logarithmically (CASSANDRA-7882)
 + * cassandra-stress simultaneous inserts over same seed (CASSANDRA-7964)
 + * Reduce cassandra-stress sampling memory requirements (CASSANDRA-7926)
 + * Ensure memtable flush cannot expire commit log entries from its future (CASSANDRA-8383)
 + * Make read "defrag" async to reclaim memtables (CASSANDRA-8459)
 + * Remove tmplink files for offline compactions (CASSANDRA-8321)
 + * Reduce maxHintsInProgress (CASSANDRA-8415)
 + * BTree updates may call provided update function twice (CASSANDRA-8018)
 + * Release sstable references after anticompaction (CASSANDRA-8386)
 + * Handle abort() in SSTableRewriter properly (CASSANDRA-8320)
 + * Fix high size calculations for prepared statements (CASSANDRA-8231)
 + * Centralize shared executors (CASSANDRA-8055)
 + * Fix filtering for CONTAINS (KEY) relations on frozen collection
 +   clustering columns when the query is restricted to a single
 +   partition (CASSANDRA-8203)
 + * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
 + * Add more log info if readMeter is null (CASSANDRA-8238)
 + * add check of the system wall clock time at startup (CASSANDRA-8305)
 + * Support for frozen collections (CASSANDRA-7859)
 + * Fix overflow on histogram computation (CASSANDRA-8028)
 + * Have paxos reuse the timestamp generation of normal queries (CASSANDRA-7801)
 + * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
 + * Improve JBOD disk utilization (CASSANDRA-7386)
 + * Log failed host when preparing incremental repair (CASSANDRA-8228)
 + * Force config client mode in CQLSSTableWriter (CASSANDRA-8281)
 +Merged from 2.0:
+  * Move all hints related tasks to hints internal executor (CASSANDRA-8285)
   * Fix paging for multi-partition IN queries (CASSANDRA-8408)
   * Fix MOVED_NODE topology event never being emitted when a node
     moves its token (CASSANDRA-8373)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f42afa2/src/java/org/apache/cassandra/concurrent/DebuggableScheduledThreadPoolExecutor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f42afa2/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
index 5c96bb6,de448b5..3f60df1
--- a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
+++ b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
@@@ -74,7 -73,7 +73,6 @@@ public class JMXEnabledThreadPoolExecut
      {
          super(corePoolSize, maxPoolSize, keepAliveTime, unit, workQueue, threadFactory);
          super.prestartAllCoreThreads();
-         this.maxPoolSize = maxPoolSize;
 -
          metrics = new ThreadPoolMetrics(this, jmxPath, threadFactory.id);
  
          MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f42afa2/src/java/org/apache/cassandra/db/HintedHandOffManager.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/HintedHandOffManager.java
index 869e38e,c8c3845..9821574
--- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java
+++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
@@@ -37,20 -37,13 +37,16 @@@ import com.google.common.util.concurren
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
- import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor;
+ import org.apache.cassandra.concurrent.JMXEnabledScheduledThreadPoolExecutor;
  import org.apache.cassandra.concurrent.NamedThreadFactory;
- import org.apache.cassandra.concurrent.ScheduledExecutors;
 +import org.apache.cassandra.config.CFMetaData;
  import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.config.Schema;
- import org.apache.cassandra.db.composites.CellName;
- import org.apache.cassandra.db.composites.Composite;
- import org.apache.cassandra.db.composites.Composites;
  import org.apache.cassandra.db.compaction.CompactionManager;
++import org.apache.cassandra.db.composites.*;
  import org.apache.cassandra.db.filter.*;
 -import org.apache.cassandra.db.marshal.*;
 +import org.apache.cassandra.db.marshal.Int32Type;
 +import org.apache.cassandra.db.marshal.UUIDType;
  import org.apache.cassandra.dht.IPartitioner;
  import org.apache.cassandra.dht.Range;
  import org.apache.cassandra.dht.Token;
@@@ -64,10 -57,9 +60,7 @@@ import org.apache.cassandra.metrics.Hin
  import org.apache.cassandra.net.MessageOut;
  import org.apache.cassandra.net.MessagingService;
  import org.apache.cassandra.service.*;
--import org.apache.cassandra.utils.ByteBufferUtil;
--import org.apache.cassandra.utils.FBUtilities;
- import org.apache.cassandra.utils.JVMStabilityInspector;
--import org.apache.cassandra.utils.UUIDGen;
++import org.apache.cassandra.utils.*;
  import org.cliffc.high_scale_lib.NonBlockingHashSet;
  
  /**
@@@ -105,16 -97,16 +98,15 @@@ public class HintedHandOffManager imple
  
      private volatile boolean hintedHandOffPaused = false;
  
 -    static final CompositeType comparator = CompositeType.getInstance(Arrays.<AbstractType<?>>asList(UUIDType.instance,
Int32Type.instance));
      static final int maxHintTTL = Integer.parseInt(System.getProperty("cassandra.maxHintTTL",
String.valueOf(Integer.MAX_VALUE)));
  
--    private final NonBlockingHashSet<InetAddress> queuedDeliveries = new NonBlockingHashSet<InetAddress>();
++    private final NonBlockingHashSet<InetAddress> queuedDeliveries = new NonBlockingHashSet<>();
  
-     private final ThreadPoolExecutor executor = new JMXEnabledThreadPoolExecutor(DatabaseDescriptor.getMaxHintsThread(),
-                                                                                  Integer.MAX_VALUE,
-                                                                                  TimeUnit.SECONDS,
-                                                                                  new LinkedBlockingQueue<Runnable>(),
-                                                                                  new NamedThreadFactory("HintedHandoff",
Thread.MIN_PRIORITY),
-                                                                                  "internal");
+     private final JMXEnabledScheduledThreadPoolExecutor executor =
+         new JMXEnabledScheduledThreadPoolExecutor(
+             DatabaseDescriptor.getMaxHintsThread(),
+             new NamedThreadFactory("HintedHandoff", Thread.MIN_PRIORITY),
+             "internal");
  
      private final ColumnFamilyStore hintStore = Keyspace.open(Keyspace.SYSTEM_KS).getColumnFamilyStore(SystemKeyspace.HINTS_CF);
  
@@@ -177,14 -169,14 +169,14 @@@
                  metrics.log();
              }
          };
-         ScheduledExecutors.optionalTasks.scheduleWithFixedDelay(runnable, 10, 10, TimeUnit.MINUTES);
+         executor.scheduleWithFixedDelay(runnable, 10, 10, TimeUnit.MINUTES);
      }
  
 -    private static void deleteHint(ByteBuffer tokenBytes, ByteBuffer columnName, long timestamp)
 +    private static void deleteHint(ByteBuffer tokenBytes, CellName columnName, long timestamp)
      {
 -        RowMutation rm = new RowMutation(Keyspace.SYSTEM_KS, tokenBytes);
 -        rm.delete(SystemKeyspace.HINTS_CF, columnName, timestamp);
 -        rm.applyUnsafe(); // don't bother with commitlog since we're going to flush as soon
as we're done with delivery
 +        Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, tokenBytes);
 +        mutation.delete(SystemKeyspace.HINTS_CF, columnName, timestamp);
 +        mutation.applyUnsafe(); // don't bother with commitlog since we're going to flush
as soon as we're done with delivery
      }
  
      public void deleteHintsForEndpoint(final String ipOrHostname)
@@@ -514,8 -506,8 +506,8 @@@
  
          IPartitioner p = StorageService.getPartitioner();
          RowPosition minPos = p.getMinimumToken().minKeyBound();
--        Range<RowPosition> range = new Range<RowPosition>(minPos, minPos, p);
 -        IDiskAtomFilter filter = new NamesQueryFilter(ImmutableSortedSet.<ByteBuffer>of());
++        Range<RowPosition> range = new Range<>(minPos, minPos, p);
 +        IDiskAtomFilter filter = new NamesQueryFilter(ImmutableSortedSet.<CellName>of());
          List<Row> rows = hintStore.getRangeSlice(range, null, filter, Integer.MAX_VALUE,
System.currentTimeMillis());
          for (Row row : rows)
          {
@@@ -578,7 -570,7 +570,7 @@@
          Token.TokenFactory tokenFactory = StorageService.getPartitioner().getTokenFactory();
  
          // Extract the keys as strings to be reported.
--        LinkedList<String> result = new LinkedList<String>();
++        LinkedList<String> result = new LinkedList<>();
          for (Row row : getHintsSlice(1))
          {
              if (row.cf != null) //ignore removed rows
@@@ -595,9 -588,9 +587,9 @@@
                                                            columnCount);
  
          // From keys "" to ""...
 -        IPartitioner<?> partitioner = StorageService.getPartitioner();
 +        IPartitioner partitioner = StorageService.getPartitioner();
          RowPosition minPos = partitioner.getMinimumToken().minKeyBound();
--        Range<RowPosition> range = new Range<RowPosition>(minPos, minPos);
++        Range<RowPosition> range = new Range<>(minPos, minPos);
  
          try
          {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f42afa2/src/java/org/apache/cassandra/metrics/ThreadPoolMetrics.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/metrics/ThreadPoolMetrics.java
index 8600e0c,af54cdb..a5e6daf
--- a/src/java/org/apache/cassandra/metrics/ThreadPoolMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/ThreadPoolMetrics.java
@@@ -54,9 -50,9 +52,9 @@@ public class ThreadPoolMetric
       * @param path Type of thread pool
       * @param poolName Name of thread pool to identify metrics
       */
-     public ThreadPoolMetrics(final JMXEnabledThreadPoolExecutor executor, String path, String
poolName)
+     public ThreadPoolMetrics(final ThreadPoolExecutor executor, String path, String poolName)
      {
 -        this.factory = new ThreadPoolMetricNameFactory(path, poolName);
 +        this.factory = new ThreadPoolMetricNameFactory("ThreadPools", path, poolName);
  
          activeTasks = Metrics.newGauge(factory.createMetricName("ActiveTasks"), new Gauge<Integer>()
          {
@@@ -81,13 -77,6 +79,13 @@@
                  return executor.getTaskCount() - executor.getCompletedTaskCount();
              }
          });
 +        maxPoolSize =  Metrics.newGauge(factory.createMetricName("MaxPoolSize"), new Gauge<Integer>()
 +        {
 +            public Integer value()
 +            {
-                 return executor.maxPoolSize;
++                return executor.getMaximumPoolSize();
 +            }
 +        });
      }
  
      public void release()


Mime
View raw message