Permalink
Browse files

* fixed inconsistencies of previous refactoring.

  • Loading branch information...
1 parent 5a417b7 commit 6f73f43a413cd378711862fe9c3fe416408c27eb Filipe Gonçalves committed Dec 10, 2012
Showing with 7 additions and 8 deletions.
  1. +1 −1 README
  2. +2 −3 lib/Cassandra/LazyQuery.pm
  3. +4 −4 lib/Cassandra/Simple.pm
View
2 README
@@ -86,7 +86,7 @@ SYNOPSYS
get_indexed_slices
Arguments:
- column_family, expression_list, start_key, row_count, columns,
+ column_family, expression_list, start, row_count, columns,
column_start, column_finish, column_reversed, column_count,
consistency_level
@@ -5,7 +5,7 @@ use warnings;
use Data::Dumper;
-my @row_level_queries = qw/get_range get_indexes_slices/;
+my @row_level_queries = qw/get_range get_indexed_slices/;
my @column_level_queries = qw/get/;
sub new {
@@ -18,15 +18,14 @@ sub new {
};
if( grep { /$method/ } @row_level_queries ){
$self->{pivot_field} = 'start';
- $self->{pivot_value} = $self->{args}->{start};
$self->{limit} = 'row_count';
} elsif( grep { /$method/ } @column_level_queries ){
$self->{pivot_field} = 'column_start';
- $self->{pivot_value} = $self->{args}->{column_start};
$self->{limit} = 'column_count';
} else {
die "Lazy query can only be used with the following methods: ".join(', ',@column_level_queries,@row_level_queries).".";
}
+ $self->{pivot_value} = $self->{args}->{$self->{pivot_field}};
bless( $self, $class );
return $self;
}
View
@@ -196,7 +196,7 @@ sub _run_query {
return $result;
} catch {
switch (ref($_)){
- case [ 'TSocket', 'Cassandra::UnavailableException', 'Cassandra::TimedOutException', 'SchemaDisagreementException' ]
+ case [ 'Thrift::TException', 'Cassandra::UnavailableException', 'Cassandra::TimedOutException', 'SchemaDisagreementException' ]
{
$self->pool->fail($cl);
# print 'Temporary failure ('.ref($_).'):'.$_->{why}."\n";
@@ -511,7 +511,7 @@ Arguments:
=over 2
-column_family, expression_list, start_key, row_count, columns, column_start, column_finish, column_reversed, column_count, consistency_level
+column_family, expression_list, start, row_count, columns, column_start, column_finish, column_reversed, column_count, consistency_level
=back
@@ -549,7 +549,7 @@ sub get_indexed_slices {
Cassandra::IndexClause->new(
{
expressions => \@index_expr,
- start_key => $arguments->{start_key} // '',
+ start_key => $arguments->{start} // '',
count => $arguments->{row_count} // 100,
}
);
@@ -1154,7 +1154,7 @@ sub create_index {
}
);
$newmetadata->{$col}->{index_type} = 0;
- $newmetadata->{$col}->{index_name} = $col . "_idx";
+ $newmetadata->{$col}->{index_name} = join($arguments->{column_family}, $col, "idx");
}
$cfdef->{column_metadata} = [ values %$newmetadata ];

0 comments on commit 6f73f43

Please sign in to comment.