diff --git a/contrib/client_only/conf/cassandra.yaml b/contrib/client_only/conf/cassandra.yaml index ea8568abeb..c8ac8191f6 100644 --- a/contrib/client_only/conf/cassandra.yaml +++ b/contrib/client_only/conf/cassandra.yaml @@ -90,17 +90,12 @@ commitlog_sync: periodic # milliseconds. commitlog_sync_period_in_ms: 10000 -# any class that implements the SeedProvider interface and has a constructor that takes a Map of -# parameters will do. -seed_provider: - # Addresses of hosts that are deemed contact points. - # Cassandra nodes use this list of hosts to find each other and learn - # the topology of the ring. You must change this if you are running - # multiple nodes! - - class_name: org.apache.cassandra.locator.SimpleSeedProvider - parameters: - # seeds is actually a comma-delimited list of addresses. - - seeds: "127.0.0.1" +# Addresses of hosts that are deemed contact points. +# Cassandra nodes use this list of hosts to find each other and learn +# the topology of the ring. You must change this if you are running +# multiple nodes! +seeds: + - 127.0.0.1 # Access mode. mmapped i/o is substantially faster, but only practical on # a 64bit machine (which notably does not include EC2 "small" instances) @@ -292,23 +287,6 @@ request_scheduler: org.apache.cassandra.scheduler.NoScheduler # the index is at the cost of space. index_interval: 128 -# Enable or disable inter-node encryption -# Default settings are TLS v1, RSA 1024-bit keys (it is imperative that -# users generate their own keys) TLS_RSA_WITH_AES_128_CBC_SHA as the cipher -# suite for authentication, key exchange and encryption of the actual data transfers. -# NOTE: No custom encryption options are enabled at the moment -# The available internode options are : all, none -# -# The passwords used in these options must match the passwords used when generating -# the keystore and truststore. For instructions on generating these files, see: -# http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore -encryption_options: - internode_encryption: none - keystore: conf/.keystore - keystore_password: cassandra - truststore: conf/.truststore - truststore_password: cassandra - # Keyspaces have ColumnFamilies. (Usually 1 KS per application.) # ColumnFamilies have Rows. (Dozens of CFs per KS.) # Rows contain Columns. (Many per CF.) @@ -338,7 +316,8 @@ encryption_options: # With NetworkTopologyStrategy, # for each datacenter, you can specify how many replicas you want # on a per-keyspace basis. Replicas are placed on different racks -# within each DC, if possible. +# within each DC, if possible. This strategy also requires rack aware +# snitch, such as RackInferringSnitch or PropertyFileSnitch. # An example: # - name: Keyspace1 # replica_placement_strategy: org.apache.cassandra.locator.NetworkTopologyStrategy @@ -481,10 +460,3 @@ keyspaces: validator_class: LongType index_name: birthdate_idx index_type: KEYS - - - name: Counter1 - default_validation_class: CounterColumnType - - - name: SuperCounter1 - column_type: Super - default_validation_class: CounterColumnType diff --git a/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java b/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java index 853d5987fa..73f7413d5c 100644 --- a/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java +++ b/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java @@ -17,23 +17,23 @@ */ package org.apache.cassandra.contrib.stress; +import java.io.*; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicIntegerArray; +import java.util.concurrent.atomic.AtomicLongArray; + +import org.apache.commons.cli.*; + import org.apache.cassandra.db.ColumnFamilyType; import org.apache.cassandra.thrift.*; -import org.apache.commons.cli.*; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.transport.TFramedTransport; import org.apache.thrift.transport.TSocket; import org.apache.thrift.transport.TTransport; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.PrintStream; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.concurrent.atomic.AtomicIntegerArray; -import java.util.concurrent.atomic.AtomicLongArray; - public class Session { // command line options @@ -53,6 +53,7 @@ public class Session availableOptions.addOption("S", "column-size", true, "Size of column values in bytes, default:34"); availableOptions.addOption("C", "cardinality", true, "Number of unique values stored in columns, default:50"); availableOptions.addOption("d", "nodes", true, "Host nodes (comma separated), default:locahost"); + availableOptions.addOption("D", "nodesfile", true, "File containing host nodes (one per line)"); availableOptions.addOption("s", "stdev", true, "Standard Deviation Factor, default:0.1"); availableOptions.addOption("r", "random", false, "Use random key generator (STDEV will have no effect), default:false"); availableOptions.addOption("f", "file", true, "Write output to given file"); @@ -125,11 +126,32 @@ public class Session columnSize = Integer.parseInt(cmd.getOptionValue("S")); if (cmd.hasOption("C")) - cardinality = Integer.parseInt(cmd.getOptionValue("t")); + cardinality = Integer.parseInt(cmd.getOptionValue("C")); if (cmd.hasOption("d")) nodes = cmd.getOptionValue("d").split(","); + if (cmd.hasOption("D")) + { + try + { + String node = null; + List tmpNodes = new ArrayList(); + BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(cmd.getOptionValue("D")))); + while ((node = in.readLine()) != null) + { + if (node.length() > 0) + tmpNodes.add(node); + } + nodes = tmpNodes.toArray(new String[tmpNodes.size()]); + in.close(); + } + catch(IOException ioe) + { + throw new RuntimeException(ioe); + } + } + if (cmd.hasOption("s")) STDev = Float.parseFloat(cmd.getOptionValue("s")); diff --git a/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Inserter.java b/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Inserter.java index 7065b115c7..95c26facc5 100644 --- a/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Inserter.java +++ b/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Inserter.java @@ -23,6 +23,7 @@ import org.apache.cassandra.thrift.*; import org.apache.cassandra.utils.ByteBufferUtil; import java.nio.ByteBuffer; +import java.nio.charset.CharacterCodingException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -83,7 +84,14 @@ public class Inserter extends OperationThread } catch (Exception e) { - System.err.printf("Error while inserting key %s - %s%n", ByteBufferUtil.string(key), getExceptionMessage(e)); + try + { + System.err.printf("Error while inserting key %s - %s%n", ByteBufferUtil.string(key), getExceptionMessage(e)); + } + catch (CharacterCodingException e1) + { + throw new AssertionError(e1); // keys are valid strings + } if (!session.ignoreErrors()) return; diff --git a/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Reader.java b/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Reader.java index 14552568aa..5eb6f0c2d3 100644 --- a/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Reader.java +++ b/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Reader.java @@ -22,7 +22,9 @@ import org.apache.cassandra.db.ColumnFamilyType; import org.apache.cassandra.thrift.*; import org.apache.cassandra.utils.ByteBufferUtil; +import java.lang.AssertionError; import java.nio.ByteBuffer; +import java.nio.charset.CharacterCodingException; import java.util.List; public class Reader extends OperationThread @@ -83,7 +85,14 @@ public class Reader extends OperationThread } catch (Exception e) { - System.err.printf("Error while reading Super Column %s key %s - %s%n", superColumn, ByteBufferUtil.string(key), getExceptionMessage(e)); + try + { + System.err.printf("Error while reading Super Column %s key %s - %s%n", superColumn, ByteBufferUtil.string(key), getExceptionMessage(e)); + } + catch (CharacterCodingException e1) + { + throw new AssertionError(e1); // keys are valid string + } if (!session.ignoreErrors()) break;