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/cassandra-2.0 Commit: e533d5afbc0cc1c321060dc40224422d23578b4f Parents: f022354 Author: Jonathan Ellis <[email protected]> Authored: Thu Aug 8 11:11:38 2013 -0500 Committer: Jonathan Ellis <[email protected]> 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;
