Skip to content

Commit

Permalink
Insertions timestamp is now in microseconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Gonçalves committed Feb 1, 2012
1 parent 5e281bb commit 5d39b53
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/Cassandra/Simple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ use Cassandra::Cassandra;
use Cassandra::Pool;
use strict;
use warnings;
use Time::HiRes qw/gettimeofday/;
### Thrift Protocol/Client methods ###

sub _build_pool {
Expand Down Expand Up @@ -304,7 +305,6 @@ sub multiget {
my $level = $self->_consistency_level_read($opt);

my $cl = $self->pool->get();
my $t0 = time;
my $result =
eval { $cl->multiget_slice( $keys, $columnParent, $predicate, $level ) };

Expand Down Expand Up @@ -635,7 +635,6 @@ sub insert {
my $columnParent =
Cassandra::ColumnParent->new( { column_family => $column_family } );
my $level = $self->_consistency_level_write($opt);

my @mutations = map {
new Cassandra::Mutation(
{
Expand All @@ -647,7 +646,7 @@ sub insert {
{
name => $_,
value => $columns->{$_},
timestamp => $opt->{timestamp} // time,
timestamp => $opt->{timestamp} // int (gettimeofday * 1000),
ttl => $opt->{ttl} // undef,
}
)
Expand Down Expand Up @@ -711,7 +710,7 @@ sub insert_super {
name => $_,
value => $columns->{$arg}->{$_},
timestamp => $opt->{timestamp}
// time,
// int (gettimeofday * 1000),
ttl => $opt->{ttl} // undef,
}
)
Expand Down Expand Up @@ -778,7 +777,7 @@ sub batch_insert {
{
name => $_,
value => $columns->{$_},
timestamp => $opt->{timestamp} // time,
timestamp => $opt->{timestamp} // int (gettimeofday * 1000),
ttl => $opt->{ttl} // undef,
}
)
Expand Down

0 comments on commit 5d39b53

Please sign in to comment.