Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean trailing whitespace

  • Loading branch information...
commit 832d74383975eb61f867f09e10e5ecfa91de9113 1 parent 4d9892e
@mcmire authored
Showing with 21 additions and 21 deletions.
  1. +21 −21 lib/cassandra/cassandra.rb
View
42 lib/cassandra/cassandra.rb
@@ -3,7 +3,7 @@
Create a new Cassandra client instance. Accepts a keyspace name, and optional host and port.
client = Cassandra.new('twitter', '127.0.0.1:9160')
-
+
If the server requires authentication, you must authenticate before make calls
client.login!('username','password')
@@ -466,7 +466,7 @@ def insert(column_family, key, hash, options = {})
##
# This method is used to delete (actually marking them as deleted with a
- # tombstone) rows, columns, or super columns depending on the parameters
+ # tombstone) rows, columns, or super columns depending on the parameters
# passed. If only a key is passed the entire row will be marked as deleted.
# If a column name is passed in that column will be deleted.
#
@@ -487,14 +487,14 @@ def remove(column_family, key, *columns_and_options)
column_family, column, sub_column, options = extract_and_validate_params(column_family, key, columns_and_options, WRITE_DEFAULTS)
if @batch
- mutation_map =
+ mutation_map =
{
key => {
column_family => [ _delete_mutation(column_family, column, sub_column, options[:timestamp]|| Time.stamp) ]
}
}
@batch << [mutation_map, options[:consistency]]
- else
+ else
# Let's continue using the 'remove' thrift method...not sure about the implications/performance of using the mutate instead
# Otherwise we coul get use the mutation_map above, and do _mutate(mutation_map, options[:consistency])
args = {:column_family => column_family}
@@ -518,8 +518,8 @@ def remove(column_family, key, *columns_and_options)
# * :consistency - Uses the default read consistency if none specified.
#
def count_columns(column_family, key, *columns_and_options)
- column_family, super_column, _, options =
- extract_and_validate_params(column_family, key, columns_and_options, READ_DEFAULTS)
+ column_family, super_column, _, options =
+ extract_and_validate_params(column_family, key, columns_and_options, READ_DEFAULTS)
_count_columns(column_family, key, super_column, options[:start], options[:stop], options[:count], options[:consistency])
end
@@ -542,7 +542,7 @@ def multi_count_columns(column_family, keys, *options)
end
##
- # Return a hash of column value pairs for the path you request.
+ # Return a hash of column value pairs for the path you request.
#
# * column_family - The column_family that you are inserting into.
# * key - The row key to insert.
@@ -552,8 +552,8 @@ def multi_count_columns(column_family, keys, *options)
# * :consistency - Uses the default read consistency if none specified.
#
def get_columns(column_family, key, *columns_and_options)
- column_family, columns, sub_columns, options =
- extract_and_validate_params(column_family, key, columns_and_options, READ_DEFAULTS)
+ column_family, columns, sub_columns, options =
+ extract_and_validate_params(column_family, key, columns_and_options, READ_DEFAULTS)
_get_columns(column_family, key, columns, sub_columns, options[:consistency])
end
@@ -578,7 +578,7 @@ def multi_get_columns(column_family, keys, *options)
##
# Return a hash (actually, a Cassandra::OrderedHash) or a single value
# representing the element at the column_family:key:[column]:[sub_column]
- # path you request.
+ # path you request.
#
# * column_family - The column_family that you are inserting into.
# * key - The row key to insert.
@@ -617,7 +617,7 @@ def get(column_family, key, *columns_and_options)
# * :consistency - Uses the default read consistency if none specified.
#
def multi_get(column_family, keys, *columns_and_options)
- column_family, column, sub_column, options =
+ column_family, column, sub_column, options =
extract_and_validate_params(column_family, keys, columns_and_options, READ_DEFAULTS)
hash = _multiget(column_family, keys, column, sub_column, options[:count], options[:start], options[:finish], options[:reversed], options[:consistency])
@@ -646,7 +646,7 @@ def multi_get(column_family, keys, *columns_and_options)
# * :consistency - Uses the default read consistency if none specified.
#
def exists?(column_family, key, *columns_and_options)
- column_family, column, sub_column, options =
+ column_family, column, sub_column, options =
extract_and_validate_params(column_family, key, columns_and_options, READ_DEFAULTS)
result = if column
_multiget(column_family, [key], column, sub_column, 1, '', '', false, options[:consistency])[key]
@@ -667,7 +667,7 @@ def exists?(column_family, key, *columns_and_options)
# Cassandra#get_range_single will be used.
#
# The start_key and finish_key parameters are only useful for iterating of all records
- # as is done in the Cassandra#each and Cassandra#each_key methods if you are using the
+ # as is done in the Cassandra#each and Cassandra#each_key methods if you are using the
# RandomPartitioner.
#
# If the table is partitioned with OrderPreservingPartitioner you may
@@ -678,11 +678,11 @@ def exists?(column_family, key, *columns_and_options)
# each record returned.
#
# Please note that Cassandra returns a row for each row that has existed in the
- # system since gc_grace_seconds. This is because deleted row keys are marked as
+ # system since gc_grace_seconds. This is because deleted row keys are marked as
# deleted, but left in the system until the cluster has had resonable time to replicate the deletion.
# This function attempts to suppress deleted rows (actually any row returned without
# columns is suppressed).
- #
+ #
# Please note that when enabling the :reversed option, :start and :finish should be swapped (e.g.
# reversal happens before selecting the range).
#
@@ -716,8 +716,8 @@ def get_range(column_family, options = {}, &blk)
def get_range_single(column_family, options = {})
return_empty_rows = options.delete(:return_empty_rows) || false
- column_family, _, _, options =
- extract_and_validate_params(column_family, "", [options],
+ column_family, _, _, options =
+ extract_and_validate_params(column_family, "", [options],
READ_DEFAULTS.merge(:start_key => '',
:finish_key => '',
:key_count => 100,
@@ -851,10 +851,10 @@ def batch(options = {})
@batch = []
yield(self)
compacted_map,seen_clevels = compact_mutations!
- clevel = if options[:consistency] != nil # Override any clevel from individual mutations if
+ clevel = if options[:consistency] != nil # Override any clevel from individual mutations if
options[:consistency]
elsif seen_clevels.length > 1 # Cannot choose which CLevel to use if there are several ones
- raise "Multiple consistency levels used in the batch, and no override...cannot pick one"
+ raise "Multiple consistency levels used in the batch, and no override...cannot pick one"
else # if no consistency override has been provided but all the clevels in the batch are the same: use that one
seen_clevels.first
end
@@ -1009,13 +1009,13 @@ def compact_mutations!
@batch.each do |mutation_op|
# A single mutation op looks like:
# For an insert/update
- #[ { key1 =>
+ #[ { key1 =>
# { CF1 => [several of CassThrift:Mutation(colname,value,TS,ttl)]
# CF2 => [several mutations]
# },
# key2 => {...} # Not sure if they can come batched like this...so there might only be a single key (and CF)
# }, # [0]
- # consistency # [1]
+ # consistency # [1]
#]
mmap = mutation_op[0] # :remove OR a hash like {"key"=> {"CF"=>[mutationclass1,...] } }
used_clevels[mutation_op[1]] = true #save the clevel required for this operation
Please sign in to comment.
Something went wrong with that request. Please try again.