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.
Files changed (39) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +46 -31
  3. data/lib/cassandra.rb +35 -44
  4. data/lib/cassandra/cluster.rb +40 -11
  5. data/lib/cassandra/cluster/client.rb +193 -159
  6. data/lib/cassandra/cluster/connector.rb +12 -10
  7. data/lib/cassandra/cluster/control_connection.rb +38 -10
  8. data/lib/cassandra/cluster/options.rb +8 -4
  9. data/lib/cassandra/cluster/registry.rb +1 -2
  10. data/lib/cassandra/cluster/schema/fetchers.rb +122 -26
  11. data/lib/cassandra/column_container.rb +9 -4
  12. data/lib/cassandra/custom_data.rb +24 -22
  13. data/lib/cassandra/driver.rb +30 -13
  14. data/lib/cassandra/errors.rb +12 -2
  15. data/lib/cassandra/execution/options.rb +52 -16
  16. data/lib/cassandra/execution/profile.rb +150 -0
  17. data/lib/cassandra/execution/profile_manager.rb +71 -0
  18. data/lib/cassandra/execution/trace.rb +5 -4
  19. data/lib/cassandra/executors.rb +1 -1
  20. data/lib/cassandra/index.rb +1 -1
  21. data/lib/cassandra/keyspace.rb +36 -1
  22. data/lib/cassandra/protocol.rb +5 -0
  23. data/lib/cassandra/protocol/coder.rb +2 -1
  24. data/lib/cassandra/protocol/cql_byte_buffer.rb +21 -0
  25. data/lib/cassandra/protocol/responses/read_failure_error_response.rb +10 -4
  26. data/lib/cassandra/protocol/responses/write_failure_error_response.rb +14 -8
  27. data/lib/cassandra/protocol/v3.rb +2 -1
  28. data/lib/cassandra/protocol/v4.rb +58 -20
  29. data/lib/cassandra/result.rb +1 -1
  30. data/lib/cassandra/session.rb +43 -16
  31. data/lib/cassandra/statements/bound.rb +5 -1
  32. data/lib/cassandra/statements/prepared.rb +8 -3
  33. data/lib/cassandra/table.rb +72 -0
  34. data/lib/cassandra/trigger.rb +67 -0
  35. data/lib/cassandra/types.rb +12 -24
  36. data/lib/cassandra/udt.rb +3 -6
  37. data/lib/cassandra/uuid/generator.rb +6 -3
  38. data/lib/cassandra/version.rb +1 -1
  39. 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 = Integer(node_id)
53
- @clock_id = Integer(clock_id)
54
- @clock = 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
@@ -17,5 +17,5 @@
17
17
  #++
18
18
 
19
19
  module Cassandra
20
- VERSION = '3.0.3'.freeze
20
+ VERSION = '3.1.0'.freeze
21
21
  end
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.3
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-07-22 00:00:00.000000000 Z
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