Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7C4C510A08 for ; Thu, 8 Aug 2013 16:34:03 +0000 (UTC) Received: (qmail 36792 invoked by uid 500); 8 Aug 2013 16:34:01 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 36583 invoked by uid 500); 8 Aug 2013 16:34:01 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 35801 invoked by uid 99); 8 Aug 2013 16:33:55 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Aug 2013 16:33:55 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D14F0835FBB; Thu, 8 Aug 2013 16:33:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jbellis@apache.org To: commits@cassandra.apache.org Date: Thu, 08 Aug 2013 16:33:57 -0000 Message-Id: In-Reply-To: <5ffb917cc2ac451da41a6979bef8c26c@git.apache.org> References: <5ffb917cc2ac451da41a6979bef8c26c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/16] git commit: r/m unnecessary null check r/m unnecessary null check Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e533d5af Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e533d5af Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e533d5af Branch: refs/heads/trunk Commit: e533d5afbc0cc1c321060dc40224422d23578b4f Parents: f022354 Author: Jonathan Ellis Authored: Thu Aug 8 11:11:38 2013 -0500 Committer: Jonathan Ellis Committed: Thu Aug 8 11:11:38 2013 -0500 ---------------------------------------------------------------------- .../db/compaction/LeveledCompactionStrategy.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e533d5af/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java index 292220d..b3e01ed 100644 --- a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java +++ b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java @@ -54,16 +54,13 @@ public class LeveledCompactionStrategy extends AbstractCompactionStrategy implem super(cfs, options); int configuredMaxSSTableSize = 160; SizeTieredCompactionStrategyOptions localOptions = new SizeTieredCompactionStrategyOptions(options); - if (options != null) + if (options.containsKey(SSTABLE_SIZE_OPTION)) { - if (options.containsKey(SSTABLE_SIZE_OPTION)) + configuredMaxSSTableSize = Integer.parseInt(options.get(SSTABLE_SIZE_OPTION)); + if (configuredMaxSSTableSize >= 1000) { - configuredMaxSSTableSize = Integer.parseInt(options.get(SSTABLE_SIZE_OPTION)); - if (configuredMaxSSTableSize >= 1000) - { - // Yes, people have done this - logger.warn("Max sstable size of {}MB is configured; having a unit of compaction this large is probably a bad idea", configuredMaxSSTableSize); - } + // Yes, people have done this + logger.warn("Max sstable size of {}MB is configured; having a unit of compaction this large is probably a bad idea", configuredMaxSSTableSize); } } maxSSTableSizeInMB = configuredMaxSSTableSize;