hallelujah-cassandra 0.12.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/CHANGELOG +111 -0
  2. data/Gemfile +8 -0
  3. data/LICENSE +202 -0
  4. data/Manifest +91 -0
  5. data/README.md +352 -0
  6. data/Rakefile +171 -0
  7. data/bin/cassandra_helper +16 -0
  8. data/conf/0.6/cassandra.in.sh +47 -0
  9. data/conf/0.6/log4j.properties +38 -0
  10. data/conf/0.6/schema.json +57 -0
  11. data/conf/0.6/storage-conf.xml +352 -0
  12. data/conf/0.7/cassandra.in.sh +46 -0
  13. data/conf/0.7/cassandra.yaml +336 -0
  14. data/conf/0.7/log4j-server.properties +41 -0
  15. data/conf/0.7/schema.json +57 -0
  16. data/conf/0.7/schema.txt +45 -0
  17. data/conf/0.8/cassandra.in.sh +41 -0
  18. data/conf/0.8/cassandra.yaml +61 -0
  19. data/conf/0.8/log4j-server.properties +40 -0
  20. data/conf/0.8/schema.json +69 -0
  21. data/conf/0.8/schema.txt +51 -0
  22. data/conf/1.0/cassandra.in.sh +41 -0
  23. data/conf/1.0/cassandra.yaml +415 -0
  24. data/conf/1.0/log4j-server.properties +40 -0
  25. data/conf/1.0/schema.json +69 -0
  26. data/conf/1.0/schema.txt +51 -0
  27. data/conf/1.1/cassandra.in.sh +41 -0
  28. data/conf/1.1/cassandra.yaml +560 -0
  29. data/conf/1.1/log4j-server.properties +44 -0
  30. data/conf/1.1/schema.json +69 -0
  31. data/conf/1.1/schema.txt +51 -0
  32. data/hallelujah-cassandra.gemspec +43 -0
  33. data/lib/cassandra.rb +39 -0
  34. data/lib/cassandra/0.6.rb +7 -0
  35. data/lib/cassandra/0.6/cassandra.rb +113 -0
  36. data/lib/cassandra/0.6/columns.rb +78 -0
  37. data/lib/cassandra/0.6/protocol.rb +90 -0
  38. data/lib/cassandra/0.7.rb +7 -0
  39. data/lib/cassandra/0.7/cassandra.rb +2 -0
  40. data/lib/cassandra/0.7/columns.rb +4 -0
  41. data/lib/cassandra/0.7/protocol.rb +5 -0
  42. data/lib/cassandra/0.8.rb +7 -0
  43. data/lib/cassandra/0.8/cassandra.rb +25 -0
  44. data/lib/cassandra/0.8/columns.rb +28 -0
  45. data/lib/cassandra/0.8/protocol.rb +10 -0
  46. data/lib/cassandra/1.0.rb +7 -0
  47. data/lib/cassandra/1.0/cassandra.rb +25 -0
  48. data/lib/cassandra/1.0/columns.rb +28 -0
  49. data/lib/cassandra/1.0/protocol.rb +12 -0
  50. data/lib/cassandra/1.1.rb +6 -0
  51. data/lib/cassandra/1.1/cassandra.rb +25 -0
  52. data/lib/cassandra/1.1/columns.rb +28 -0
  53. data/lib/cassandra/1.1/protocol.rb +12 -0
  54. data/lib/cassandra/array.rb +8 -0
  55. data/lib/cassandra/cassandra.rb +1070 -0
  56. data/lib/cassandra/column_family.rb +3 -0
  57. data/lib/cassandra/columns.rb +147 -0
  58. data/lib/cassandra/comparable.rb +28 -0
  59. data/lib/cassandra/composite.rb +118 -0
  60. data/lib/cassandra/constants.rb +11 -0
  61. data/lib/cassandra/debug.rb +9 -0
  62. data/lib/cassandra/helpers.rb +41 -0
  63. data/lib/cassandra/keyspace.rb +3 -0
  64. data/lib/cassandra/long.rb +58 -0
  65. data/lib/cassandra/mock.rb +511 -0
  66. data/lib/cassandra/ordered_hash.rb +192 -0
  67. data/lib/cassandra/protocol.rb +120 -0
  68. data/lib/cassandra/time.rb +11 -0
  69. data/test/cassandra_client_test.rb +20 -0
  70. data/test/cassandra_mock_test.rb +122 -0
  71. data/test/cassandra_test.rb +922 -0
  72. data/test/comparable_types_test.rb +45 -0
  73. data/test/composite_type_test.rb +29 -0
  74. data/test/eventmachine_test.rb +42 -0
  75. data/test/ordered_hash_test.rb +386 -0
  76. data/test/test_helper.rb +15 -0
  77. data/vendor/0.6/gen-rb/cassandra.rb +1481 -0
  78. data/vendor/0.6/gen-rb/cassandra_constants.rb +12 -0
  79. data/vendor/0.6/gen-rb/cassandra_types.rb +482 -0
  80. data/vendor/0.7/gen-rb/cassandra.rb +1936 -0
  81. data/vendor/0.7/gen-rb/cassandra_constants.rb +12 -0
  82. data/vendor/0.7/gen-rb/cassandra_types.rb +681 -0
  83. data/vendor/0.8/gen-rb/cassandra.rb +2215 -0
  84. data/vendor/0.8/gen-rb/cassandra_constants.rb +12 -0
  85. data/vendor/0.8/gen-rb/cassandra_types.rb +824 -0
  86. data/vendor/1.0/gen-rb/cassandra.rb +2215 -0
  87. data/vendor/1.0/gen-rb/cassandra_constants.rb +12 -0
  88. data/vendor/1.0/gen-rb/cassandra_types.rb +857 -0
  89. data/vendor/1.1/gen-rb/cassandra.rb +2571 -0
  90. data/vendor/1.1/gen-rb/cassandra_constants.rb +12 -0
  91. data/vendor/1.1/gen-rb/cassandra_types.rb +928 -0
  92. metadata +260 -0
