diff --git a/Gemfile.lock b/Gemfile.lock index 9c4d06d..853ea08 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,7 @@ PATH cassandra (0.12.1) json rake - simple_uuid (>= 0.1.0) + simple_uuid (>= 0.2.0) thrift_client (>= 0.7.0) GEM diff --git a/Rakefile b/Rakefile index 1a93c3f..155837e 100755 --- a/Rakefile +++ b/Rakefile @@ -19,7 +19,8 @@ end CassandraBinaries = { '0.6' => 'http://archive.apache.org/dist/cassandra/0.6.13/apache-cassandra-0.6.13-bin.tar.gz', '0.7' => 'http://archive.apache.org/dist/cassandra/0.7.9/apache-cassandra-0.7.9-bin.tar.gz', - '0.8' => 'http://archive.apache.org/dist/cassandra/0.8.6/apache-cassandra-0.8.6-bin.tar.gz' + '0.8' => 'http://archive.apache.org/dist/cassandra/0.8.6/apache-cassandra-0.8.6-bin.tar.gz', + '1.0' => 'http://archive.apache.org/dist/cassandra/1.0.0/apache-cassandra-1.0.0-rc2-bin.tar.gz' } CASSANDRA_HOME = ENV['CASSANDRA_HOME'] || "#{ENV['HOME']}/cassandra" diff --git a/conf/1.0/cassandra.in.sh b/conf/1.0/cassandra.in.sh new file mode 100755 index 0000000..fcc19a1 --- /dev/null +++ b/conf/1.0/cassandra.in.sh @@ -0,0 +1,41 @@ +# 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. + +if [ "x$CASSANDRA_HOME" = "x" ]; then + CASSANDRA_HOME=`dirname $0`/.. +fi + +# The directory where Cassandra's configs live (required) +if [ "x$CASSANDRA_CONF" = "x" ]; then + CASSANDRA_CONF=$CASSANDRA_HOME/conf +fi + +# This can be the path to a jar file, or a directory containing the +# compiled classes. NOTE: This isn't needed by the startup script, +# it's just used here in constructing the classpath. +cassandra_bin=$CASSANDRA_HOME/build/classes/main +cassandra_bin=$cassandra_bin:$CASSANDRA_HOME/build/classes/thrift +#cassandra_bin=$cassandra_home/build/cassandra.jar + +# JAVA_HOME can optionally be set here +#JAVA_HOME=/usr/local/jdk6 + +# The java classpath (required) +CLASSPATH=$CASSANDRA_CONF:$cassandra_bin + +for jar in $CASSANDRA_HOME/lib/*.jar; do + CLASSPATH=$CLASSPATH:$jar +done diff --git a/conf/1.0/cassandra.yaml b/conf/1.0/cassandra.yaml new file mode 100755 index 0000000..e9872a5 --- /dev/null +++ b/conf/1.0/cassandra.yaml @@ -0,0 +1,415 @@ +# Cassandra storage config YAML + +# NOTE: +# See http://wiki.apache.org/cassandra/StorageConfiguration for +# full explanations of configuration directives +# /NOTE + +# The name of the cluster. This is mainly used to prevent machines in +# one logical cluster from joining another. +cluster_name: 'Test Cluster' + +# You should always specify InitialToken when setting up a production +# cluster for the first time, and often when adding capacity later. +# The principle is that each node should be given an equal slice of +# the token ring; see http://wiki.apache.org/cassandra/Operations +# for more details. +# +# If blank, Cassandra will request a token bisecting the range of +# the heaviest-loaded existing node. If there is no load information +# available, such as is the case with a new cluster, it will pick +# a random token, which will lead to hot spots. +initial_token: 0 + +# See http://wiki.apache.org/cassandra/HintedHandoff +hinted_handoff_enabled: true +# this defines the maximum amount of time a dead host will have hints +# generated. After it has been dead this long, hints will be dropped. +max_hint_window_in_ms: 3600000 # one hour +# Sleep this long after delivering each row or row fragment +hinted_handoff_throttle_delay_in_ms: 50 + +# authentication backend, implementing IAuthenticator; used to identify users +authenticator: org.apache.cassandra.auth.AllowAllAuthenticator + +# authorization backend, implementing IAuthority; used to limit access/provide permissions +authority: org.apache.cassandra.auth.AllowAllAuthority + +# The partitioner is responsible for distributing rows (by key) across +# nodes in the cluster. Any IPartitioner may be used, including your +# own as long as it is on the classpath. Out of the box, Cassandra +# provides org.apache.cassandra.dht.RandomPartitioner +# org.apache.cassandra.dht.ByteOrderedPartitioner, +# org.apache.cassandra.dht.OrderPreservingPartitioner (deprecated), +# and org.apache.cassandra.dht.CollatingOrderPreservingPartitioner +# (deprecated). +# +# - RandomPartitioner distributes rows across the cluster evenly by md5. +# When in doubt, this is the best option. +# - ByteOrderedPartitioner orders rows lexically by key bytes. BOP allows +# scanning rows in key order, but the ordering can generate hot spots +# for sequential insertion workloads. +# - OrderPreservingPartitioner is an obsolete form of BOP, that stores +# - keys in a less-efficient format and only works with keys that are +# UTF8-encoded Strings. +# - CollatingOPP colates according to EN,US rules rather than lexical byte +# ordering. Use this as an example if you need custom collation. +# +# See http://wiki.apache.org/cassandra/Operations for more on +# partitioners and token selection. +partitioner: org.apache.cassandra.dht.RandomPartitioner + +# directories where Cassandra should store data on disk. +data_file_directories: + - data/data + +# commit log +commitlog_directory: data/commitlog + +# saved caches +saved_caches_directory: data/saved_caches + +# commitlog_sync may be either "periodic" or "batch." +# When in batch mode, Cassandra won't ack writes until the commit log +# has been fsynced to disk. It will wait up to +# commitlog_sync_batch_window_in_ms milliseconds for other writes, before +# performing the sync. +# +# commitlog_sync: batch +# commitlog_sync_batch_window_in_ms: 50 +# +# the other option is "periodic" where writes may be acked immediately +# and the CommitLog is simply synced every commitlog_sync_period_in_ms +# milliseconds. +commitlog_sync: periodic +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. + # Ex: ",," + - seeds: "127.0.0.1" + +# emergency pressure valve: each time heap usage after a full (CMS) +# garbage collection is above this fraction of the max, Cassandra will +# flush the largest memtables. +# +# Set to 1.0 to disable. Setting this lower than +# CMSInitiatingOccupancyFraction is not likely to be useful. +# +# RELYING ON THIS AS YOUR PRIMARY TUNING MECHANISM WILL WORK POORLY: +# it is most effective under light to moderate load, or read-heavy +# workloads; under truly massive write load, it will often be too +# little, too late. +flush_largest_memtables_at: 0.75 + +# emergency pressure valve #2: the first time heap usage after a full +# (CMS) garbage collection is above this fraction of the max, +# Cassandra will reduce cache maximum _capacity_ to the given fraction +# of the current _size_. Should usually be set substantially above +# flush_largest_memtables_at, since that will have less long-term +# impact on the system. +# +# Set to 1.0 to disable. Setting this lower than +# CMSInitiatingOccupancyFraction is not likely to be useful. +reduce_cache_sizes_at: 0.85 +reduce_cache_capacity_to: 0.6 + +# For workloads with more data than can fit in memory, Cassandra's +# bottleneck will be reads that need to fetch data from +# disk. "concurrent_reads" should be set to (16 * number_of_drives) in +# order to allow the operations to enqueue low enough in the stack +# that the OS and drives can reorder them. +# +# On the other hand, since writes are almost never IO bound, the ideal +# number of "concurrent_writes" is dependent on the number of cores in +# your system; (8 * number_of_cores) is a good rule of thumb. +concurrent_reads: 32 +concurrent_writes: 32 + +# Total memory to use for memtables. Cassandra will flush the largest +# memtable when this much memory is used. +# If omitted, Cassandra will set it to 1/3 of the heap. +# memtable_total_space_in_mb: 2048 + +# Total space to use for commitlogs. +# If space gets above this value (it will round up to the next nearest +# segment multiple), Cassandra will flush every dirty CF in the oldest +# segment and remove it. +# commitlog_total_space_in_mb: 4096 + +# This sets the amount of memtable flush writer threads. These will +# be blocked by disk io, and each one will hold a memtable in memory +# while blocked. If you have a large heap and many data directories, +# you can increase this value for better flush performance. +# By default this will be set to the amount of data directories defined. +#memtable_flush_writers: 1 + +# the number of full memtables to allow pending flush, that is, +# waiting for a writer thread. At a minimum, this should be set to +# the maximum number of secondary indexes created on a single CF. +memtable_flush_queue_size: 4 + +# Buffer size to use when performing contiguous column slices. +# Increase this to the size of the column slices you typically perform +sliced_buffer_size_in_kb: 64 + +# TCP port, for commands and data +storage_port: 7000 + +# Address to bind to and tell other Cassandra nodes to connect to. You +# _must_ change this if you want multiple nodes to be able to +# communicate! +# +# Leaving it blank leaves it up to InetAddress.getLocalHost(). This +# will always do the Right Thing *if* the node is properly configured +# (hostname, name resolution, etc), and the Right Thing is to use the +# address associated with the hostname (it might not be). +# +# Setting this to 0.0.0.0 is always wrong. +listen_address: localhost + +# Address to broadcast to other Cassandra nodes +# Leaving this blank will set it to the same value as listen_address +# broadcast_address: 1.2.3.4 + +# The address to bind the Thrift RPC service to -- clients connect +# here. Unlike ListenAddress above, you *can* specify 0.0.0.0 here if +# you want Thrift to listen on all interfaces. +# +# Leaving this blank has the same effect it does for ListenAddress, +# (i.e. it will be based on the configured hostname of the node). +rpc_address: localhost +# port for Thrift to listen for clients on +rpc_port: 9160 + +# enable or disable keepalive on rpc connections +rpc_keepalive: true + +# Cassandra provides three options for the RPC Server: +# +# sync -> One connection per thread in the rpc pool (see below). +# For a very large number of clients, memory will be your limiting +# factor; on a 64 bit JVM, 128KB is the minimum stack size per thread. +# Connection pooling is very, very strongly recommended. +# +# async -> Nonblocking server implementation with one thread to serve +# rpc connections. This is not recommended for high throughput use +# cases. Async has been tested to be about 50% slower than sync +# or hsha and is deprecated: it will be removed in the next major release. +# +# hsha -> Stands for "half synchronous, half asynchronous." The rpc thread pool +# (see below) is used to manage requests, but the threads are multiplexed +# across the different clients. +# +# The default is sync because on Windows hsha is about 30% slower. On Linux, +# sync/hsha performance is about the same, with hsha of course using less memory. +rpc_server_type: sync + +# Uncomment rpc_min|max|thread to set request pool size. +# You would primarily set max for the sync server to safeguard against +# misbehaved clients; if you do hit the max, Cassandra will block until one +# disconnects before accepting more. The defaults for sync are min of 16 and max +# unlimited. +# +# For the Hsha server, the min and max both default to the number of CPU cores. +# +# This configuration is ignored by the async server. +# +# rpc_min_threads: 16 +# rpc_max_threads: 2048 + +# uncomment to set socket buffer sizes on rpc connections +# rpc_send_buff_size_in_bytes: +# rpc_recv_buff_size_in_bytes: + +# Frame size for thrift (maximum field length). +# 0 disables TFramedTransport in favor of TSocket. This option +# is deprecated; we strongly recommend using Framed mode. +thrift_framed_transport_size_in_mb: 15 + +# The max length of a thrift message, including all fields and +# internal thrift overhead. +thrift_max_message_length_in_mb: 16 + +# Set to true to have Cassandra create a hard link to each sstable +# flushed or streamed locally in a backups/ subdirectory of the +# Keyspace data. Removing these links is the operator's +# responsibility. +incremental_backups: false + +# Whether or not to take a snapshot before each compaction. Be +# careful using this option, since Cassandra won't clean up the +# snapshots for you. Mostly useful if you're paranoid when there +# is a data format change. +snapshot_before_compaction: false + +# Add column indexes to a row after its contents reach this size. +# Increase if your column values are large, or if you have a very large +# number of columns. The competing causes are, Cassandra has to +# deserialize this much of the row to read a single column, so you want +# it to be small - at least if you do many partial-row reads - but all +# the index data is read for each access, so you don't want to generate +# that wastefully either. +column_index_size_in_kb: 64 + +# Size limit for rows being compacted in memory. Larger rows will spill +# over to disk and use a slower two-pass compaction process. A message +# will be logged specifying the row key. +in_memory_compaction_limit_in_mb: 64 + +# Number of simultaneous compactions to allow, NOT including +# validation "compactions" for anti-entropy repair. Simultaneous +# compactions can help preserve read performance in a mixed read/write +# workload, by mitigating the tendency of small sstables to accumulate +# during a single long running compactions. The default is usually +# fine and if you experience problems with compaction running too +# slowly or too fast, you should look at +# compaction_throughput_mb_per_sec first. +# +# This setting has no effect on LeveledCompactionStrategy. +# +# concurrent_compactors defaults to the number of cores. +# Uncomment to make compaction mono-threaded, the pre-0.8 default. +#concurrent_compactors: 1 + +# Multi-threaded compaction. When enabled, each compaction will use +# up to one thread per core, plus one thread per sstable being merged. +# This is usually only useful for SSD-based hardware: otherwise, +# your concern is usually to get compaction to do LESS i/o (see: +# compaction_throughput_mb_per_sec), not more. +multithreaded_compaction: false + +# Throttles compaction to the given total throughput across the entire +# system. The faster you insert data, the faster you need to compact in +# order to keep the sstable count down, but in general, setting this to +# 16 to 32 times the rate you are inserting data is more than sufficient. +# Setting this to 0 disables throttling. Note that this account for all types +# of compaction, including validation compaction. +compaction_throughput_mb_per_sec: 16 + +# Track cached row keys during compaction, and re-cache their new +# positions in the compacted sstable. Disable if you use really large +# key caches. +compaction_preheat_key_cache: true + +# Throttles all outbound streaming file transfers on this node to the +# given total throughput in Mbps. This is necessary because Cassandra does +# mostly sequential IO when streaming data during bootstrap or repair, which +# can lead to saturating the network connection and degrading rpc performance. +# When unset, the default is 400 Mbps or 50 MB/s. +# stream_throughput_outbound_megabits_per_sec: 400 + +# Time to wait for a reply from other nodes before failing the command +rpc_timeout_in_ms: 10000 + +# phi value that must be reached for a host to be marked down. +# most users should never need to adjust this. +# phi_convict_threshold: 8 + +# endpoint_snitch -- Set this to a class that implements +# IEndpointSnitch, which will let Cassandra know enough +# about your network topology to route requests efficiently. +# Out of the box, Cassandra provides +# - org.apache.cassandra.locator.SimpleSnitch: +# Treats Strategy order as proximity. This improves cache locality +# when disabling read repair, which can further improve throughput. +# - org.apache.cassandra.locator.RackInferringSnitch: +# Proximity is determined by rack and data center, which are +# assumed to correspond to the 3rd and 2nd octet of each node's +# IP address, respectively +# org.apache.cassandra.locator.PropertyFileSnitch: +# - Proximity is determined by rack and data center, which are +# explicitly configured in cassandra-topology.properties. +endpoint_snitch: org.apache.cassandra.locator.SimpleSnitch + +# controls how often to perform the more expensive part of host score +# calculation +dynamic_snitch_update_interval_in_ms: 100 +# controls how often to reset all host scores, allowing a bad host to +# possibly recover +dynamic_snitch_reset_interval_in_ms: 600000 +# if set greater than zero and read_repair_chance is < 1.0, this will allow +# 'pinning' of replicas to hosts in order to increase cache capacity. +# The badness threshold will control how much worse the pinned host has to be +# before the dynamic snitch will prefer other replicas over it. This is +# expressed as a double which represents a percentage. Thus, a value of +# 0.2 means Cassandra would continue to prefer the static snitch values +# until the pinned host was 20% worse than the fastest. +dynamic_snitch_badness_threshold: 0.1 + +# request_scheduler -- Set this to a class that implements +# RequestScheduler, which will schedule incoming client requests +# according to the specific policy. This is useful for multi-tenancy +# with a single Cassandra cluster. +# NOTE: This is specifically for requests from the client and does +# not affect inter node communication. +# org.apache.cassandra.scheduler.NoScheduler - No scheduling takes place +# org.apache.cassandra.scheduler.RoundRobinScheduler - Round robin of +# client requests to a node with a separate queue for each +# request_scheduler_id. The scheduler is further customized by +# request_scheduler_options as described below. +request_scheduler: org.apache.cassandra.scheduler.NoScheduler + +# Scheduler Options vary based on the type of scheduler +# NoScheduler - Has no options +# RoundRobin +# - throttle_limit -- The throttle_limit is the number of in-flight +# requests per client. Requests beyond +# that limit are queued up until +# running requests can complete. +# The value of 80 here is twice the number of +# concurrent_reads + concurrent_writes. +# - default_weight -- default_weight is optional and allows for +# overriding the default which is 1. +# - weights -- Weights are optional and will default to 1 or the +# overridden default_weight. The weight translates into how +# many requests are handled during each turn of the +# RoundRobin, based on the scheduler id. +# +# request_scheduler_options: +# throttle_limit: 80 +# default_weight: 5 +# weights: +# Keyspace1: 1 +# Keyspace2: 5 + +# request_scheduler_id -- An identifer based on which to perform +# the request scheduling. Currently the only valid option is keyspace. +# request_scheduler_id: keyspace + +# index_interval controls the sampling of entries from the primrary +# row index in terms of space versus time. The larger the interval, +# the smaller and less effective the sampling will be. In technicial +# terms, the interval coresponds to the number of index entries that +# are skipped between taking each sample. All the sampled entries +# must fit in memory. Generally, a value between 128 and 512 here +# coupled with a large key cache size on CFs results in the best trade +# offs. This value is not often changed, however if you have many +# very small rows (many to an OS page), then increasing this will +# often lower memory usage without a impact on performance. +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 \ No newline at end of file diff --git a/conf/1.0/log4j-server.properties b/conf/1.0/log4j-server.properties new file mode 100755 index 0000000..0f9e2ae --- /dev/null +++ b/conf/1.0/log4j-server.properties @@ -0,0 +1,40 @@ +# 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. + +# for production, you should probably set pattern to %c instead of %l. +# (%l is slower.) + +# output messages into a rolling log file as well as stdout +log4j.rootLogger=INFO,stdout,R + +# stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n + +# rolling log file +log4j.appender.R=org.apache.log4j.RollingFileAppender +log4j.appender.R.maxFileSize=20MB +log4j.appender.R.maxBackupIndex=50 +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line %L) %m%n +# Edit the next line to point to your logs directory +log4j.appender.R.File=data/logs/system.log + +# Application logging options +#log4j.logger.org.apache.cassandra=DEBUG +#log4j.logger.org.apache.cassandra.db=DEBUG +#log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG diff --git a/conf/1.0/schema.json b/conf/1.0/schema.json new file mode 100755 index 0000000..f98f69e --- /dev/null +++ b/conf/1.0/schema.json @@ -0,0 +1,66 @@ +{"Twitter":{ + "Users":{ + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Standard"}, + "UserAudits":{ + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Standard"}, + "UserCounters":{ + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Standard", + "default_validation_class":"CounterColumnType"}, + "UserCounterAggregates":{ + "subcomparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Super", + "default_validation_class":"CounterColumnType"}, + "UserRelationships":{ + "subcomparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType", + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Super"}, + "Usernames":{ + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Standard"}, + "Statuses":{ + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Standard"}, + "StatusAudits":{ + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Standard"}, + "StatusRelationships":{ + "subcomparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType", + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Super"}, + "Indexes":{ + "comparator_type":"org.apache.cassandra.db.marshal.UTF8Type", + "column_type":"Super"}, + "TimelinishThings":{ + "comparator_type":"org.apache.cassandra.db.marshal.BytesType", + "column_type":"Standard"} + }, +"Multiblog":{ + "Blogs":{ + "comparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType", + "column_type":"Standard"}, + "Comments":{ + "comparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType", + "column_type":"Standard"} + }, +"MultiblogLong":{ + "Blogs":{ + "comparator_type":"org.apache.cassandra.db.marshal.LongType", + "column_type":"Standard"}, + "Comments":{ + "comparator_type":"org.apache.cassandra.db.marshal.LongType", + "column_type":"Standard"} + }, +"TypeConversions":{ + "UUIDColumnConversion":{ + "comparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType", + "column_type":"Standard"}, + "SuperUUID":{ + "subcomparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType", + "comparator_type":"org.apache.cassandra.db.marshal.TimeUUIDType", + "column_type":"Super"} + } +} diff --git a/conf/1.0/schema.txt b/conf/1.0/schema.txt new file mode 100755 index 0000000..52edcc9 --- /dev/null +++ b/conf/1.0/schema.txt @@ -0,0 +1,51 @@ +create keyspace Twitter with + placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND + strategy_options = {replication_factor:1}; +use Twitter; +create column family Users with comparator = 'UTF8Type'; +create column family UserAudits with comparator = 'UTF8Type'; +create column family UserCounters with comparator = 'UTF8Type' and + default_validation_class = CounterColumnType; +create column family UserCounterAggregates with column_type = 'Super' + and comparator = 'UTF8Type' and + subcomparator = 'UTF8Type' and + default_validation_class = CounterColumnType; +create column family UserRelationships with + comparator = 'UTF8Type' and + column_type = 'Super' and + subcomparator = 'TimeUUIDType'; +create column family Usernames with comparator = 'UTF8Type'; +create column family Statuses with comparator = 'UTF8Type'; +create column family StatusAudits with comparator = 'UTF8Type'; +create column family StatusRelationships with + comparator = 'UTF8Type' and + column_type = 'Super' and + subcomparator = 'TimeUUIDType'; +create column family Indexes with + comparator = 'UTF8Type' and + column_type = 'Super'; +create column family TimelinishThings with + comparator = 'BytesType'; + +create keyspace Multiblog with + placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND + strategy_options = {replication_factor:1}; +use Multiblog; +create column family Blogs with comparator = 'TimeUUIDType'; +create column family Comments with comparator = 'TimeUUIDType'; + + +create keyspace MultiblogLong with + placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND + strategy_options = {replication_factor:1}; +use MultiblogLong; +create column family Blogs with comparator = 'LongType'; +create column family Comments with comparator = 'LongType'; + +create keyspace TypeConversions with + placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND + strategy_options = {replication_factor:1}; +use TypeConversions; +create column family UUIDColumnConversion with comparator = TimeUUIDType; +create column family SuperUUID with comparator = TimeUUIDType and column_type = Super; + diff --git a/lib/cassandra/0.8/protocol.rb b/lib/cassandra/0.8/protocol.rb index f37ba34..acdd538 100755 --- a/lib/cassandra/0.8/protocol.rb +++ b/lib/cassandra/0.8/protocol.rb @@ -1,5 +1,3 @@ -require "#{File.expand_path(File.dirname(__FILE__))}/../0.7/protocol" - class Cassandra # Inner methods for actually doing the Thrift calls module Protocol #:nodoc: diff --git a/lib/cassandra/1.0.rb b/lib/cassandra/1.0.rb new file mode 100755 index 0000000..a23f572 --- /dev/null +++ b/lib/cassandra/1.0.rb @@ -0,0 +1,7 @@ +class Cassandra + def self.VERSION + "1.0" + end +end + +require "#{File.expand_path(File.dirname(__FILE__))}/../cassandra" diff --git a/lib/cassandra/1.0/cassandra.rb b/lib/cassandra/1.0/cassandra.rb new file mode 100755 index 0000000..c8fed3f --- /dev/null +++ b/lib/cassandra/1.0/cassandra.rb @@ -0,0 +1,10 @@ +class Cassandra + + ## Counters + + # Add a value to the counter in cf:key:super column:column + def add(column_family, key, value, *columns_and_options) + column_family, column, sub_column, options = extract_and_validate_params(column_family, key, columns_and_options, WRITE_DEFAULTS) + _add(column_family, key, column, sub_column, value, options[:consistency]) + end +end diff --git a/lib/cassandra/1.0/columns.rb b/lib/cassandra/1.0/columns.rb new file mode 100755 index 0000000..d62c187 --- /dev/null +++ b/lib/cassandra/1.0/columns.rb @@ -0,0 +1,4 @@ +class Cassandra + module Columns #:nodoc: + end +end diff --git a/lib/cassandra/1.0/protocol.rb b/lib/cassandra/1.0/protocol.rb new file mode 100755 index 0000000..f37ba34 --- /dev/null +++ b/lib/cassandra/1.0/protocol.rb @@ -0,0 +1,23 @@ +require "#{File.expand_path(File.dirname(__FILE__))}/../0.7/protocol" + +class Cassandra + # Inner methods for actually doing the Thrift calls + module Protocol #:nodoc: + private + + def _remove_counter(key, column_path, consistency_level) + client.remove_counter(key, column_path, consistency_level) + end + + def _add(column_family, key, column, sub_column, value, consistency) + if is_super(column_family) + column_parent = CassandraThrift::ColumnParent.new(:column_family => column_family, :super_column => column) + counter_column = CassandraThrift::CounterColumn.new(:name => sub_column, :value => value) + else + column_parent = CassandraThrift::ColumnParent.new(:column_family => column_family) + counter_column = CassandraThrift::CounterColumn.new(:name => column, :value => value) + end + client.add(key, column_parent, counter_column, consistency) + end + end +end diff --git a/vendor/1.0/gen-rb/cassandra.rb b/vendor/1.0/gen-rb/cassandra.rb new file mode 100755 index 0000000..bbee6be --- /dev/null +++ b/vendor/1.0/gen-rb/cassandra.rb @@ -0,0 +1,2215 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 'cassandra_types' + + module CassandraThrift + module Cassandra + class Client + include ::Thrift::Client + + def login(auth_request) + send_login(auth_request) + recv_login() + end + + def send_login(auth_request) + send_message('login', Login_args, :auth_request => auth_request) + end + + def recv_login() + result = receive_message(Login_result) + raise result.authnx unless result.authnx.nil? + raise result.authzx unless result.authzx.nil? + return + end + + def set_keyspace(keyspace) + send_set_keyspace(keyspace) + recv_set_keyspace() + end + + def send_set_keyspace(keyspace) + send_message('set_keyspace', Set_keyspace_args, :keyspace => keyspace) + end + + def recv_set_keyspace() + result = receive_message(Set_keyspace_result) + raise result.ire unless result.ire.nil? + return + end + + def get(key, column_path, consistency_level) + send_get(key, column_path, consistency_level) + return recv_get() + end + + def send_get(key, column_path, consistency_level) + send_message('get', Get_args, :key => key, :column_path => column_path, :consistency_level => consistency_level) + end + + def recv_get() + result = receive_message(Get_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.nfe unless result.nfe.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get failed: unknown result') + end + + def get_slice(key, column_parent, predicate, consistency_level) + send_get_slice(key, column_parent, predicate, consistency_level) + return recv_get_slice() + end + + def send_get_slice(key, column_parent, predicate, consistency_level) + send_message('get_slice', Get_slice_args, :key => key, :column_parent => column_parent, :predicate => predicate, :consistency_level => consistency_level) + end + + def recv_get_slice() + result = receive_message(Get_slice_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_slice failed: unknown result') + end + + def get_count(key, column_parent, predicate, consistency_level) + send_get_count(key, column_parent, predicate, consistency_level) + return recv_get_count() + end + + def send_get_count(key, column_parent, predicate, consistency_level) + send_message('get_count', Get_count_args, :key => key, :column_parent => column_parent, :predicate => predicate, :consistency_level => consistency_level) + end + + def recv_get_count() + result = receive_message(Get_count_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_count failed: unknown result') + end + + def multiget_slice(keys, column_parent, predicate, consistency_level) + send_multiget_slice(keys, column_parent, predicate, consistency_level) + return recv_multiget_slice() + end + + def send_multiget_slice(keys, column_parent, predicate, consistency_level) + send_message('multiget_slice', Multiget_slice_args, :keys => keys, :column_parent => column_parent, :predicate => predicate, :consistency_level => consistency_level) + end + + def recv_multiget_slice() + result = receive_message(Multiget_slice_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'multiget_slice failed: unknown result') + end + + def multiget_count(keys, column_parent, predicate, consistency_level) + send_multiget_count(keys, column_parent, predicate, consistency_level) + return recv_multiget_count() + end + + def send_multiget_count(keys, column_parent, predicate, consistency_level) + send_message('multiget_count', Multiget_count_args, :keys => keys, :column_parent => column_parent, :predicate => predicate, :consistency_level => consistency_level) + end + + def recv_multiget_count() + result = receive_message(Multiget_count_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'multiget_count failed: unknown result') + end + + def get_range_slices(column_parent, predicate, range, consistency_level) + send_get_range_slices(column_parent, predicate, range, consistency_level) + return recv_get_range_slices() + end + + def send_get_range_slices(column_parent, predicate, range, consistency_level) + send_message('get_range_slices', Get_range_slices_args, :column_parent => column_parent, :predicate => predicate, :range => range, :consistency_level => consistency_level) + end + + def recv_get_range_slices() + result = receive_message(Get_range_slices_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_range_slices failed: unknown result') + end + + def get_indexed_slices(column_parent, index_clause, column_predicate, consistency_level) + send_get_indexed_slices(column_parent, index_clause, column_predicate, consistency_level) + return recv_get_indexed_slices() + end + + def send_get_indexed_slices(column_parent, index_clause, column_predicate, consistency_level) + send_message('get_indexed_slices', Get_indexed_slices_args, :column_parent => column_parent, :index_clause => index_clause, :column_predicate => column_predicate, :consistency_level => consistency_level) + end + + def recv_get_indexed_slices() + result = receive_message(Get_indexed_slices_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_indexed_slices failed: unknown result') + end + + def insert(key, column_parent, column, consistency_level) + send_insert(key, column_parent, column, consistency_level) + recv_insert() + end + + def send_insert(key, column_parent, column, consistency_level) + send_message('insert', Insert_args, :key => key, :column_parent => column_parent, :column => column, :consistency_level => consistency_level) + end + + def recv_insert() + result = receive_message(Insert_result) + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + return + end + + def add(key, column_parent, column, consistency_level) + send_add(key, column_parent, column, consistency_level) + recv_add() + end + + def send_add(key, column_parent, column, consistency_level) + send_message('add', Add_args, :key => key, :column_parent => column_parent, :column => column, :consistency_level => consistency_level) + end + + def recv_add() + result = receive_message(Add_result) + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + return + end + + def remove(key, column_path, timestamp, consistency_level) + send_remove(key, column_path, timestamp, consistency_level) + recv_remove() + end + + def send_remove(key, column_path, timestamp, consistency_level) + send_message('remove', Remove_args, :key => key, :column_path => column_path, :timestamp => timestamp, :consistency_level => consistency_level) + end + + def recv_remove() + result = receive_message(Remove_result) + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + return + end + + def remove_counter(key, path, consistency_level) + send_remove_counter(key, path, consistency_level) + recv_remove_counter() + end + + def send_remove_counter(key, path, consistency_level) + send_message('remove_counter', Remove_counter_args, :key => key, :path => path, :consistency_level => consistency_level) + end + + def recv_remove_counter() + result = receive_message(Remove_counter_result) + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + return + end + + def batch_mutate(mutation_map, consistency_level) + send_batch_mutate(mutation_map, consistency_level) + recv_batch_mutate() + end + + def send_batch_mutate(mutation_map, consistency_level) + send_message('batch_mutate', Batch_mutate_args, :mutation_map => mutation_map, :consistency_level => consistency_level) + end + + def recv_batch_mutate() + result = receive_message(Batch_mutate_result) + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + return + end + + def truncate(cfname) + send_truncate(cfname) + recv_truncate() + end + + def send_truncate(cfname) + send_message('truncate', Truncate_args, :cfname => cfname) + end + + def recv_truncate() + result = receive_message(Truncate_result) + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + return + end + + def describe_schema_versions() + send_describe_schema_versions() + return recv_describe_schema_versions() + end + + def send_describe_schema_versions() + send_message('describe_schema_versions', Describe_schema_versions_args) + end + + def recv_describe_schema_versions() + result = receive_message(Describe_schema_versions_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_schema_versions failed: unknown result') + end + + def describe_keyspaces() + send_describe_keyspaces() + return recv_describe_keyspaces() + end + + def send_describe_keyspaces() + send_message('describe_keyspaces', Describe_keyspaces_args) + end + + def recv_describe_keyspaces() + result = receive_message(Describe_keyspaces_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_keyspaces failed: unknown result') + end + + def describe_cluster_name() + send_describe_cluster_name() + return recv_describe_cluster_name() + end + + def send_describe_cluster_name() + send_message('describe_cluster_name', Describe_cluster_name_args) + end + + def recv_describe_cluster_name() + result = receive_message(Describe_cluster_name_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_cluster_name failed: unknown result') + end + + def describe_version() + send_describe_version() + return recv_describe_version() + end + + def send_describe_version() + send_message('describe_version', Describe_version_args) + end + + def recv_describe_version() + result = receive_message(Describe_version_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_version failed: unknown result') + end + + def describe_ring(keyspace) + send_describe_ring(keyspace) + return recv_describe_ring() + end + + def send_describe_ring(keyspace) + send_message('describe_ring', Describe_ring_args, :keyspace => keyspace) + end + + def recv_describe_ring() + result = receive_message(Describe_ring_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_ring failed: unknown result') + end + + def describe_partitioner() + send_describe_partitioner() + return recv_describe_partitioner() + end + + def send_describe_partitioner() + send_message('describe_partitioner', Describe_partitioner_args) + end + + def recv_describe_partitioner() + result = receive_message(Describe_partitioner_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_partitioner failed: unknown result') + end + + def describe_snitch() + send_describe_snitch() + return recv_describe_snitch() + end + + def send_describe_snitch() + send_message('describe_snitch', Describe_snitch_args) + end + + def recv_describe_snitch() + result = receive_message(Describe_snitch_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_snitch failed: unknown result') + end + + def describe_keyspace(keyspace) + send_describe_keyspace(keyspace) + return recv_describe_keyspace() + end + + def send_describe_keyspace(keyspace) + send_message('describe_keyspace', Describe_keyspace_args, :keyspace => keyspace) + end + + def recv_describe_keyspace() + result = receive_message(Describe_keyspace_result) + return result.success unless result.success.nil? + raise result.nfe unless result.nfe.nil? + raise result.ire unless result.ire.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_keyspace failed: unknown result') + end + + def describe_splits(cfName, start_token, end_token, keys_per_split) + send_describe_splits(cfName, start_token, end_token, keys_per_split) + return recv_describe_splits() + end + + def send_describe_splits(cfName, start_token, end_token, keys_per_split) + send_message('describe_splits', Describe_splits_args, :cfName => cfName, :start_token => start_token, :end_token => end_token, :keys_per_split => keys_per_split) + end + + def recv_describe_splits() + result = receive_message(Describe_splits_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_splits failed: unknown result') + end + + def system_add_column_family(cf_def) + send_system_add_column_family(cf_def) + return recv_system_add_column_family() + end + + def send_system_add_column_family(cf_def) + send_message('system_add_column_family', System_add_column_family_args, :cf_def => cf_def) + end + + def recv_system_add_column_family() + result = receive_message(System_add_column_family_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.sde unless result.sde.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'system_add_column_family failed: unknown result') + end + + def system_drop_column_family(column_family) + send_system_drop_column_family(column_family) + return recv_system_drop_column_family() + end + + def send_system_drop_column_family(column_family) + send_message('system_drop_column_family', System_drop_column_family_args, :column_family => column_family) + end + + def recv_system_drop_column_family() + result = receive_message(System_drop_column_family_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.sde unless result.sde.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'system_drop_column_family failed: unknown result') + end + + def system_add_keyspace(ks_def) + send_system_add_keyspace(ks_def) + return recv_system_add_keyspace() + end + + def send_system_add_keyspace(ks_def) + send_message('system_add_keyspace', System_add_keyspace_args, :ks_def => ks_def) + end + + def recv_system_add_keyspace() + result = receive_message(System_add_keyspace_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.sde unless result.sde.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'system_add_keyspace failed: unknown result') + end + + def system_drop_keyspace(keyspace) + send_system_drop_keyspace(keyspace) + return recv_system_drop_keyspace() + end + + def send_system_drop_keyspace(keyspace) + send_message('system_drop_keyspace', System_drop_keyspace_args, :keyspace => keyspace) + end + + def recv_system_drop_keyspace() + result = receive_message(System_drop_keyspace_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.sde unless result.sde.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'system_drop_keyspace failed: unknown result') + end + + def system_update_keyspace(ks_def) + send_system_update_keyspace(ks_def) + return recv_system_update_keyspace() + end + + def send_system_update_keyspace(ks_def) + send_message('system_update_keyspace', System_update_keyspace_args, :ks_def => ks_def) + end + + def recv_system_update_keyspace() + result = receive_message(System_update_keyspace_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.sde unless result.sde.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'system_update_keyspace failed: unknown result') + end + + def system_update_column_family(cf_def) + send_system_update_column_family(cf_def) + return recv_system_update_column_family() + end + + def send_system_update_column_family(cf_def) + send_message('system_update_column_family', System_update_column_family_args, :cf_def => cf_def) + end + + def recv_system_update_column_family() + result = receive_message(System_update_column_family_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.sde unless result.sde.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'system_update_column_family failed: unknown result') + end + + def execute_cql_query(query, compression) + send_execute_cql_query(query, compression) + return recv_execute_cql_query() + end + + def send_execute_cql_query(query, compression) + send_message('execute_cql_query', Execute_cql_query_args, :query => query, :compression => compression) + end + + def recv_execute_cql_query() + result = receive_message(Execute_cql_query_result) + return result.success unless result.success.nil? + raise result.ire unless result.ire.nil? + raise result.ue unless result.ue.nil? + raise result.te unless result.te.nil? + raise result.sde unless result.sde.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'execute_cql_query failed: unknown result') + end + + end + + class Processor + include ::Thrift::Processor + + def process_login(seqid, iprot, oprot) + args = read_args(iprot, Login_args) + result = Login_result.new() + begin + @handler.login(args.auth_request) + rescue CassandraThrift::AuthenticationException => authnx + result.authnx = authnx + rescue CassandraThrift::AuthorizationException => authzx + result.authzx = authzx + end + write_result(result, oprot, 'login', seqid) + end + + def process_set_keyspace(seqid, iprot, oprot) + args = read_args(iprot, Set_keyspace_args) + result = Set_keyspace_result.new() + begin + @handler.set_keyspace(args.keyspace) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + end + write_result(result, oprot, 'set_keyspace', seqid) + end + + def process_get(seqid, iprot, oprot) + args = read_args(iprot, Get_args) + result = Get_result.new() + begin + result.success = @handler.get(args.key, args.column_path, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::NotFoundException => nfe + result.nfe = nfe + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'get', seqid) + end + + def process_get_slice(seqid, iprot, oprot) + args = read_args(iprot, Get_slice_args) + result = Get_slice_result.new() + begin + result.success = @handler.get_slice(args.key, args.column_parent, args.predicate, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'get_slice', seqid) + end + + def process_get_count(seqid, iprot, oprot) + args = read_args(iprot, Get_count_args) + result = Get_count_result.new() + begin + result.success = @handler.get_count(args.key, args.column_parent, args.predicate, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'get_count', seqid) + end + + def process_multiget_slice(seqid, iprot, oprot) + args = read_args(iprot, Multiget_slice_args) + result = Multiget_slice_result.new() + begin + result.success = @handler.multiget_slice(args.keys, args.column_parent, args.predicate, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'multiget_slice', seqid) + end + + def process_multiget_count(seqid, iprot, oprot) + args = read_args(iprot, Multiget_count_args) + result = Multiget_count_result.new() + begin + result.success = @handler.multiget_count(args.keys, args.column_parent, args.predicate, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'multiget_count', seqid) + end + + def process_get_range_slices(seqid, iprot, oprot) + args = read_args(iprot, Get_range_slices_args) + result = Get_range_slices_result.new() + begin + result.success = @handler.get_range_slices(args.column_parent, args.predicate, args.range, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'get_range_slices', seqid) + end + + def process_get_indexed_slices(seqid, iprot, oprot) + args = read_args(iprot, Get_indexed_slices_args) + result = Get_indexed_slices_result.new() + begin + result.success = @handler.get_indexed_slices(args.column_parent, args.index_clause, args.column_predicate, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'get_indexed_slices', seqid) + end + + def process_insert(seqid, iprot, oprot) + args = read_args(iprot, Insert_args) + result = Insert_result.new() + begin + @handler.insert(args.key, args.column_parent, args.column, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'insert', seqid) + end + + def process_add(seqid, iprot, oprot) + args = read_args(iprot, Add_args) + result = Add_result.new() + begin + @handler.add(args.key, args.column_parent, args.column, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'add', seqid) + end + + def process_remove(seqid, iprot, oprot) + args = read_args(iprot, Remove_args) + result = Remove_result.new() + begin + @handler.remove(args.key, args.column_path, args.timestamp, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'remove', seqid) + end + + def process_remove_counter(seqid, iprot, oprot) + args = read_args(iprot, Remove_counter_args) + result = Remove_counter_result.new() + begin + @handler.remove_counter(args.key, args.path, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'remove_counter', seqid) + end + + def process_batch_mutate(seqid, iprot, oprot) + args = read_args(iprot, Batch_mutate_args) + result = Batch_mutate_result.new() + begin + @handler.batch_mutate(args.mutation_map, args.consistency_level) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + end + write_result(result, oprot, 'batch_mutate', seqid) + end + + def process_truncate(seqid, iprot, oprot) + args = read_args(iprot, Truncate_args) + result = Truncate_result.new() + begin + @handler.truncate(args.cfname) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + end + write_result(result, oprot, 'truncate', seqid) + end + + def process_describe_schema_versions(seqid, iprot, oprot) + args = read_args(iprot, Describe_schema_versions_args) + result = Describe_schema_versions_result.new() + begin + result.success = @handler.describe_schema_versions() + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + end + write_result(result, oprot, 'describe_schema_versions', seqid) + end + + def process_describe_keyspaces(seqid, iprot, oprot) + args = read_args(iprot, Describe_keyspaces_args) + result = Describe_keyspaces_result.new() + begin + result.success = @handler.describe_keyspaces() + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + end + write_result(result, oprot, 'describe_keyspaces', seqid) + end + + def process_describe_cluster_name(seqid, iprot, oprot) + args = read_args(iprot, Describe_cluster_name_args) + result = Describe_cluster_name_result.new() + result.success = @handler.describe_cluster_name() + write_result(result, oprot, 'describe_cluster_name', seqid) + end + + def process_describe_version(seqid, iprot, oprot) + args = read_args(iprot, Describe_version_args) + result = Describe_version_result.new() + result.success = @handler.describe_version() + write_result(result, oprot, 'describe_version', seqid) + end + + def process_describe_ring(seqid, iprot, oprot) + args = read_args(iprot, Describe_ring_args) + result = Describe_ring_result.new() + begin + result.success = @handler.describe_ring(args.keyspace) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + end + write_result(result, oprot, 'describe_ring', seqid) + end + + def process_describe_partitioner(seqid, iprot, oprot) + args = read_args(iprot, Describe_partitioner_args) + result = Describe_partitioner_result.new() + result.success = @handler.describe_partitioner() + write_result(result, oprot, 'describe_partitioner', seqid) + end + + def process_describe_snitch(seqid, iprot, oprot) + args = read_args(iprot, Describe_snitch_args) + result = Describe_snitch_result.new() + result.success = @handler.describe_snitch() + write_result(result, oprot, 'describe_snitch', seqid) + end + + def process_describe_keyspace(seqid, iprot, oprot) + args = read_args(iprot, Describe_keyspace_args) + result = Describe_keyspace_result.new() + begin + result.success = @handler.describe_keyspace(args.keyspace) + rescue CassandraThrift::NotFoundException => nfe + result.nfe = nfe + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + end + write_result(result, oprot, 'describe_keyspace', seqid) + end + + def process_describe_splits(seqid, iprot, oprot) + args = read_args(iprot, Describe_splits_args) + result = Describe_splits_result.new() + begin + result.success = @handler.describe_splits(args.cfName, args.start_token, args.end_token, args.keys_per_split) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + end + write_result(result, oprot, 'describe_splits', seqid) + end + + def process_system_add_column_family(seqid, iprot, oprot) + args = read_args(iprot, System_add_column_family_args) + result = System_add_column_family_result.new() + begin + result.success = @handler.system_add_column_family(args.cf_def) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::SchemaDisagreementException => sde + result.sde = sde + end + write_result(result, oprot, 'system_add_column_family', seqid) + end + + def process_system_drop_column_family(seqid, iprot, oprot) + args = read_args(iprot, System_drop_column_family_args) + result = System_drop_column_family_result.new() + begin + result.success = @handler.system_drop_column_family(args.column_family) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::SchemaDisagreementException => sde + result.sde = sde + end + write_result(result, oprot, 'system_drop_column_family', seqid) + end + + def process_system_add_keyspace(seqid, iprot, oprot) + args = read_args(iprot, System_add_keyspace_args) + result = System_add_keyspace_result.new() + begin + result.success = @handler.system_add_keyspace(args.ks_def) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::SchemaDisagreementException => sde + result.sde = sde + end + write_result(result, oprot, 'system_add_keyspace', seqid) + end + + def process_system_drop_keyspace(seqid, iprot, oprot) + args = read_args(iprot, System_drop_keyspace_args) + result = System_drop_keyspace_result.new() + begin + result.success = @handler.system_drop_keyspace(args.keyspace) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::SchemaDisagreementException => sde + result.sde = sde + end + write_result(result, oprot, 'system_drop_keyspace', seqid) + end + + def process_system_update_keyspace(seqid, iprot, oprot) + args = read_args(iprot, System_update_keyspace_args) + result = System_update_keyspace_result.new() + begin + result.success = @handler.system_update_keyspace(args.ks_def) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::SchemaDisagreementException => sde + result.sde = sde + end + write_result(result, oprot, 'system_update_keyspace', seqid) + end + + def process_system_update_column_family(seqid, iprot, oprot) + args = read_args(iprot, System_update_column_family_args) + result = System_update_column_family_result.new() + begin + result.success = @handler.system_update_column_family(args.cf_def) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::SchemaDisagreementException => sde + result.sde = sde + end + write_result(result, oprot, 'system_update_column_family', seqid) + end + + def process_execute_cql_query(seqid, iprot, oprot) + args = read_args(iprot, Execute_cql_query_args) + result = Execute_cql_query_result.new() + begin + result.success = @handler.execute_cql_query(args.query, args.compression) + rescue CassandraThrift::InvalidRequestException => ire + result.ire = ire + rescue CassandraThrift::UnavailableException => ue + result.ue = ue + rescue CassandraThrift::TimedOutException => te + result.te = te + rescue CassandraThrift::SchemaDisagreementException => sde + result.sde = sde + end + write_result(result, oprot, 'execute_cql_query', seqid) + end + + end + + # HELPER FUNCTIONS AND STRUCTURES + + class Login_args + include ::Thrift::Struct, ::Thrift::Struct_Union + AUTH_REQUEST = 1 + + FIELDS = { + AUTH_REQUEST => {:type => ::Thrift::Types::STRUCT, :name => 'auth_request', :class => CassandraThrift::AuthenticationRequest} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field auth_request is unset!') unless @auth_request + end + + ::Thrift::Struct.generate_accessors self + end + + class Login_result + include ::Thrift::Struct, ::Thrift::Struct_Union + AUTHNX = 1 + AUTHZX = 2 + + FIELDS = { + AUTHNX => {:type => ::Thrift::Types::STRUCT, :name => 'authnx', :class => CassandraThrift::AuthenticationException}, + AUTHZX => {:type => ::Thrift::Types::STRUCT, :name => 'authzx', :class => CassandraThrift::AuthorizationException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Set_keyspace_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEYSPACE = 1 + + FIELDS = { + KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace + end + + ::Thrift::Struct.generate_accessors self + end + + class Set_keyspace_result + include ::Thrift::Struct, ::Thrift::Struct_Union + IRE = 1 + + FIELDS = { + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COLUMN_PATH = 2 + CONSISTENCY_LEVEL = 3 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_path is unset!') unless @column_path + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + NFE = 2 + UE = 3 + TE = 4 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => CassandraThrift::ColumnOrSuperColumn}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_slice_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COLUMN_PARENT = 2 + PREDICATE = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent}, + PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_slice_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_count_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COLUMN_PARENT = 2 + PREDICATE = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent}, + PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_count_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Multiget_slice_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEYS = 1 + COLUMN_PARENT = 2 + PREDICATE = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + KEYS => {:type => ::Thrift::Types::LIST, :name => 'keys', :element => {:type => ::Thrift::Types::STRING, :binary => true}}, + COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent}, + PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keys is unset!') unless @keys + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Multiget_slice_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Multiget_count_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEYS = 1 + COLUMN_PARENT = 2 + PREDICATE = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + KEYS => {:type => ::Thrift::Types::LIST, :name => 'keys', :element => {:type => ::Thrift::Types::STRING, :binary => true}}, + COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent}, + PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keys is unset!') unless @keys + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Multiget_count_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::I32}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_range_slices_args + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN_PARENT = 1 + PREDICATE = 2 + RANGE = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent}, + PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate}, + RANGE => {:type => ::Thrift::Types::STRUCT, :name => 'range', :class => CassandraThrift::KeyRange}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field range is unset!') unless @range + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_range_slices_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::KeySlice}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_indexed_slices_args + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN_PARENT = 1 + INDEX_CLAUSE = 2 + COLUMN_PREDICATE = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent}, + INDEX_CLAUSE => {:type => ::Thrift::Types::STRUCT, :name => 'index_clause', :class => CassandraThrift::IndexClause}, + COLUMN_PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'column_predicate', :class => CassandraThrift::SlicePredicate}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field index_clause is unset!') unless @index_clause + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_predicate is unset!') unless @column_predicate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_indexed_slices_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::KeySlice}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Insert_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COLUMN_PARENT = 2 + COLUMN = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent}, + COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column', :class => CassandraThrift::Column}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column is unset!') unless @column + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Insert_result + include ::Thrift::Struct, ::Thrift::Struct_Union + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Add_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COLUMN_PARENT = 2 + COLUMN = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent}, + COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column', :class => CassandraThrift::CounterColumn}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column is unset!') unless @column + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Add_result + include ::Thrift::Struct, ::Thrift::Struct_Union + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Remove_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COLUMN_PATH = 2 + TIMESTAMP = 3 + CONSISTENCY_LEVEL = 4 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath}, + TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_path is unset!') unless @column_path + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Remove_result + include ::Thrift::Struct, ::Thrift::Struct_Union + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Remove_counter_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + PATH = 2 + CONSISTENCY_LEVEL = 3 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + PATH => {:type => ::Thrift::Types::STRUCT, :name => 'path', :class => CassandraThrift::ColumnPath}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field path is unset!') unless @path + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Remove_counter_result + include ::Thrift::Struct, ::Thrift::Struct_Union + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Batch_mutate_args + include ::Thrift::Struct, ::Thrift::Struct_Union + MUTATION_MAP = 1 + CONSISTENCY_LEVEL = 2 + + FIELDS = { + MUTATION_MAP => {:type => ::Thrift::Types::MAP, :name => 'mutation_map', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::MAP, :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::Mutation}}}}, + CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field mutation_map is unset!') unless @mutation_map + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level + unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Batch_mutate_result + include ::Thrift::Struct, ::Thrift::Struct_Union + IRE = 1 + UE = 2 + TE = 3 + + FIELDS = { + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Truncate_args + include ::Thrift::Struct, ::Thrift::Struct_Union + CFNAME = 1 + + FIELDS = { + CFNAME => {:type => ::Thrift::Types::STRING, :name => 'cfname'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field cfname is unset!') unless @cfname + end + + ::Thrift::Struct.generate_accessors self + end + + class Truncate_result + include ::Thrift::Struct, ::Thrift::Struct_Union + IRE = 1 + UE = 2 + + FIELDS = { + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_schema_versions_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_schema_versions_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_keyspaces_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_keyspaces_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::KsDef}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_cluster_name_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_cluster_name_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_version_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_version_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_ring_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEYSPACE = 1 + + FIELDS = { + KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_ring_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::TokenRange}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_partitioner_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_partitioner_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_snitch_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_snitch_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_keyspace_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEYSPACE = 1 + + FIELDS = { + KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_keyspace_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + NFE = 1 + IRE = 2 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => CassandraThrift::KsDef}, + NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_splits_args + include ::Thrift::Struct, ::Thrift::Struct_Union + CFNAME = 1 + START_TOKEN = 2 + END_TOKEN = 3 + KEYS_PER_SPLIT = 4 + + FIELDS = { + CFNAME => {:type => ::Thrift::Types::STRING, :name => 'cfName'}, + START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token'}, + END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token'}, + KEYS_PER_SPLIT => {:type => ::Thrift::Types::I32, :name => 'keys_per_split'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field cfName is unset!') unless @cfName + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_token is unset!') unless @start_token + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field end_token is unset!') unless @end_token + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keys_per_split is unset!') unless @keys_per_split + end + + ::Thrift::Struct.generate_accessors self + end + + class Describe_splits_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class System_add_column_family_args + include ::Thrift::Struct, ::Thrift::Struct_Union + CF_DEF = 1 + + FIELDS = { + CF_DEF => {:type => ::Thrift::Types::STRUCT, :name => 'cf_def', :class => CassandraThrift::CfDef} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field cf_def is unset!') unless @cf_def + end + + ::Thrift::Struct.generate_accessors self + end + + class System_add_column_family_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + SDE = 2 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + SDE => {:type => ::Thrift::Types::STRUCT, :name => 'sde', :class => CassandraThrift::SchemaDisagreementException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class System_drop_column_family_args + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN_FAMILY = 1 + + FIELDS = { + COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family + end + + ::Thrift::Struct.generate_accessors self + end + + class System_drop_column_family_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + SDE = 2 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + SDE => {:type => ::Thrift::Types::STRUCT, :name => 'sde', :class => CassandraThrift::SchemaDisagreementException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class System_add_keyspace_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KS_DEF = 1 + + FIELDS = { + KS_DEF => {:type => ::Thrift::Types::STRUCT, :name => 'ks_def', :class => CassandraThrift::KsDef} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ks_def is unset!') unless @ks_def + end + + ::Thrift::Struct.generate_accessors self + end + + class System_add_keyspace_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + SDE = 2 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + SDE => {:type => ::Thrift::Types::STRUCT, :name => 'sde', :class => CassandraThrift::SchemaDisagreementException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class System_drop_keyspace_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KEYSPACE = 1 + + FIELDS = { + KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace + end + + ::Thrift::Struct.generate_accessors self + end + + class System_drop_keyspace_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + SDE = 2 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + SDE => {:type => ::Thrift::Types::STRUCT, :name => 'sde', :class => CassandraThrift::SchemaDisagreementException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class System_update_keyspace_args + include ::Thrift::Struct, ::Thrift::Struct_Union + KS_DEF = 1 + + FIELDS = { + KS_DEF => {:type => ::Thrift::Types::STRUCT, :name => 'ks_def', :class => CassandraThrift::KsDef} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ks_def is unset!') unless @ks_def + end + + ::Thrift::Struct.generate_accessors self + end + + class System_update_keyspace_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + SDE = 2 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + SDE => {:type => ::Thrift::Types::STRUCT, :name => 'sde', :class => CassandraThrift::SchemaDisagreementException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class System_update_column_family_args + include ::Thrift::Struct, ::Thrift::Struct_Union + CF_DEF = 1 + + FIELDS = { + CF_DEF => {:type => ::Thrift::Types::STRUCT, :name => 'cf_def', :class => CassandraThrift::CfDef} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field cf_def is unset!') unless @cf_def + end + + ::Thrift::Struct.generate_accessors self + end + + class System_update_column_family_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + SDE = 2 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + SDE => {:type => ::Thrift::Types::STRUCT, :name => 'sde', :class => CassandraThrift::SchemaDisagreementException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Execute_cql_query_args + include ::Thrift::Struct, ::Thrift::Struct_Union + QUERY = 1 + COMPRESSION = 2 + + FIELDS = { + QUERY => {:type => ::Thrift::Types::STRING, :name => 'query', :binary => true}, + COMPRESSION => {:type => ::Thrift::Types::I32, :name => 'compression', :enum_class => CassandraThrift::Compression} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field query is unset!') unless @query + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field compression is unset!') unless @compression + unless @compression.nil? || CassandraThrift::Compression::VALID_VALUES.include?(@compression) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field compression!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Execute_cql_query_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + IRE = 1 + UE = 2 + TE = 3 + SDE = 4 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => CassandraThrift::CqlResult}, + IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, + UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}, + TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}, + SDE => {:type => ::Thrift::Types::STRUCT, :name => 'sde', :class => CassandraThrift::SchemaDisagreementException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + end + + end diff --git a/vendor/1.0/gen-rb/cassandra_constants.rb b/vendor/1.0/gen-rb/cassandra_constants.rb new file mode 100755 index 0000000..2853be5 --- /dev/null +++ b/vendor/1.0/gen-rb/cassandra_constants.rb @@ -0,0 +1,12 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'cassandra_types' + + module CassandraThrift + VERSION = %q"19.17.0" + +end diff --git a/vendor/1.0/gen-rb/cassandra_types.rb b/vendor/1.0/gen-rb/cassandra_types.rb new file mode 100755 index 0000000..be2df64 --- /dev/null +++ b/vendor/1.0/gen-rb/cassandra_types.rb @@ -0,0 +1,857 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + + +module CassandraThrift + module ConsistencyLevel + ONE = 1 + QUORUM = 2 + LOCAL_QUORUM = 3 + EACH_QUORUM = 4 + ALL = 5 + ANY = 6 + TWO = 7 + THREE = 8 + VALUE_MAP = {1 => "ONE", 2 => "QUORUM", 3 => "LOCAL_QUORUM", 4 => "EACH_QUORUM", 5 => "ALL", 6 => "ANY", 7 => "TWO", 8 => "THREE"} + VALID_VALUES = Set.new([ONE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL, ANY, TWO, THREE]).freeze + end + + module IndexOperator + EQ = 0 + GTE = 1 + GT = 2 + LTE = 3 + LT = 4 + VALUE_MAP = {0 => "EQ", 1 => "GTE", 2 => "GT", 3 => "LTE", 4 => "LT"} + VALID_VALUES = Set.new([EQ, GTE, GT, LTE, LT]).freeze + end + + module IndexType + KEYS = 0 + CUSTOM = 1 + VALUE_MAP = {0 => "KEYS", 1 => "CUSTOM"} + VALID_VALUES = Set.new([KEYS, CUSTOM]).freeze + end + + module Compression + GZIP = 1 + NONE = 2 + VALUE_MAP = {1 => "GZIP", 2 => "NONE"} + VALID_VALUES = Set.new([GZIP, NONE]).freeze + end + + module CqlResultType + ROWS = 1 + VOID = 2 + INT = 3 + VALUE_MAP = {1 => "ROWS", 2 => "VOID", 3 => "INT"} + VALID_VALUES = Set.new([ROWS, VOID, INT]).freeze + end + + # Basic unit of data within a ColumnFamily. + # @param name, the name by which this column is set and retrieved. Maximum 64KB long. + # @param value. The data associated with the name. Maximum 2GB long, but in practice you should limit it to small numbers of MB (since Thrift must read the full value into memory to operate on it). + # @param timestamp. The timestamp is used for conflict detection/resolution when two columns with same name need to be compared. + # @param ttl. An optional, positive delay (in seconds) after which the column will be automatically deleted. + class Column + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + VALUE = 2 + TIMESTAMP = 3 + TTL = 4 + + FIELDS = { + NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true}, + VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true, :optional => true}, + TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp', :optional => true}, + TTL => {:type => ::Thrift::Types::I32, :name => 'ttl', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name + end + + ::Thrift::Struct.generate_accessors self + end + + # A named list of columns. + # @param name. see Column.name. + # @param columns. A collection of standard Columns. The columns within a super column are defined in an adhoc manner. + # Columns within a super column do not have to have matching structures (similarly named child columns). + class SuperColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + COLUMNS = 2 + + FIELDS = { + NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true}, + COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::Column}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns + end + + ::Thrift::Struct.generate_accessors self + end + + class CounterColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + VALUE = 2 + + FIELDS = { + NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true}, + VALUE => {:type => ::Thrift::Types::I64, :name => 'value'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value + end + + ::Thrift::Struct.generate_accessors self + end + + class CounterSuperColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + COLUMNS = 2 + + FIELDS = { + NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true}, + COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::CounterColumn}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns + end + + ::Thrift::Struct.generate_accessors self + end + + # Methods for fetching rows/records from Cassandra will return either a single instance of ColumnOrSuperColumn or a list + # of ColumnOrSuperColumns (get_slice()). If you're looking up a SuperColumn (or list of SuperColumns) then the resulting + # instances of ColumnOrSuperColumn will have the requested SuperColumn in the attribute super_column. For queries resulting + # in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on + # single query methods that may return either a SuperColumn or Column. + # + # If the query was on a counter column family, you will either get a counter_column (instead of a column) or a + # counter_super_column (instead of a super_column) + # + # @param column. The Column returned by get() or get_slice(). + # @param super_column. The SuperColumn returned by get() or get_slice(). + # @param counter_column. The Counterolumn returned by get() or get_slice(). + # @param counter_super_column. The CounterSuperColumn returned by get() or get_slice(). + class ColumnOrSuperColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN = 1 + SUPER_COLUMN = 2 + COUNTER_COLUMN = 3 + COUNTER_SUPER_COLUMN = 4 + + FIELDS = { + COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column', :class => CassandraThrift::Column, :optional => true}, + SUPER_COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'super_column', :class => CassandraThrift::SuperColumn, :optional => true}, + COUNTER_COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'counter_column', :class => CassandraThrift::CounterColumn, :optional => true}, + COUNTER_SUPER_COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'counter_super_column', :class => CassandraThrift::CounterSuperColumn, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # A specific column was requested that does not exist. + class NotFoundException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed. + # why contains an associated error message. + class InvalidRequestException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + def initialize(message=nil) + super() + self.why = message + end + + def message; why end + + WHY = 1 + + FIELDS = { + WHY => {:type => ::Thrift::Types::STRING, :name => 'why'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why + end + + ::Thrift::Struct.generate_accessors self + end + + # Not all the replicas required could be created and/or read. + class UnavailableException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # RPC timeout was exceeded. either a node failed mid-operation, or load was too high, or the requested op was too large. + class TimedOutException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # invalid authentication request (invalid keyspace, user does not exist, or credentials invalid) + class AuthenticationException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + def initialize(message=nil) + super() + self.why = message + end + + def message; why end + + WHY = 1 + + FIELDS = { + WHY => {:type => ::Thrift::Types::STRING, :name => 'why'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why + end + + ::Thrift::Struct.generate_accessors self + end + + # invalid authorization request (user does not have access to keyspace) + class AuthorizationException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + def initialize(message=nil) + super() + self.why = message + end + + def message; why end + + WHY = 1 + + FIELDS = { + WHY => {:type => ::Thrift::Types::STRING, :name => 'why'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why + end + + ::Thrift::Struct.generate_accessors self + end + + # schemas are not in agreement across all nodes + class SchemaDisagreementException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine + # ColumnParent as ColumnPath + '/../'. + # + # See also ColumnPath + class ColumnParent + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN_FAMILY = 3 + SUPER_COLUMN = 4 + + FIELDS = { + COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'}, + SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family + end + + ::Thrift::Struct.generate_accessors self + end + + # The ColumnPath is the path to a single column in Cassandra. It might make sense to think of ColumnPath and + # ColumnParent in terms of a directory structure. + # + # ColumnPath is used to looking up a single column. + # + # @param column_family. The name of the CF of the column being looked up. + # @param super_column. The super column name. + # @param column. The column name. + class ColumnPath + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN_FAMILY = 3 + SUPER_COLUMN = 4 + COLUMN = 5 + + FIELDS = { + COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'}, + SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true}, + COLUMN => {:type => ::Thrift::Types::STRING, :name => 'column', :binary => true, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family + end + + ::Thrift::Struct.generate_accessors self + end + + # A slice range is a structure that stores basic range, ordering and limit information for a query that will return + # multiple columns. It could be thought of as Cassandra's version of LIMIT and ORDER BY + # + # @param start. The column name to start the slice with. This attribute is not required, though there is no default value, + # and can be safely set to '', i.e., an empty byte array, to start with the first column name. Otherwise, it + # must a valid value under the rules of the Comparator defined for the given ColumnFamily. + # @param finish. The column name to stop the slice at. This attribute is not required, though there is no default value, + # and can be safely set to an empty byte array to not stop until 'count' results are seen. Otherwise, it + # must also be a valid value to the ColumnFamily Comparator. + # @param reversed. Whether the results should be ordered in reversed order. Similar to ORDER BY blah DESC in SQL. + # @param count. How many columns to return. Similar to LIMIT in SQL. May be arbitrarily large, but Thrift will + # materialize the whole result into memory before returning it to the client, so be aware that you may + # be better served by iterating through slices by passing the last value of one call in as the 'start' + # of the next instead of increasing 'count' arbitrarily large. + class SliceRange + include ::Thrift::Struct, ::Thrift::Struct_Union + START = 1 + FINISH = 2 + REVERSED = 3 + COUNT = 4 + + FIELDS = { + START => {:type => ::Thrift::Types::STRING, :name => 'start', :binary => true}, + FINISH => {:type => ::Thrift::Types::STRING, :name => 'finish', :binary => true}, + REVERSED => {:type => ::Thrift::Types::BOOL, :name => 'reversed', :default => false}, + COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start is unset!') unless @start + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field finish is unset!') unless @finish + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field reversed is unset!') if @reversed.nil? + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count + end + + ::Thrift::Struct.generate_accessors self + end + + # A SlicePredicate is similar to a mathematic predicate (see http://en.wikipedia.org/wiki/Predicate_(mathematical_logic)), + # which is described as "a property that the elements of a set have in common." + # + # SlicePredicate's in Cassandra are described with either a list of column_names or a SliceRange. If column_names is + # specified, slice_range is ignored. + # + # @param column_name. A list of column names to retrieve. This can be used similar to Memcached's "multi-get" feature + # to fetch N known column names. For instance, if you know you wish to fetch columns 'Joe', 'Jack', + # and 'Jim' you can pass those column names as a list to fetch all three at once. + # @param slice_range. A SliceRange describing how to range, order, and/or limit the slice. + class SlicePredicate + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN_NAMES = 1 + SLICE_RANGE = 2 + + FIELDS = { + COLUMN_NAMES => {:type => ::Thrift::Types::LIST, :name => 'column_names', :element => {:type => ::Thrift::Types::STRING, :binary => true}, :optional => true}, + SLICE_RANGE => {:type => ::Thrift::Types::STRUCT, :name => 'slice_range', :class => CassandraThrift::SliceRange, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class IndexExpression + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN_NAME = 1 + OP = 2 + VALUE = 3 + + FIELDS = { + COLUMN_NAME => {:type => ::Thrift::Types::STRING, :name => 'column_name', :binary => true}, + OP => {:type => ::Thrift::Types::I32, :name => 'op', :enum_class => CassandraThrift::IndexOperator}, + VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_name is unset!') unless @column_name + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field op is unset!') unless @op + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value + unless @op.nil? || CassandraThrift::IndexOperator::VALID_VALUES.include?(@op) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class IndexClause + include ::Thrift::Struct, ::Thrift::Struct_Union + EXPRESSIONS = 1 + START_KEY = 2 + COUNT = 3 + + FIELDS = { + EXPRESSIONS => {:type => ::Thrift::Types::LIST, :name => 'expressions', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::IndexExpression}}, + START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :binary => true}, + COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field expressions is unset!') unless @expressions + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_key is unset!') unless @start_key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count + end + + ::Thrift::Struct.generate_accessors self + end + + # The semantics of start keys and tokens are slightly different. + # Keys are start-inclusive; tokens are start-exclusive. Token + # ranges may also wrap -- that is, the end token may be less + # than the start one. Thus, a range from keyX to keyX is a + # one-element range, but a range from tokenY to tokenY is the + # full ring. + class KeyRange + include ::Thrift::Struct, ::Thrift::Struct_Union + START_KEY = 1 + END_KEY = 2 + START_TOKEN = 3 + END_TOKEN = 4 + COUNT = 5 + + FIELDS = { + START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :binary => true, :optional => true}, + END_KEY => {:type => ::Thrift::Types::STRING, :name => 'end_key', :binary => true, :optional => true}, + START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token', :optional => true}, + END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token', :optional => true}, + COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count + end + + ::Thrift::Struct.generate_accessors self + end + + # A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation. + # + # @param key. a row key + # @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by + # a SlicePredicate. + class KeySlice + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COLUMNS = 2 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns + end + + ::Thrift::Struct.generate_accessors self + end + + class KeyCount + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COUNT = 2 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COUNT => {:type => ::Thrift::Types::I32, :name => 'count'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count + end + + ::Thrift::Struct.generate_accessors self + end + + # Note that the timestamp is only optional in case of counter deletion. + class Deletion + include ::Thrift::Struct, ::Thrift::Struct_Union + TIMESTAMP = 1 + SUPER_COLUMN = 2 + PREDICATE = 3 + + FIELDS = { + TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp', :optional => true}, + SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true}, + PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # A Mutation is either an insert (represented by filling column_or_supercolumn) or a deletion (represented by filling the deletion attribute). + # @param column_or_supercolumn. An insert to a column or supercolumn (possibly counter column or supercolumn) + # @param deletion. A deletion of a column or supercolumn + class Mutation + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMN_OR_SUPERCOLUMN = 1 + DELETION = 2 + + FIELDS = { + COLUMN_OR_SUPERCOLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column_or_supercolumn', :class => CassandraThrift::ColumnOrSuperColumn, :optional => true}, + DELETION => {:type => ::Thrift::Types::STRUCT, :name => 'deletion', :class => CassandraThrift::Deletion, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # A TokenRange describes part of the Cassandra ring, it is a mapping from a range to + # endpoints responsible for that range. + # @param start_token The first token in the range + # @param end_token The last token in the range + # @param endpoints The endpoints responsible for the range (listed by their configured listen_address) + # @param rpc_endpoints The endpoints responsible for the range (listed by their configured rpc_address) + class TokenRange + include ::Thrift::Struct, ::Thrift::Struct_Union + START_TOKEN = 1 + END_TOKEN = 2 + ENDPOINTS = 3 + RPC_ENDPOINTS = 4 + + FIELDS = { + START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token'}, + END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token'}, + ENDPOINTS => {:type => ::Thrift::Types::LIST, :name => 'endpoints', :element => {:type => ::Thrift::Types::STRING}}, + RPC_ENDPOINTS => {:type => ::Thrift::Types::LIST, :name => 'rpc_endpoints', :element => {:type => ::Thrift::Types::STRING}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_token is unset!') unless @start_token + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field end_token is unset!') unless @end_token + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field endpoints is unset!') unless @endpoints + end + + ::Thrift::Struct.generate_accessors self + end + + # Authentication requests can contain any data, dependent on the IAuthenticator used + class AuthenticationRequest + include ::Thrift::Struct, ::Thrift::Struct_Union + CREDENTIALS = 1 + + FIELDS = { + CREDENTIALS => {:type => ::Thrift::Types::MAP, :name => 'credentials', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field credentials is unset!') unless @credentials + end + + ::Thrift::Struct.generate_accessors self + end + + class ColumnDef + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + VALIDATION_CLASS = 2 + INDEX_TYPE = 3 + INDEX_NAME = 4 + INDEX_OPTIONS = 5 + + FIELDS = { + NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true}, + VALIDATION_CLASS => {:type => ::Thrift::Types::STRING, :name => 'validation_class'}, + INDEX_TYPE => {:type => ::Thrift::Types::I32, :name => 'index_type', :optional => true, :enum_class => CassandraThrift::IndexType}, + INDEX_NAME => {:type => ::Thrift::Types::STRING, :name => 'index_name', :optional => true}, + INDEX_OPTIONS => {:type => ::Thrift::Types::MAP, :name => 'index_options', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field validation_class is unset!') unless @validation_class + unless @index_type.nil? || CassandraThrift::IndexType::VALID_VALUES.include?(@index_type) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field index_type!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class CfDef + include ::Thrift::Struct, ::Thrift::Struct_Union + KEYSPACE = 1 + NAME = 2 + COLUMN_TYPE = 3 + COMPARATOR_TYPE = 5 + SUBCOMPARATOR_TYPE = 6 + COMMENT = 8 + ROW_CACHE_SIZE = 9 + KEY_CACHE_SIZE = 11 + READ_REPAIR_CHANCE = 12 + COLUMN_METADATA = 13 + GC_GRACE_SECONDS = 14 + DEFAULT_VALIDATION_CLASS = 15 + ID = 16 + MIN_COMPACTION_THRESHOLD = 17 + MAX_COMPACTION_THRESHOLD = 18 + ROW_CACHE_SAVE_PERIOD_IN_SECONDS = 19 + KEY_CACHE_SAVE_PERIOD_IN_SECONDS = 20 + REPLICATE_ON_WRITE = 24 + MERGE_SHARDS_CHANCE = 25 + KEY_VALIDATION_CLASS = 26 + ROW_CACHE_PROVIDER = 27 + KEY_ALIAS = 28 + COMPACTION_STRATEGY = 29 + COMPACTION_STRATEGY_OPTIONS = 30 + ROW_CACHE_KEYS_TO_SAVE = 31 + COMPRESSION_OPTIONS = 32 + + FIELDS = { + KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'}, + NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, + COLUMN_TYPE => {:type => ::Thrift::Types::STRING, :name => 'column_type', :default => %q"Standard", :optional => true}, + COMPARATOR_TYPE => {:type => ::Thrift::Types::STRING, :name => 'comparator_type', :default => %q"BytesType", :optional => true}, + SUBCOMPARATOR_TYPE => {:type => ::Thrift::Types::STRING, :name => 'subcomparator_type', :optional => true}, + COMMENT => {:type => ::Thrift::Types::STRING, :name => 'comment', :optional => true}, + ROW_CACHE_SIZE => {:type => ::Thrift::Types::DOUBLE, :name => 'row_cache_size', :default => 0, :optional => true}, + KEY_CACHE_SIZE => {:type => ::Thrift::Types::DOUBLE, :name => 'key_cache_size', :default => 200000, :optional => true}, + READ_REPAIR_CHANCE => {:type => ::Thrift::Types::DOUBLE, :name => 'read_repair_chance', :default => 1, :optional => true}, + COLUMN_METADATA => {:type => ::Thrift::Types::LIST, :name => 'column_metadata', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnDef}, :optional => true}, + GC_GRACE_SECONDS => {:type => ::Thrift::Types::I32, :name => 'gc_grace_seconds', :optional => true}, + DEFAULT_VALIDATION_CLASS => {:type => ::Thrift::Types::STRING, :name => 'default_validation_class', :optional => true}, + ID => {:type => ::Thrift::Types::I32, :name => 'id', :optional => true}, + MIN_COMPACTION_THRESHOLD => {:type => ::Thrift::Types::I32, :name => 'min_compaction_threshold', :optional => true}, + MAX_COMPACTION_THRESHOLD => {:type => ::Thrift::Types::I32, :name => 'max_compaction_threshold', :optional => true}, + ROW_CACHE_SAVE_PERIOD_IN_SECONDS => {:type => ::Thrift::Types::I32, :name => 'row_cache_save_period_in_seconds', :optional => true}, + KEY_CACHE_SAVE_PERIOD_IN_SECONDS => {:type => ::Thrift::Types::I32, :name => 'key_cache_save_period_in_seconds', :optional => true}, + REPLICATE_ON_WRITE => {:type => ::Thrift::Types::BOOL, :name => 'replicate_on_write', :optional => true}, + MERGE_SHARDS_CHANCE => {:type => ::Thrift::Types::DOUBLE, :name => 'merge_shards_chance', :optional => true}, + KEY_VALIDATION_CLASS => {:type => ::Thrift::Types::STRING, :name => 'key_validation_class', :optional => true}, + ROW_CACHE_PROVIDER => {:type => ::Thrift::Types::STRING, :name => 'row_cache_provider', :optional => true}, + KEY_ALIAS => {:type => ::Thrift::Types::STRING, :name => 'key_alias', :binary => true, :optional => true}, + COMPACTION_STRATEGY => {:type => ::Thrift::Types::STRING, :name => 'compaction_strategy', :optional => true}, + COMPACTION_STRATEGY_OPTIONS => {:type => ::Thrift::Types::MAP, :name => 'compaction_strategy_options', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}, + ROW_CACHE_KEYS_TO_SAVE => {:type => ::Thrift::Types::I32, :name => 'row_cache_keys_to_save', :optional => true}, + COMPRESSION_OPTIONS => {:type => ::Thrift::Types::MAP, :name => 'compression_options', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name + end + + ::Thrift::Struct.generate_accessors self + end + + class KsDef + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + STRATEGY_CLASS = 2 + STRATEGY_OPTIONS = 3 + REPLICATION_FACTOR = 4 + CF_DEFS = 5 + DURABLE_WRITES = 6 + + FIELDS = { + NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, + STRATEGY_CLASS => {:type => ::Thrift::Types::STRING, :name => 'strategy_class'}, + STRATEGY_OPTIONS => {:type => ::Thrift::Types::MAP, :name => 'strategy_options', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}, + # @deprecated + REPLICATION_FACTOR => {:type => ::Thrift::Types::I32, :name => 'replication_factor', :optional => true}, + CF_DEFS => {:type => ::Thrift::Types::LIST, :name => 'cf_defs', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::CfDef}}, + DURABLE_WRITES => {:type => ::Thrift::Types::BOOL, :name => 'durable_writes', :default => true, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field strategy_class is unset!') unless @strategy_class + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field cf_defs is unset!') unless @cf_defs + end + + ::Thrift::Struct.generate_accessors self + end + + # Row returned from a CQL query + class CqlRow + include ::Thrift::Struct, ::Thrift::Struct_Union + KEY = 1 + COLUMNS = 2 + + FIELDS = { + KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true}, + COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::Column}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns + end + + ::Thrift::Struct.generate_accessors self + end + + class CqlMetadata + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME_TYPES = 1 + VALUE_TYPES = 2 + DEFAULT_NAME_TYPE = 3 + DEFAULT_VALUE_TYPE = 4 + + FIELDS = { + NAME_TYPES => {:type => ::Thrift::Types::MAP, :name => 'name_types', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::STRING}}, + VALUE_TYPES => {:type => ::Thrift::Types::MAP, :name => 'value_types', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::STRING}}, + DEFAULT_NAME_TYPE => {:type => ::Thrift::Types::STRING, :name => 'default_name_type'}, + DEFAULT_VALUE_TYPE => {:type => ::Thrift::Types::STRING, :name => 'default_value_type'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name_types is unset!') unless @name_types + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value_types is unset!') unless @value_types + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field default_name_type is unset!') unless @default_name_type + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field default_value_type is unset!') unless @default_value_type + end + + ::Thrift::Struct.generate_accessors self + end + + class CqlResult + include ::Thrift::Struct, ::Thrift::Struct_Union + TYPE = 1 + ROWS = 2 + NUM = 3 + SCHEMA = 4 + + FIELDS = { + TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => CassandraThrift::CqlResultType}, + ROWS => {:type => ::Thrift::Types::LIST, :name => 'rows', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::CqlRow}, :optional => true}, + NUM => {:type => ::Thrift::Types::I32, :name => 'num', :optional => true}, + SCHEMA => {:type => ::Thrift::Types::STRUCT, :name => 'schema', :class => CassandraThrift::CqlMetadata, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type + unless @type.nil? || CassandraThrift::CqlResultType::VALID_VALUES.include?(@type) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + end