cassandra-driver 3.0.3 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +46 -31
- data/lib/cassandra.rb +35 -44
- data/lib/cassandra/cluster.rb +40 -11
- data/lib/cassandra/cluster/client.rb +193 -159
- data/lib/cassandra/cluster/connector.rb +12 -10
- data/lib/cassandra/cluster/control_connection.rb +38 -10
- data/lib/cassandra/cluster/options.rb +8 -4
- data/lib/cassandra/cluster/registry.rb +1 -2
- data/lib/cassandra/cluster/schema/fetchers.rb +122 -26
- data/lib/cassandra/column_container.rb +9 -4
- data/lib/cassandra/custom_data.rb +24 -22
- data/lib/cassandra/driver.rb +30 -13
- data/lib/cassandra/errors.rb +12 -2
- data/lib/cassandra/execution/options.rb +52 -16
- data/lib/cassandra/execution/profile.rb +150 -0
- data/lib/cassandra/execution/profile_manager.rb +71 -0
- data/lib/cassandra/execution/trace.rb +5 -4
- data/lib/cassandra/executors.rb +1 -1
- data/lib/cassandra/index.rb +1 -1
- data/lib/cassandra/keyspace.rb +36 -1
- data/lib/cassandra/protocol.rb +5 -0
- data/lib/cassandra/protocol/coder.rb +2 -1
- data/lib/cassandra/protocol/cql_byte_buffer.rb +21 -0
- data/lib/cassandra/protocol/responses/read_failure_error_response.rb +10 -4
- data/lib/cassandra/protocol/responses/write_failure_error_response.rb +14 -8
- data/lib/cassandra/protocol/v3.rb +2 -1
- data/lib/cassandra/protocol/v4.rb +58 -20
- data/lib/cassandra/result.rb +1 -1
- data/lib/cassandra/session.rb +43 -16
- data/lib/cassandra/statements/bound.rb +5 -1
- data/lib/cassandra/statements/prepared.rb +8 -3
- data/lib/cassandra/table.rb +72 -0
- data/lib/cassandra/trigger.rb +67 -0
- data/lib/cassandra/types.rb +12 -24
- data/lib/cassandra/udt.rb +3 -6
- data/lib/cassandra/uuid/generator.rb +6 -3
- data/lib/cassandra/version.rb +1 -1
- metadata +5 -2
@@ -49,9 +49,10 @@ module Cassandra
|
|
49
49
|
clock = ::Time)
|
50
50
|
raise ::ArgumentError, 'invalid clock' unless clock.respond_to?(:now)
|
51
51
|
|
52
|
-
@node_id
|
53
|
-
@clock_id
|
54
|
-
@clock
|
52
|
+
@node_id = Integer(node_id)
|
53
|
+
@clock_id = Integer(clock_id)
|
54
|
+
@clock = clock
|
55
|
+
@last_usecs = nil
|
55
56
|
end
|
56
57
|
|
57
58
|
# Returns a new UUID with a time component that is the current time.
|
@@ -82,6 +83,7 @@ module Cassandra
|
|
82
83
|
def now
|
83
84
|
now = @clock.now
|
84
85
|
usecs = now.to_i * 1_000_000 + now.usec
|
86
|
+
|
85
87
|
if @last_usecs && @last_usecs - @sequence <= usecs && usecs <= @last_usecs
|
86
88
|
@sequence += 1
|
87
89
|
elsif @last_usecs && @last_usecs > usecs
|
@@ -90,6 +92,7 @@ module Cassandra
|
|
90
92
|
else
|
91
93
|
@sequence = 0
|
92
94
|
end
|
95
|
+
|
93
96
|
@last_usecs = usecs + @sequence
|
94
97
|
from_usecs(@last_usecs)
|
95
98
|
end
|
data/lib/cassandra/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cassandra-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Hultberg
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ione
|
@@ -112,6 +112,8 @@ files:
|
|
112
112
|
- lib/cassandra/errors.rb
|
113
113
|
- lib/cassandra/execution/info.rb
|
114
114
|
- lib/cassandra/execution/options.rb
|
115
|
+
- lib/cassandra/execution/profile.rb
|
116
|
+
- lib/cassandra/execution/profile_manager.rb
|
115
117
|
- lib/cassandra/execution/trace.rb
|
116
118
|
- lib/cassandra/executors.rb
|
117
119
|
- lib/cassandra/function.rb
|
@@ -197,6 +199,7 @@ files:
|
|
197
199
|
- lib/cassandra/timestamp_generator.rb
|
198
200
|
- lib/cassandra/timestamp_generator/simple.rb
|
199
201
|
- lib/cassandra/timestamp_generator/ticking_on_duplicate.rb
|
202
|
+
- lib/cassandra/trigger.rb
|
200
203
|
- lib/cassandra/tuple.rb
|
201
204
|
- lib/cassandra/types.rb
|
202
205
|
- lib/cassandra/udt.rb
|