@@ -0,0 +1,40 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The ASF licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # for production, you should probably set pattern to %c instead of %l.
18
+ # (%l is slower.)
19
+
20
+ # output messages into a rolling log file as well as stdout
21
+ log4j.rootLogger=INFO,stdout,R
22
+
23
+ # stdout
24
+ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
25
+ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
26
+ log4j.appender.stdout.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n
27
+
28
+ # rolling log file
29
+ log4j.appender.R=org.apache.log4j.RollingFileAppender
30
+ log4j.appender.R.maxFileSize=20MB
31
+ log4j.appender.R.maxBackupIndex=50
32
+ log4j.appender.R.layout=org.apache.log4j.PatternLayout
33
+ log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line %L) %m%n
34
+ # Edit the next line to point to your logs directory
35
+ log4j.appender.R.File=data/logs/system.log
36
+
37
+ # Application logging options
38
+ #log4j.logger.org.apache.cassandra=DEBUG
39
+ #log4j.logger.org.apache.cassandra.db=DEBUG
40
+ #log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG
@@ -0,0 +1,69 @@
1
+ {"Twitter":{
2
+ "Users":{
3
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
4
+ "column_type":"Standard"},
5
+ "UserAudits":{
6
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
7
+ "column_type":"Standard"},
8
+ "UserCounters":{
9
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
10
+ "column_type":"Standard",
11
+ "default_validation_class":"CounterColumnType"},
12
+ "UserCounterAggregates":{
13
+ "subcomparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
14
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
15
+ "column_type":"Super",
16
+ "default_validation_class":"CounterColumnType"},
17
+ "UserRelationships":{
18
+ "subcomparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType",
19
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
20
+ "column_type":"Super"},
21
+ "Usernames":{
22
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
23
+ "column_type":"Standard"},
24
+ "Statuses":{
25
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
26
+ "column_type":"Standard"},
27
+ "StatusAudits":{
28
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
29
+ "column_type":"Standard"},
30
+ "StatusRelationships":{
31
+ "subcomparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType",
32
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
33
+ "column_type":"Super"},
34
+ "Indexes":{
35
+ "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type",
36
+ "column_type":"Super"},
37
+ "TimelinishThings":{
38
+ "comparator_type":"org.apache.cassandra.db.marshal.BytesType",
39
+ "column_type":"Standard"}
40
+ },
41
+ "Multiblog":{
42
+ "Blogs":{
43
+ "comparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType",
44
+ "column_type":"Standard"},
45
+ "Comments":{
46
+ "comparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType",
47
+ "column_type":"Standard"}
48
+ },
49
+ "MultiblogLong":{
50
+ "Blogs":{
51
+ "comparator_type":"org.apache.cassandra.db.marshal.LongType",
52
+ "column_type":"Standard"},
53
+ "Comments":{
54
+ "comparator_type":"org.apache.cassandra.db.marshal.LongType",
55
+ "column_type":"Standard"}
56
+ },
57
+ "TypeConversions":{
58
+ "UUIDColumnConversion":{
59
+ "comparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType",
60
+ "column_type":"Standard"},
61
+ "SuperUUID":{
62
+ "subcomparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType",
63
+ "comparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType",
64
+ "column_type":"Super"},
65
+ "CompositeColumnConversion":{
66
+ "comparator_type":"org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.IntegerType,org.apache.cassandra.db.marshal.UTF8Type)",
67
+ "column_type":"Standard"}
68
+ }
69
+ }
@@ -0,0 +1,51 @@
1
+ create keyspace Twitter with
2
+ placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND
3
+ strategy_options = {replication_factor:1};
4
+ use Twitter;
5
+ create column family Users with comparator = 'UTF8Type';
6
+ create column family UserAudits with comparator = 'UTF8Type';
7
+ create column family UserCounters with comparator = 'UTF8Type' and
8
+ default_validation_class = CounterColumnType;
9
+ create column family UserCounterAggregates with column_type = 'Super'
10
+ and comparator = 'UTF8Type' and
11
+ subcomparator = 'UTF8Type' and
12
+ default_validation_class = CounterColumnType;
13
+ create column family UserRelationships with
14
+ comparator = 'UTF8Type' and
15
+ column_type = 'Super' and
16
+ subcomparator = 'TimeUUIDType';
17
+ create column family Usernames with comparator = 'UTF8Type';
18
+ create column family Statuses with comparator = 'UTF8Type';
19
+ create column family StatusAudits with comparator = 'UTF8Type';
20
+ create column family StatusRelationships with
21
+ comparator = 'UTF8Type' and
22
+ column_type = 'Super' and
23
+ subcomparator = 'TimeUUIDType';
24
+ create column family Indexes with
25
+ comparator = 'UTF8Type' and
26
+ column_type = 'Super';
27
+ create column family TimelinishThings with
28
+ comparator = 'BytesType';
29
+
30
+ create keyspace Multiblog with
31
+ placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND
32
+ strategy_options = {replication_factor:1};
33
+ use Multiblog;
34
+ create column family Blogs with comparator = 'TimeUUIDType';
35
+ create column family Comments with comparator = 'TimeUUIDType';
36
+
37
+
38
+ create keyspace MultiblogLong with
39
+ placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND
40
+ strategy_options = {replication_factor:1};
41
+ use MultiblogLong;
42
+ create column family Blogs with comparator = 'LongType';
43
+ create column family Comments with comparator = 'LongType';
44
+
45
+ create keyspace TypeConversions with
46
+ placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND
47
+ strategy_options = {replication_factor:1};
48
+ use TypeConversions;
49
+ create column family UUIDColumnConversion with comparator = TimeUUIDType;
50
+ create column family SuperUUID with comparator = TimeUUIDType and column_type = Super;
51
+ create column family CompositeColumnConversion with comparator = 'CompositeType(IntegerType, UTF8Type)';
@@ -0,0 +1,41 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The ASF licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ if [ "x$CASSANDRA_HOME" = "x" ]; then
18
+ CASSANDRA_HOME=`dirname $0`/..
19
+ fi
20
+
21
+ # The directory where Cassandra's configs live (required)
22
+ if [ "x$CASSANDRA_CONF" = "x" ]; then
23
+ CASSANDRA_CONF=$CASSANDRA_HOME/conf
24
+ fi
25
+
26
+ # This can be the path to a jar file, or a directory containing the
27
+ # compiled classes. NOTE: This isn't needed by the startup script,
28
+ # it's just used here in constructing the classpath.
29
+ cassandra_bin=$CASSANDRA_HOME/build/classes/main
30
+ cassandra_bin=$cassandra_bin:$CASSANDRA_HOME/build/classes/thrift
31
+ #cassandra_bin=$cassandra_home/build/cassandra.jar
32
+
33
+ # JAVA_HOME can optionally be set here
34
+ #JAVA_HOME=/usr/local/jdk6
35
+
36
+ # The java classpath (required)
37
+ CLASSPATH=$CASSANDRA_CONF:$cassandra_bin
38
+
39
+ for jar in $CASSANDRA_HOME/lib/*.jar; do
40
+ CLASSPATH=$CLASSPATH:$jar
41
+ done
@@ -0,0 +1,560 @@
1
+ # Cassandra storage config YAML
2
+
3
+ # NOTE:
4
+ # See http://wiki.apache.org/cassandra/StorageConfiguration for
5
+ # full explanations of configuration directives
6
+ # /NOTE
7
+
8
+ # The name of the cluster. This is mainly used to prevent machines in
9
+ # one logical cluster from joining another.
10
+ cluster_name: 'Test Cluster'
11
+
12
+ # You should always specify InitialToken when setting up a production
13
+ # cluster for the first time, and often when adding capacity later.
14
+ # The principle is that each node should be given an equal slice of
15
+ # the token ring; see http://wiki.apache.org/cassandra/Operations
16
+ # for more details.
17
+ #
18
+ # If blank, Cassandra will request a token bisecting the range of
19
+ # the heaviest-loaded existing node. If there is no load information
20
+ # available, such as is the case with a new cluster, it will pick
21
+ # a random token, which will lead to hot spots.
22
+ initial_token: 0
23
+
24
+ # See http://wiki.apache.org/cassandra/HintedHandoff
25
+ hinted_handoff_enabled: true
26
+ # this defines the maximum amount of time a dead host will have hints
27
+ # generated. After it has been dead this long, hints will be dropped.
28
+ max_hint_window_in_ms: 3600000 # one hour
29
+ # Sleep this long after delivering each hint
30
+ hinted_handoff_throttle_delay_in_ms: 50
31
+
32
+ # The following setting populates the page cache on memtable flush and compaction
33
+ # WARNING: Enable this setting only when the whole node's data fits in memory.
34
+ # Defaults to: false
35
+ # populate_io_cache_on_flush: false
36
+
37
+ # authentication backend, implementing IAuthenticator; used to identify users
38
+ authenticator: org.apache.cassandra.auth.AllowAllAuthenticator
39
+
40
+ # authorization backend, implementing IAuthority; used to limit access/provide permissions
41
+ authority: org.apache.cassandra.auth.AllowAllAuthority
42
+
43
+ # The partitioner is responsible for distributing rows (by key) across
44
+ # nodes in the cluster. Any IPartitioner may be used, including your
45
+ # own as long as it is on the classpath. Out of the box, Cassandra
46
+ # provides org.apache.cassandra.dht.RandomPartitioner
47
+ # org.apache.cassandra.dht.ByteOrderedPartitioner,
48
+ # org.apache.cassandra.dht.OrderPreservingPartitioner (deprecated),
49
+ # and org.apache.cassandra.dht.CollatingOrderPreservingPartitioner
50
+ # (deprecated).
51
+ #
52
+ # - RandomPartitioner distributes rows across the cluster evenly by md5.
53
+ # When in doubt, this is the best option.
54
+ # - ByteOrderedPartitioner orders rows lexically by key bytes. BOP allows
55
+ # scanning rows in key order, but the ordering can generate hot spots
56
+ # for sequential insertion workloads.
57
+ # - OrderPreservingPartitioner is an obsolete form of BOP, that stores
58
+ # - keys in a less-efficient format and only works with keys that are
59
+ # UTF8-encoded Strings.
60
+ # - CollatingOPP colates according to EN,US rules rather than lexical byte
61
+ # ordering. Use this as an example if you need custom collation.
62
+ #
63
+ # See http://wiki.apache.org/cassandra/Operations for more on
64
+ # partitioners and token selection.
65
+ partitioner: org.apache.cassandra.dht.RandomPartitioner
66
+
67
+ # directories where Cassandra should store data on disk.
68
+ data_file_directories:
69
+ - data/data
70
+
71
+ # commit log
72
+ commitlog_directory: data/commitlog
73
+
74
+ # Maximum size of the key cache in memory.
75
+ #
76
+ # Each key cache hit saves 1 seek and each row cache hit saves 2 seeks at the
77
+ # minimum, sometimes more. The key cache is fairly tiny for the amount of
78
+ # time it saves, so it's worthwhile to use it at large numbers.
79
+ # The row cache saves even more time, but must store the whole values of
80
+ # its rows, so it is extremely space-intensive. It's best to only use the
81
+ # row cache if you have hot rows or static rows.
82
+ #
83
+ # NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
84
+ #
85
+ # Default value is empty to make it "auto" (min(5% of Heap (in MB), 100MB)). Set to 0 to disable key cache.
86
+ key_cache_size_in_mb:
87
+
88
+ # Duration in seconds after which Cassandra should
89
+ # safe the keys cache. Caches are saved to saved_caches_directory as
90
+ # specified in this configuration file.
91
+ #
92
+ # Saved caches greatly improve cold-start speeds, and is relatively cheap in
93
+ # terms of I/O for the key cache. Row cache saving is much more expensive and
94
+ # has limited use.
95
+ #
96
+ # Default is 14400 or 4 hours.
97
+ key_cache_save_period: 14400
98
+
99
+ # Number of keys from the key cache to save
100
+ # Disabled by default, meaning all keys are going to be saved
101
+ # key_cache_keys_to_save: 100
102
+
103
+ # Maximum size of the row cache in memory.
104
+ # NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
105
+ #
106
+ # Default value is 0, to disable row caching.
107
+ row_cache_size_in_mb: 0
108
+
109
+ # Duration in seconds after which Cassandra should
110
+ # safe the row cache. Caches are saved to saved_caches_directory as specified
111
+ # in this configuration file.
112
+ #
113
+ # Saved caches greatly improve cold-start speeds, and is relatively cheap in
114
+ # terms of I/O for the key cache. Row cache saving is much more expensive and
115
+ # has limited use.
116
+ #
117
+ # Default is 0 to disable saving the row cache.
118
+ row_cache_save_period: 0
119
+
120
+ # Number of keys from the row cache to save
121
+ # Disabled by default, meaning all keys are going to be saved
122
+ # row_cache_keys_to_save: 100
123
+
124
+ # The provider for the row cache to use.
125
+ #
126
+ # Supported values are: ConcurrentLinkedHashCacheProvider, SerializingCacheProvider
127
+ #
128
+ # SerializingCacheProvider serialises the contents of the row and stores
129
+ # it in native memory, i.e., off the JVM Heap. Serialized rows take
130
+ # significantly less memory than "live" rows in the JVM, so you can cache
131
+ # more rows in a given memory footprint. And storing the cache off-heap
132
+ # means you can use smaller heap sizes, reducing the impact of GC pauses.
133
+ #
134
+ # It is also valid to specify the fully-qualified class name to a class
135
+ # that implements org.apache.cassandra.cache.IRowCacheProvider.
136
+ #
137
+ # Defaults to SerializingCacheProvider
138
+ row_cache_provider: SerializingCacheProvider
139
+
140
+ # saved caches
141
+ saved_caches_directory: data/saved_caches
142
+
143
+ # commitlog_sync may be either "periodic" or "batch."
144
+ # When in batch mode, Cassandra won't ack writes until the commit log
145
+ # has been fsynced to disk. It will wait up to
146
+ # commitlog_sync_batch_window_in_ms milliseconds for other writes, before
147
+ # performing the sync.
148
+ #
149
+ # commitlog_sync: batch
150
+ # commitlog_sync_batch_window_in_ms: 50
151
+ #
152
+ # the other option is "periodic" where writes may be acked immediately
153
+ # and the CommitLog is simply synced every commitlog_sync_period_in_ms
154
+ # milliseconds.
155
+ commitlog_sync: periodic
156
+ commitlog_sync_period_in_ms: 10000
157
+
158
+ # Configure the Size of the individual Commitlog file. The
159
+ # default is 128 MB, which is almost always fine, but if you are
160
+ # archiving commitlog segments (see commitlog_archiving.properties),
161
+ # then you probably want a finer granularity of archiving; 16 MB
162
+ # is reasonable.
163
+ #
164
+ # commitlog_segment_size_in_mb: 128KB
165
+
166
+ # any class that implements the SeedProvider interface and has a
167
+ # constructor that takes a Map<String, String> of parameters will do.
168
+ seed_provider:
169
+ # Addresses of hosts that are deemed contact points.
170
+ # Cassandra nodes use this list of hosts to find each other and learn
171
+ # the topology of the ring. You must change this if you are running
172
+ # multiple nodes!
173
+ - class_name: org.apache.cassandra.locator.SimpleSeedProvider
174
+ parameters:
175
+ # seeds is actually a comma-delimited list of addresses.
176
+ # Ex: "<ip1>,<ip2>,<ip3>"
177
+ - seeds: "127.0.0.1"
178
+
179
+ # emergency pressure valve: each time heap usage after a full (CMS)
180
+ # garbage collection is above this fraction of the max, Cassandra will
181
+ # flush the largest memtables.
182
+ #
183
+ # Set to 1.0 to disable. Setting this lower than
184
+ # CMSInitiatingOccupancyFraction is not likely to be useful.
185
+ #
186
+ # RELYING ON THIS AS YOUR PRIMARY TUNING MECHANISM WILL WORK POORLY:
187
+ # it is most effective under light to moderate load, or read-heavy
188
+ # workloads; under truly massive write load, it will often be too
189
+ # little, too late.
190
+ flush_largest_memtables_at: 0.75
191
+
192
+ # emergency pressure valve #2: the first time heap usage after a full
193
+ # (CMS) garbage collection is above this fraction of the max,
194
+ # Cassandra will reduce cache maximum _capacity_ to the given fraction
195
+ # of the current _size_. Should usually be set substantially above
196
+ # flush_largest_memtables_at, since that will have less long-term
197
+ # impact on the system.
198
+ #
199
+ # Set to 1.0 to disable. Setting this lower than
200
+ # CMSInitiatingOccupancyFraction is not likely to be useful.
201
+ reduce_cache_sizes_at: 0.85
202
+ reduce_cache_capacity_to: 0.6
203
+
204
+ # For workloads with more data than can fit in memory, Cassandra's
205
+ # bottleneck will be reads that need to fetch data from
206
+ # disk. "concurrent_reads" should be set to (16 * number_of_drives) in
207
+ # order to allow the operations to enqueue low enough in the stack
208
+ # that the OS and drives can reorder them.
209
+ #
210
+ # On the other hand, since writes are almost never IO bound, the ideal
211
+ # number of "concurrent_writes" is dependent on the number of cores in
212
+ # your system; (8 * number_of_cores) is a good rule of thumb.
213
+ concurrent_reads: 32
214
+ concurrent_writes: 32
215
+
216
+ # Total memory to use for memtables. Cassandra will flush the largest
217
+ # memtable when this much memory is used.
218
+ # If omitted, Cassandra will set it to 1/3 of the heap.
219
+ # memtable_total_space_in_mb: 2048
220
+
221
+ # Total space to use for commitlogs.
222
+ # If space gets above this value (it will round up to the next nearest
223
+ # segment multiple), Cassandra will flush every dirty CF in the oldest
224
+ # segment and remove it.
225
+ # commitlog_total_space_in_mb: 4096
226
+
227
+ # This sets the amount of memtable flush writer threads. These will
228
+ # be blocked by disk io, and each one will hold a memtable in memory
229
+ # while blocked. If you have a large heap and many data directories,
230
+ # you can increase this value for better flush performance.
231
+ # By default this will be set to the amount of data directories defined.
232
+ #memtable_flush_writers: 1
233
+
234
+ # the number of full memtables to allow pending flush, that is,
235
+ # waiting for a writer thread. At a minimum, this should be set to
236
+ # the maximum number of secondary indexes created on a single CF.
237
+ memtable_flush_queue_size: 4
238
+
239
+ # Whether to, when doing sequential writing, fsync() at intervals in
240
+ # order to force the operating system to flush the dirty
241
+ # buffers. Enable this to avoid sudden dirty buffer flushing from
242
+ # impacting read latencies. Almost always a good idea on SSD:s; not
243
+ # necessarily on platters.
244
+ trickle_fsync: false
245
+ trickle_fsync_interval_in_kb: 10240
246
+
247
+ # TCP port, for commands and data
248
+ storage_port: 7000
249
+
250
+ # SSL port, for encrypted communication. Unused unless enabled in
251
+ # encryption_options
252
+ ssl_storage_port: 7001
253
+
254
+ # Address to bind to and tell other Cassandra nodes to connect to. You
255
+ # _must_ change this if you want multiple nodes to be able to
256
+ # communicate!
257
+ #
258
+ # Leaving it blank leaves it up to InetAddress.getLocalHost(). This
259
+ # will always do the Right Thing *if* the node is properly configured
260
+ # (hostname, name resolution, etc), and the Right Thing is to use the
261
+ # address associated with the hostname (it might not be).
262
+ #
263
+ # Setting this to 0.0.0.0 is always wrong.
264
+ listen_address: localhost
265
+
266
+ # Address to broadcast to other Cassandra nodes
267
+ # Leaving this blank will set it to the same value as listen_address
268
+ # broadcast_address: 1.2.3.4
269
+
270
+ # The address to bind the Thrift RPC service to -- clients connect
271
+ # here. Unlike ListenAddress above, you *can* specify 0.0.0.0 here if
272
+ # you want Thrift to listen on all interfaces.
273
+ #
274
+ # Leaving this blank has the same effect it does for ListenAddress,
275
+ # (i.e. it will be based on the configured hostname of the node).
276
+ rpc_address: localhost
277
+ # port for Thrift to listen for clients on
278
+ rpc_port: 9160
279
+
280
+ # enable or disable keepalive on rpc connections
281
+ rpc_keepalive: true
282
+
283
+ # Cassandra provides three options for the RPC Server:
284
+ #
285
+ # sync -> One connection per thread in the rpc pool (see below).
286
+ # For a very large number of clients, memory will be your limiting
287
+ # factor; on a 64 bit JVM, 128KB is the minimum stack size per thread.
288
+ # Connection pooling is very, very strongly recommended.
289
+ #
290
+ # async -> Nonblocking server implementation with one thread to serve
291
+ # rpc connections. This is not recommended for high throughput use
292
+ # cases. Async has been tested to be about 50% slower than sync
293
+ # or hsha and is deprecated: it will be removed in the next major release.
294
+ #
295
+ # hsha -> Stands for "half synchronous, half asynchronous." The rpc thread pool
296
+ # (see below) is used to manage requests, but the threads are multiplexed
297
+ # across the different clients.
298
+ #
299
+ # The default is sync because on Windows hsha is about 30% slower. On Linux,
300
+ # sync/hsha performance is about the same, with hsha of course using less memory.
301
+ rpc_server_type: sync
302
+
303
+ # Uncomment rpc_min|max|thread to set request pool size.
304
+ # You would primarily set max for the sync server to safeguard against
305
+ # misbehaved clients; if you do hit the max, Cassandra will block until one
306
+ # disconnects before accepting more. The defaults for sync are min of 16 and max
307
+ # unlimited.
308
+ #
309
+ # For the Hsha server, the min and max both default to quadruple the number of
310
+ # CPU cores.
311
+ #
312
+ # This configuration is ignored by the async server.
313
+ #
314
+ # rpc_min_threads: 16
315
+ # rpc_max_threads: 2048
316
+
317
+ # uncomment to set socket buffer sizes on rpc connections
318
+ # rpc_send_buff_size_in_bytes:
319
+ # rpc_recv_buff_size_in_bytes:
320
+
321
+ # Frame size for thrift (maximum field length).
322
+ # 0 disables TFramedTransport in favor of TSocket. This option
323
+ # is deprecated; we strongly recommend using Framed mode.
324
+ thrift_framed_transport_size_in_mb: 15
325
+
326
+ # The max length of a thrift message, including all fields and
327
+ # internal thrift overhead.
328
+ thrift_max_message_length_in_mb: 16
329
+
330
+ # Set to true to have Cassandra create a hard link to each sstable
331
+ # flushed or streamed locally in a backups/ subdirectory of the
332
+ # Keyspace data. Removing these links is the operator's
333
+ # responsibility.
334
+ incremental_backups: false
335
+
336
+ # Whether or not to take a snapshot before each compaction. Be
337
+ # careful using this option, since Cassandra won't clean up the
338
+ # snapshots for you. Mostly useful if you're paranoid when there
339
+ # is a data format change.
340
+ snapshot_before_compaction: false
341
+
342
+ # Whether or not a snapshot is taken of the data before keyspace truncation
343
+ # or dropping of column families. The STRONGLY advised default of true
344
+ # should be used to provide data safety. If you set this flag to false, you will
345
+ # lose data on truncation or drop.
346
+ auto_snapshot: true
347
+
348
+ # Add column indexes to a row after its contents reach this size.
349
+ # Increase if your column values are large, or if you have a very large
350
+ # number of columns. The competing causes are, Cassandra has to
351
+ # deserialize this much of the row to read a single column, so you want
352
+ # it to be small - at least if you do many partial-row reads - but all
353
+ # the index data is read for each access, so you don't want to generate
354
+ # that wastefully either.
355
+ column_index_size_in_kb: 64
356
+
357
+ # Size limit for rows being compacted in memory. Larger rows will spill
358
+ # over to disk and use a slower two-pass compaction process. A message
359
+ # will be logged specifying the row key.
360
+ in_memory_compaction_limit_in_mb: 64
361
+
362
+ # Number of simultaneous compactions to allow, NOT including
363
+ # validation "compactions" for anti-entropy repair. Simultaneous
364
+ # compactions can help preserve read performance in a mixed read/write
365
+ # workload, by mitigating the tendency of small sstables to accumulate
366
+ # during a single long running compactions. The default is usually
367
+ # fine and if you experience problems with compaction running too
368
+ # slowly or too fast, you should look at
369
+ # compaction_throughput_mb_per_sec first.
370
+ #
371
+ # This setting has no effect on LeveledCompactionStrategy.
372
+ #
373
+ # concurrent_compactors defaults to the number of cores.
374
+ # Uncomment to make compaction mono-threaded, the pre-0.8 default.
375
+ #concurrent_compactors: 1
376
+
377
+ # Multi-threaded compaction. When enabled, each compaction will use
378
+ # up to one thread per core, plus one thread per sstable being merged.
379
+ # This is usually only useful for SSD-based hardware: otherwise,
380
+ # your concern is usually to get compaction to do LESS i/o (see:
381
+ # compaction_throughput_mb_per_sec), not more.
382
+ multithreaded_compaction: false
383
+
384
+ # Throttles compaction to the given total throughput across the entire
385
+ # system. The faster you insert data, the faster you need to compact in
386
+ # order to keep the sstable count down, but in general, setting this to
387
+ # 16 to 32 times the rate you are inserting data is more than sufficient.
388
+ # Setting this to 0 disables throttling. Note that this account for all types
389
+ # of compaction, including validation compaction.
390
+ compaction_throughput_mb_per_sec: 16
391
+
392
+ # Track cached row keys during compaction, and re-cache their new
393
+ # positions in the compacted sstable. Disable if you use really large
394
+ # key caches.
395
+ compaction_preheat_key_cache: true
396
+
397
+ # Throttles all outbound streaming file transfers on this node to the
398
+ # given total throughput in Mbps. This is necessary because Cassandra does
399
+ # mostly sequential IO when streaming data during bootstrap or repair, which
400
+ # can lead to saturating the network connection and degrading rpc performance.
401
+ # When unset, the default is 400 Mbps or 50 MB/s.
402
+ # stream_throughput_outbound_megabits_per_sec: 400
403
+
404
+ # Time to wait for a reply from other nodes before failing the command
405
+ rpc_timeout_in_ms: 10000
406
+
407
+ # Enable socket timeout for streaming operation.
408
+ # When a timeout occurs during streaming, streaming is retried from the start
409
+ # of the current file. This *can* involve re-streaming an important amount of
410
+ # data, so you should avoid setting the value too low.
411
+ # Default value is 0, which never timeout streams.
412
+ # streaming_socket_timeout_in_ms: 0
413
+
414
+ # phi value that must be reached for a host to be marked down.
415
+ # most users should never need to adjust this.
416
+ # phi_convict_threshold: 8
417
+
418
+ # endpoint_snitch -- Set this to a class that implements
419
+ # IEndpointSnitch. The snitch has two functions:
420
+ # - it teaches Cassandra enough about your network topology to route
421
+ # requests efficiently
422
+ # - it allows Cassandra to spread replicas around your cluster to avoid
423
+ # correlated failures. It does this by grouping machines into
424
+ # "datacenters" and "racks." Cassandra will do its best not to have
425
+ # more than one replica on the same "rack" (which may not actually
426
+ # be a physical location)
427
+ #
428
+ # IF YOU CHANGE THE SNITCH AFTER DATA IS INSERTED INTO THE CLUSTER,
429
+ # YOU MUST RUN A FULL REPAIR, SINCE THE SNITCH AFFECTS WHERE REPLICAS
430
+ # ARE PLACED.
431
+ #
432
+ # Out of the box, Cassandra provides
433
+ # - SimpleSnitch:
434
+ # Treats Strategy order as proximity. This improves cache locality
435
+ # when disabling read repair, which can further improve throughput.
436
+ # Only appropriate for single-datacenter deployments.
437
+ # - PropertyFileSnitch:
438
+ # Proximity is determined by rack and data center, which are
439
+ # explicitly configured in cassandra-topology.properties.
440
+ # - GossipingPropertyFileSnitch
441
+ # The rack and datacenter for the local node are defined in
442
+ # cassandra-rackdc.properties and propagated to other nodes via gossip. If
443
+ # cassandra-topology.properties exists, it is used as a fallback, allowing
444
+ # migration from the PropertyFileSnitch.
445
+ # - RackInferringSnitch:
446
+ # Proximity is determined by rack and data center, which are
447
+ # assumed to correspond to the 3rd and 2nd octet of each node's
448
+ # IP address, respectively. Unless this happens to match your
449
+ # deployment conventions (as it did Facebook's), this is best used
450
+ # as an example of writing a custom Snitch class.
451
+ # - Ec2Snitch:
452
+ # Appropriate for EC2 deployments in a single Region. Loads Region
453
+ # and Availability Zone information from the EC2 API. The Region is
454
+ # treated as the Datacenter, and the Availability Zone as the rack.
455
+ # Only private IPs are used, so this will not work across multiple
456
+ # Regions.
457
+ # - Ec2MultiRegionSnitch:
458
+ # Uses public IPs as broadcast_address to allow cross-region
459
+ # connectivity. (Thus, you should set seed addresses to the public
460
+ # IP as well.) You will need to open the storage_port or
461
+ # ssl_storage_port on the public IP firewall. (For intra-Region
462
+ # traffic, Cassandra will switch to the private IP after
463
+ # establishing a connection.)
464
+ #
465
+ # You can use a custom Snitch by setting this to the full class name
466
+ # of the snitch, which will be assumed to be on your classpath.
467
+ endpoint_snitch: SimpleSnitch
468
+
469
+ # controls how often to perform the more expensive part of host score
470
+ # calculation
471
+ dynamic_snitch_update_interval_in_ms: 100
472
+ # controls how often to reset all host scores, allowing a bad host to
473
+ # possibly recover
474
+ dynamic_snitch_reset_interval_in_ms: 600000
475
+ # if set greater than zero and read_repair_chance is < 1.0, this will allow
476
+ # 'pinning' of replicas to hosts in order to increase cache capacity.
477
+ # The badness threshold will control how much worse the pinned host has to be
478
+ # before the dynamic snitch will prefer other replicas over it. This is
479
+ # expressed as a double which represents a percentage. Thus, a value of
480
+ # 0.2 means Cassandra would continue to prefer the static snitch values
481
+ # until the pinned host was 20% worse than the fastest.
482
+ dynamic_snitch_badness_threshold: 0.1
483
+
484
+ # request_scheduler -- Set this to a class that implements
485
+ # RequestScheduler, which will schedule incoming client requests
486
+ # according to the specific policy. This is useful for multi-tenancy
487
+ # with a single Cassandra cluster.
488
+ # NOTE: This is specifically for requests from the client and does
489
+ # not affect inter node communication.
490
+ # org.apache.cassandra.scheduler.NoScheduler - No scheduling takes place
491
+ # org.apache.cassandra.scheduler.RoundRobinScheduler - Round robin of
492
+ # client requests to a node with a separate queue for each
493
+ # request_scheduler_id. The scheduler is further customized by
494
+ # request_scheduler_options as described below.
495
+ request_scheduler: org.apache.cassandra.scheduler.NoScheduler
496
+
497
+ # Scheduler Options vary based on the type of scheduler
498
+ # NoScheduler - Has no options
499
+ # RoundRobin
500
+ # - throttle_limit -- The throttle_limit is the number of in-flight
501
+ # requests per client. Requests beyond
502
+ # that limit are queued up until
503
+ # running requests can complete.
504
+ # The value of 80 here is twice the number of
505
+ # concurrent_reads + concurrent_writes.
506
+ # - default_weight -- default_weight is optional and allows for
507
+ # overriding the default which is 1.
508
+ # - weights -- Weights are optional and will default to 1 or the
509
+ # overridden default_weight. The weight translates into how
510
+ # many requests are handled during each turn of the
511
+ # RoundRobin, based on the scheduler id.
512
+ #
513
+ # request_scheduler_options:
514
+ # throttle_limit: 80
515
+ # default_weight: 5
516
+ # weights:
517
+ # Keyspace1: 1
518
+ # Keyspace2: 5
519
+
520
+ # request_scheduler_id -- An identifer based on which to perform
521
+ # the request scheduling. Currently the only valid option is keyspace.
522
+ # request_scheduler_id: keyspace
523
+
524
+ # index_interval controls the sampling of entries from the primrary
525
+ # row index in terms of space versus time. The larger the interval,
526
+ # the smaller and less effective the sampling will be. In technicial
527
+ # terms, the interval coresponds to the number of index entries that
528
+ # are skipped between taking each sample. All the sampled entries
529
+ # must fit in memory. Generally, a value between 128 and 512 here
530
+ # coupled with a large key cache size on CFs results in the best trade
531
+ # offs. This value is not often changed, however if you have many
532
+ # very small rows (many to an OS page), then increasing this will
533
+ # often lower memory usage without a impact on performance.
534
+ index_interval: 128
535
+
536
+ # Enable or disable inter-node encryption
537
+ # Default settings are TLS v1, RSA 1024-bit keys (it is imperative that
538
+ # users generate their own keys) TLS_RSA_WITH_AES_128_CBC_SHA as the cipher
539
+ # suite for authentication, key exchange and encryption of the actual data transfers.
540
+ # NOTE: No custom encryption options are enabled at the moment
541
+ # The available internode options are : all, none, dc, rack
542
+ #
543
+ # If set to dc cassandra will encrypt the traffic between the DCs
544
+ # If set to rack cassandra will encrypt the traffic between the racks
545
+ #
546
+ # The passwords used in these options must match the passwords used when generating
547
+ # the keystore and truststore. For instructions on generating these files, see:
548
+ # http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore
549
+ #
550
+ encryption_options:
551
+ internode_encryption: none
552
+ keystore: conf/.keystore
553
+ keystore_password: cassandra
554
+ truststore: conf/.truststore
555
+ truststore_password: cassandra
556
+ # More advanced defaults below:
557
+ # protocol: TLS
558
+ # algorithm: SunX509
559
+ # store_type: JKS
560
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA]