cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject cassandra git commit: ninja-fix merge of CASSANDRA-6809
Date Wed, 25 Mar 2015 10:35:45 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 966ff2159 -> 8a03181dd


ninja-fix merge of CASSANDRA-6809


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

Branch: refs/heads/trunk
Commit: 8a03181dd58c02f4297f4918c7fdc80da5f63fb3
Parents: 966ff21
Author: blambov <branimir.lambov@datastax.com>
Authored: Wed Mar 25 10:35:05 2015 +0000
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Wed Mar 25 10:35:05 2015 +0000

----------------------------------------------------------------------
 .../org/apache/cassandra/config/Config.java     |  6 +-
 .../cassandra/config/DatabaseDescriptor.java    |  4 +-
 .../cassandra/config/ParameterizedClass.java    | 60 ++++++++++++++++++++
 .../cassandra/config/ParametrizedClass.java     | 60 --------------------
 .../config/YamlConfigurationLoader.java         |  2 +-
 .../cassandra/db/commitlog/CommitLog.java       |  4 +-
 .../db/commitlog/CommitLogDescriptor.java       | 14 ++---
 .../io/compress/CompressionParameters.java      |  4 +-
 .../db/commitlog/CommitLogStressTest.java       | 10 ++--
 .../org/apache/cassandra/db/CommitLogTest.java  |  8 +--
 10 files changed, 87 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 25a9b31..1e69b26 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -64,7 +64,7 @@ public class Config
     public Set<String> hinted_handoff_enabled_by_dc = Sets.newConcurrentHashSet();
     public volatile Integer max_hint_window_in_ms = 3600 * 1000; // one hour
 
-    public ParametrizedClass seed_provider;
+    public ParameterizedClass seed_provider;
     public DiskAccessMode disk_access_mode = DiskAccessMode.auto;
 
     public DiskFailurePolicy disk_failure_policy = DiskFailurePolicy.ignore;
@@ -167,7 +167,9 @@ public class Config
     public Double commitlog_sync_batch_window_in_ms;
     public Integer commitlog_sync_period_in_ms;
     public int commitlog_segment_size_in_mb = 32;
-
+    public ParameterizedClass commitlog_compression;
+    public int commitlog_max_compression_buffers_in_pool = 3;
+ 
     @Deprecated
     public int commitlog_periodic_queue_size = -1;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index c36c9e9..781dcfa 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -1077,12 +1077,12 @@ public class DatabaseDescriptor
         return conf.commitlog_directory;
     }
 
-    public static ParametrizedClass getCommitLogCompression()
+    public static ParameterizedClass getCommitLogCompression()
     {
         return conf.commitlog_compression;
     }
 
-    public static void setCommitLogCompression(ParametrizedClass compressor)
+    public static void setCommitLogCompression(ParameterizedClass compressor)
     {
         conf.commitlog_compression = compressor;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/src/java/org/apache/cassandra/config/ParameterizedClass.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/ParameterizedClass.java b/src/java/org/apache/cassandra/config/ParameterizedClass.java
new file mode 100644
index 0000000..6b7af63
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/ParameterizedClass.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.config;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.base.Objects;
+
+public class ParameterizedClass
+{
+    public String class_name;
+    public Map<String, String> parameters;
+
+    public ParameterizedClass(String class_name, Map<String, String> parameters)
+    {
+        this.class_name = class_name;
+        this.parameters = parameters;
+    }
+
+    @SuppressWarnings("unchecked")
+    public ParameterizedClass(LinkedHashMap<String, ?> p)
+    {
+        this((String)p.get("class_name"),
+                p.containsKey("parameters") ? (Map<String, String>)((List<?>)p.get("parameters")).get(0)
: null);
+    }
+
+    @Override
+    public boolean equals(Object that)
+    {
+        return that instanceof ParameterizedClass && equals((ParameterizedClass)
that);
+    }
+
+    public boolean equals(ParameterizedClass that)
+    {
+        return Objects.equal(class_name, that.class_name) && Objects.equal(parameters,
that.parameters);
+    }
+
+    @Override
+    public String toString()
+    {
+        return class_name + (parameters == null ? "" : parameters.toString());
+    }
+}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/src/java/org/apache/cassandra/config/ParametrizedClass.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/ParametrizedClass.java b/src/java/org/apache/cassandra/config/ParametrizedClass.java
deleted file mode 100644
index 783b3b0..0000000
--- a/src/java/org/apache/cassandra/config/ParametrizedClass.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.config;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.google.common.base.Objects;
-
-public class ParametrizedClass
-{
-    public String class_name;
-    public Map<String, String> parameters;
-
-    public ParametrizedClass(String class_name, Map<String, String> parameters)
-    {
-        this.class_name = class_name;
-        this.parameters = parameters;
-    }
-
-    @SuppressWarnings("unchecked")
-    public ParametrizedClass(LinkedHashMap<String, ?> p)
-    {
-        this((String)p.get("class_name"),
-                p.containsKey("parameters") ? (Map<String, String>)((List<?>)p.get("parameters")).get(0)
: null);
-    }
-
-    @Override
-    public boolean equals(Object that)
-    {
-        return that instanceof ParametrizedClass && equals((ParametrizedClass) that);
-    }
-
-    public boolean equals(ParametrizedClass that)
-    {
-        return Objects.equal(class_name, that.class_name) && Objects.equal(parameters,
that.parameters);
-    }
-
-    @Override
-    public String toString()
-    {
-        return class_name + (parameters == null ? "" : parameters.toString());
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
index 28511fe..8331f85 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -104,7 +104,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
             logConfig(configBytes);
 
             org.yaml.snakeyaml.constructor.Constructor constructor = new org.yaml.snakeyaml.constructor.Constructor(Config.class);
-            TypeDescription seedDesc = new TypeDescription(ParametrizedClass.class);
+            TypeDescription seedDesc = new TypeDescription(ParameterizedClass.class);
             seedDesc.putMapPropertyType("parameters", String.class, String.class);
             constructor.addTypeDescription(seedDesc);
             MissingPropertiesChecker propertiesChecker = new MissingPropertiesChecker();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
index 51b3e53..664e38e 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
@@ -35,7 +35,7 @@ import org.apache.commons.lang3.StringUtils;
 import com.github.tjake.ICRC32;
 import org.apache.cassandra.config.Config;
 import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.ParametrizedClass;
+import org.apache.cassandra.config.ParameterizedClass;
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.io.FSWriteError;
 import org.apache.cassandra.io.compress.CompressionParameters;
@@ -69,7 +69,7 @@ public class CommitLog implements CommitLogMBean
     final AbstractCommitLogService executor;
 
     final ICompressor compressor;
-    public ParametrizedClass compressorClass;
+    public ParameterizedClass compressorClass;
     final public String location;
 
     static private CommitLog construct()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
index 6e8c78c..c872677 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
@@ -37,7 +37,7 @@ import com.google.common.base.Objects;
 import com.github.tjake.ICRC32;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.ParametrizedClass;
+import org.apache.cassandra.config.ParameterizedClass;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.io.FSReadError;
 import org.apache.cassandra.net.MessagingService;
@@ -67,16 +67,16 @@ public class CommitLogDescriptor
 
     final int version;
     public final long id;
-    public final ParametrizedClass compression;
+    public final ParameterizedClass compression;
 
-    public CommitLogDescriptor(int version, long id, ParametrizedClass compression)
+    public CommitLogDescriptor(int version, long id, ParameterizedClass compression)
     {
         this.version = version;
         this.id = id;
         this.compression = compression;
     }
 
-    public CommitLogDescriptor(long id, ParametrizedClass compression)
+    public CommitLogDescriptor(long id, ParameterizedClass compression)
     {
         this(current_version, id, compression);
     }
@@ -107,7 +107,7 @@ public class CommitLogDescriptor
     private static String constructParametersString(CommitLogDescriptor descriptor)
     {
         Map<String, Object> params = new TreeMap<String, Object>();
-        ParametrizedClass compression = descriptor.compression;
+        ParameterizedClass compression = descriptor.compression;
         if (compression != null)
         {
             params.put(COMPRESSION_PARAMETERS_KEY, compression.parameters);
@@ -159,7 +159,7 @@ public class CommitLogDescriptor
     }
 
     @SuppressWarnings("unchecked")
-    private static ParametrizedClass parseCompression(Map<?, ?> params)
+    private static ParameterizedClass parseCompression(Map<?, ?> params)
     {
         if (params == null)
             return null;
@@ -168,7 +168,7 @@ public class CommitLogDescriptor
             return null;
 
         Map<String, String> cparams = (Map<String, String>) params.get(COMPRESSION_PARAMETERS_KEY);
-        return new ParametrizedClass(className, cparams);
+        return new ParameterizedClass(className, cparams);
     }
 
     public static CommitLogDescriptor fromFileName(String name)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/src/java/org/apache/cassandra/io/compress/CompressionParameters.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/compress/CompressionParameters.java b/src/java/org/apache/cassandra/io/compress/CompressionParameters.java
index d5db130..a65fb46 100644
--- a/src/java/org/apache/cassandra/io/compress/CompressionParameters.java
+++ b/src/java/org/apache/cassandra/io/compress/CompressionParameters.java
@@ -33,7 +33,7 @@ import com.google.common.collect.Sets;
 import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.cassandra.config.CFMetaData;
-import org.apache.cassandra.config.ParametrizedClass;
+import org.apache.cassandra.config.ParameterizedClass;
 import org.apache.cassandra.db.TypeSizes;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.io.IVersionedSerializer;
@@ -207,7 +207,7 @@ public class CompressionParameters
         }
     }
 
-    public static ICompressor createCompressor(ParametrizedClass compression) throws ConfigurationException
{
+    public static ICompressor createCompressor(ParameterizedClass compression) throws ConfigurationException
{
         return createCompressor(parseCompressorClass(compression.class_name), copyOptions(compression.parameters));
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java
----------------------------------------------------------------------
diff --git a/test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java b/test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java
index 22dbe11..758d2f9 100644
--- a/test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java
+++ b/test/long/org/apache/cassandra/db/commitlog/CommitLogStressTest.java
@@ -48,7 +48,7 @@ import org.apache.cassandra.SchemaLoader;
 import org.apache.cassandra.Util;
 import org.apache.cassandra.config.Config.CommitLogSync;
 import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.ParametrizedClass;
+import org.apache.cassandra.config.ParameterizedClass;
 import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.db.Cell;
 import org.apache.cassandra.db.ColumnFamily;
@@ -185,11 +185,11 @@ public class CommitLogStressTest
         DatabaseDescriptor.setCommitLogSyncBatchWindow(1);
         DatabaseDescriptor.setCommitLogSyncPeriod(30);
         DatabaseDescriptor.setCommitLogSegmentSize(32);
-        for (ParametrizedClass compressor : new ParametrizedClass[] {
+        for (ParameterizedClass compressor : new ParameterizedClass[] {
                 null,
-                new ParametrizedClass("LZ4Compressor", null),
-                new ParametrizedClass("SnappyCompressor", null),
-                new ParametrizedClass("DeflateCompressor", null)}) {
+                new ParameterizedClass("LZ4Compressor", null),
+                new ParameterizedClass("SnappyCompressor", null),
+                new ParameterizedClass("DeflateCompressor", null)}) {
             DatabaseDescriptor.setCommitLogCompression(compressor);
             for (CommitLogSync sync : CommitLogSync.values())
             {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a03181d/test/unit/org/apache/cassandra/db/CommitLogTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/CommitLogTest.java b/test/unit/org/apache/cassandra/db/CommitLogTest.java
index 3073ecd..c825f2a 100644
--- a/test/unit/org/apache/cassandra/db/CommitLogTest.java
+++ b/test/unit/org/apache/cassandra/db/CommitLogTest.java
@@ -46,7 +46,7 @@ import org.apache.cassandra.Util;
 import org.apache.cassandra.config.Config;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.KSMetaData;
-import org.apache.cassandra.config.ParametrizedClass;
+import org.apache.cassandra.config.ParameterizedClass;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.db.commitlog.CommitLogDescriptor;
 import org.apache.cassandra.db.commitlog.CommitLogSegment;
@@ -431,9 +431,9 @@ public class CommitLogTest
         testDescriptorPersistence(new CommitLogDescriptor(11, null));
         testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_21,
13, null));
         testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30,
15, null));
-        testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30,
17, new ParametrizedClass("LZ4Compressor", null)));
+        testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30,
17, new ParameterizedClass("LZ4Compressor", null)));
         testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30,
19,
-                new ParametrizedClass("StubbyCompressor", ImmutableMap.of("parameter1", "value1",
"flag2", "55", "argument3", "null"))));
+                new ParameterizedClass("StubbyCompressor", ImmutableMap.of("parameter1",
"value1", "flag2", "55", "argument3", "null"))));
     }
 
     @Test
@@ -445,7 +445,7 @@ public class CommitLogTest
         try {
             CommitLogDescriptor desc = new CommitLogDescriptor(CommitLogDescriptor.VERSION_30,
                                                                21,
-                                                               new ParametrizedClass("LZ4Compressor",
params));
+                                                               new ParameterizedClass("LZ4Compressor",
params));
             ByteBuffer buf = ByteBuffer.allocate(1024000);
             CommitLogDescriptor.writeHeader(buf, desc);
             Assert.fail("Parameter object too long should fail on writing descriptor.");


Mime
View raw message