cassandra-driver 3.0.0.beta.1 → 3.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +90 -38
  3. data/ext/cassandra_murmur3/cassandra_murmur3.c +1 -1
  4. data/lib/cassandra.rb +327 -130
  5. data/lib/cassandra/address_resolution.rb +1 -1
  6. data/lib/cassandra/address_resolution/policies/ec2_multi_region.rb +1 -1
  7. data/lib/cassandra/address_resolution/policies/none.rb +1 -1
  8. data/lib/cassandra/aggregate.rb +21 -7
  9. data/lib/cassandra/argument.rb +2 -2
  10. data/lib/cassandra/auth.rb +4 -4
  11. data/lib/cassandra/auth/providers.rb +1 -1
  12. data/lib/cassandra/auth/providers/password.rb +9 -5
  13. data/lib/cassandra/cassandra_logger.rb +80 -0
  14. data/lib/cassandra/cluster.rb +38 -9
  15. data/lib/cassandra/cluster/client.rb +801 -205
  16. data/lib/cassandra/cluster/connection_pool.rb +2 -2
  17. data/lib/cassandra/cluster/connector.rb +74 -25
  18. data/lib/cassandra/cluster/control_connection.rb +217 -82
  19. data/lib/cassandra/cluster/failed_connection.rb +1 -1
  20. data/lib/cassandra/cluster/metadata.rb +12 -4
  21. data/lib/cassandra/cluster/options.rb +60 -11
  22. data/lib/cassandra/cluster/registry.rb +69 -16
  23. data/lib/cassandra/cluster/schema.rb +25 -7
  24. data/lib/cassandra/cluster/schema/cql_type_parser.rb +15 -10
  25. data/lib/cassandra/cluster/schema/fetchers.rb +263 -106
  26. data/lib/cassandra/cluster/schema/fqcn_type_parser.rb +41 -36
  27. data/lib/cassandra/cluster/schema/partitioners.rb +1 -1
  28. data/lib/cassandra/cluster/schema/partitioners/murmur3.rb +3 -3
  29. data/lib/cassandra/cluster/schema/partitioners/ordered.rb +1 -1
  30. data/lib/cassandra/cluster/schema/partitioners/random.rb +1 -1
  31. data/lib/cassandra/cluster/schema/replication_strategies.rb +1 -1
  32. data/lib/cassandra/cluster/schema/replication_strategies/network_topology.rb +19 -18
  33. data/lib/cassandra/cluster/schema/replication_strategies/none.rb +1 -1
  34. data/lib/cassandra/cluster/schema/replication_strategies/simple.rb +1 -1
  35. data/lib/cassandra/column.rb +3 -3
  36. data/lib/cassandra/compression.rb +1 -1
  37. data/lib/cassandra/compression/compressors/lz4.rb +4 -3
  38. data/lib/cassandra/compression/compressors/snappy.rb +4 -3
  39. data/lib/cassandra/driver.rb +103 -41
  40. data/lib/cassandra/errors.rb +265 -30
  41. data/lib/cassandra/execution/info.rb +16 -5
  42. data/lib/cassandra/execution/options.rb +99 -54
  43. data/lib/cassandra/execution/trace.rb +16 -9
  44. data/lib/cassandra/executors.rb +1 -1
  45. data/lib/cassandra/function.rb +19 -13
  46. data/lib/cassandra/function_collection.rb +85 -0
  47. data/lib/cassandra/future.rb +106 -48
  48. data/lib/cassandra/host.rb +10 -4
  49. data/lib/cassandra/keyspace.rb +90 -33
  50. data/lib/cassandra/listener.rb +1 -1
  51. data/lib/cassandra/load_balancing.rb +2 -2
  52. data/lib/cassandra/load_balancing/policies.rb +1 -1
  53. data/lib/cassandra/load_balancing/policies/dc_aware_round_robin.rb +18 -18
  54. data/lib/cassandra/load_balancing/policies/round_robin.rb +1 -1
  55. data/lib/cassandra/load_balancing/policies/token_aware.rb +15 -13
  56. data/lib/cassandra/load_balancing/policies/white_list.rb +11 -5
  57. data/lib/cassandra/null_logger.rb +27 -6
  58. data/lib/cassandra/protocol.rb +1 -1
  59. data/lib/cassandra/protocol/coder.rb +78 -39
  60. data/lib/cassandra/protocol/cql_byte_buffer.rb +50 -33
  61. data/lib/cassandra/protocol/cql_protocol_handler.rb +44 -45
  62. data/lib/cassandra/protocol/request.rb +2 -2
  63. data/lib/cassandra/protocol/requests/auth_response_request.rb +3 -3
  64. data/lib/cassandra/protocol/requests/batch_request.rb +16 -7
  65. data/lib/cassandra/protocol/requests/credentials_request.rb +3 -3
  66. data/lib/cassandra/protocol/requests/execute_request.rb +41 -20
  67. data/lib/cassandra/protocol/requests/options_request.rb +1 -1
  68. data/lib/cassandra/protocol/requests/prepare_request.rb +5 -5
  69. data/lib/cassandra/protocol/requests/query_request.rb +27 -22
  70. data/lib/cassandra/protocol/requests/register_request.rb +2 -2
  71. data/lib/cassandra/protocol/requests/startup_request.rb +6 -4
  72. data/lib/cassandra/protocol/requests/void_query_request.rb +1 -1
  73. data/lib/cassandra/protocol/response.rb +2 -2
  74. data/lib/cassandra/protocol/responses/already_exists_error_response.rb +12 -2
  75. data/lib/cassandra/protocol/responses/auth_challenge_response.rb +1 -1
  76. data/lib/cassandra/protocol/responses/auth_success_response.rb +1 -1
  77. data/lib/cassandra/protocol/responses/authenticate_response.rb +1 -1
  78. data/lib/cassandra/protocol/responses/error_response.rb +101 -13
  79. data/lib/cassandra/protocol/responses/event_response.rb +1 -1
  80. data/lib/cassandra/protocol/responses/function_failure_error_response.rb +13 -2
  81. data/lib/cassandra/protocol/responses/prepared_result_response.rb +11 -5
  82. data/lib/cassandra/protocol/responses/raw_rows_result_response.rb +14 -9
  83. data/lib/cassandra/protocol/responses/read_failure_error_response.rb +26 -4
  84. data/lib/cassandra/protocol/responses/read_timeout_error_response.rb +22 -3
  85. data/lib/cassandra/protocol/responses/ready_response.rb +3 -3
  86. data/lib/cassandra/protocol/responses/result_response.rb +4 -2
  87. data/lib/cassandra/protocol/responses/rows_result_response.rb +5 -3
  88. data/lib/cassandra/protocol/responses/schema_change_event_response.rb +5 -4
  89. data/lib/cassandra/protocol/responses/schema_change_result_response.rb +16 -9
  90. data/lib/cassandra/protocol/responses/set_keyspace_result_response.rb +2 -2
  91. data/lib/cassandra/protocol/responses/status_change_event_response.rb +2 -2
  92. data/lib/cassandra/protocol/responses/supported_response.rb +1 -1
  93. data/lib/cassandra/protocol/responses/topology_change_event_response.rb +1 -1
  94. data/lib/cassandra/protocol/responses/unavailable_error_response.rb +20 -3
  95. data/lib/cassandra/protocol/responses/unprepared_error_response.rb +11 -2
  96. data/lib/cassandra/protocol/responses/void_result_response.rb +1 -1
  97. data/lib/cassandra/protocol/responses/write_failure_error_response.rb +26 -4
  98. data/lib/cassandra/protocol/responses/write_timeout_error_response.rb +22 -3
  99. data/lib/cassandra/protocol/v1.rb +101 -36
  100. data/lib/cassandra/protocol/v3.rb +124 -51
  101. data/lib/cassandra/protocol/v4.rb +172 -68
  102. data/lib/cassandra/reconnection.rb +1 -1
  103. data/lib/cassandra/reconnection/policies.rb +1 -1
  104. data/lib/cassandra/reconnection/policies/constant.rb +2 -4
  105. data/lib/cassandra/reconnection/policies/exponential.rb +6 -6
  106. data/lib/cassandra/result.rb +53 -19
  107. data/lib/cassandra/retry.rb +8 -8
  108. data/lib/cassandra/retry/policies.rb +1 -1
  109. data/lib/cassandra/retry/policies/default.rb +1 -1
  110. data/lib/cassandra/retry/policies/downgrading_consistency.rb +7 -3
  111. data/lib/cassandra/retry/policies/fallthrough.rb +1 -1
  112. data/lib/cassandra/session.rb +22 -16
  113. data/lib/cassandra/statement.rb +1 -1
  114. data/lib/cassandra/statements.rb +1 -1
  115. data/lib/cassandra/statements/batch.rb +16 -10
  116. data/lib/cassandra/statements/bound.rb +10 -3
  117. data/lib/cassandra/statements/prepared.rb +59 -15
  118. data/lib/cassandra/statements/simple.rb +23 -10
  119. data/lib/cassandra/statements/void.rb +1 -1
  120. data/lib/cassandra/table.rb +79 -30
  121. data/lib/cassandra/time.rb +11 -6
  122. data/lib/cassandra/time_uuid.rb +7 -7
  123. data/lib/cassandra/tuple.rb +16 -8
  124. data/lib/cassandra/types.rb +20 -9
  125. data/lib/cassandra/udt.rb +32 -36
  126. data/lib/cassandra/util.rb +20 -13
  127. data/lib/cassandra/uuid.rb +22 -15
  128. data/lib/cassandra/uuid/generator.rb +7 -5
  129. data/lib/cassandra/version.rb +2 -2
  130. data/lib/datastax/cassandra.rb +1 -1
  131. metadata +5 -3
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -30,7 +30,18 @@ module Cassandra
30
30
  end
31
31
 
32
32
  def to_error(keyspace, statement, options, hosts, consistency, retries)
33
- Errors::FunctionCallError.new(@message, @custom_payload, @warnings, keyspace, statement, options, hosts, consistency, retries, @keyspace, @name, @signature)
33
+ Errors::FunctionCallError.new(@message,
34
+ @custom_payload,
35
+ @warnings,
36
+ keyspace,
37
+ statement,
38
+ options,
39
+ hosts,
40
+ consistency,
41
+ retries,
42
+ @keyspace,
43
+ @name,
44
+ @signature)
34
45
  end
35
46
 
36
47
  def to_s
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -21,7 +21,13 @@ module Cassandra
21
21
  class PreparedResultResponse < ResultResponse
22
22
  attr_reader :id, :metadata, :result_metadata, :pk_idx
23
23
 
24
- def initialize(custom_payload, warnings, id, metadata, result_metadata, pk_idx, trace_id)
24
+ def initialize(custom_payload,
25
+ warnings,
26
+ id,
27
+ metadata,
28
+ result_metadata,
29
+ pk_idx,
30
+ trace_id)
25
31
  super(custom_payload, warnings, trace_id)
26
32
  @id = id
27
33
  @metadata = metadata
@@ -30,9 +36,9 @@ module Cassandra
30
36
  end
31
37
 
32
38
  def eql?(other)
33
- self.id == other.id && self.metadata == other.metadata && self.trace_id == other.trace_id
39
+ id == other.id && metadata == other.metadata && trace_id == other.trace_id
34
40
  end
35
- alias_method :==, :eql?
41
+ alias == eql?
36
42
 
37
43
  def hash
38
44
  @h ||= begin
@@ -46,7 +52,7 @@ module Cassandra
46
52
 
47
53
  def to_s
48
54
  hex_id = @id.each_byte.map { |x| x.to_s(16).rjust(2, '0') }.join('')
49
- %(RESULT PREPARED #{hex_id} #@metadata)
55
+ %(RESULT PREPARED #{hex_id} #{@metadata})
50
56
  end
51
57
 
52
58
  private
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -19,7 +19,12 @@
19
19
  module Cassandra
20
20
  module Protocol
21
21
  class RawRowsResultResponse < RowsResultResponse
22
- def initialize(custom_payload, warnings, protocol_version, raw_rows, paging_state, trace_id)
22
+ def initialize(custom_payload,
23
+ warnings,
24
+ protocol_version,
25
+ raw_rows,
26
+ paging_state,
27
+ trace_id)
23
28
  super(custom_payload, warnings, nil, nil, paging_state, trace_id)
24
29
  @protocol_version = protocol_version
25
30
  @raw_rows = raw_rows
@@ -28,13 +33,13 @@ module Cassandra
28
33
  def materialize(metadata)
29
34
  @metadata = metadata
30
35
 
31
- if @protocol_version == 4
32
- @rows = Coder.read_values_v4(@raw_rows, @metadata)
33
- elsif @protocol_version == 3
34
- @rows = Coder.read_values_v3(@raw_rows, @metadata)
35
- else
36
- @rows = Coder.read_values_v1(@raw_rows, @metadata)
37
- end
36
+ @rows = if @protocol_version == 4
37
+ Coder.read_values_v4(@raw_rows, @metadata)
38
+ elsif @protocol_version == 3
39
+ Coder.read_values_v3(@raw_rows, @metadata)
40
+ else
41
+ Coder.read_values_v1(@raw_rows, @metadata)
42
+ end
38
43
 
39
44
  @rows
40
45
  end
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -21,7 +21,15 @@ module Cassandra
21
21
  class ReadFailureErrorResponse < ErrorResponse
22
22
  attr_reader :consistency, :received, :blockfor, :numfailures, :data_present
23
23
 
24
- def initialize(custom_payload, warnings, code, message, consistency, received, blockfor, numfailures, data_present)
24
+ def initialize(custom_payload,
25
+ warnings,
26
+ code,
27
+ message,
28
+ consistency,
29
+ received,
30
+ blockfor,
31
+ numfailures,
32
+ data_present)
25
33
  super(custom_payload, warnings, code, message)
26
34
 
27
35
  @consistency = consistency
@@ -32,11 +40,25 @@ module Cassandra
32
40
  end
33
41
 
34
42
  def to_error(keyspace, statement, options, hosts, consistency, retries)
35
- Errors::ReadError.new(@message, @custom_payload, @warnings, keyspace, statement, options, hosts, consistency, retries, @data_present, @consistency, @blockfor, @numfailures, @received)
43
+ Errors::ReadError.new(@message,
44
+ @custom_payload,
45
+ @warnings,
46
+ keyspace,
47
+ statement,
48
+ options,
49
+ hosts,
50
+ consistency,
51
+ retries,
52
+ @data_present,
53
+ @consistency,
54
+ @blockfor,
55
+ @numfailures,
56
+ @received)
36
57
  end
37
58
 
38
59
  def to_s
39
- "#{super} #{@consistency} #{@received} #{@blockfor} #{@numfailures} #{@data_present}"
60
+ "#{super} #{@consistency} #{@received} #{@blockfor} #{@numfailures} " \
61
+ "#{@data_present}"
40
62
  end
41
63
  end
42
64
  end
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -21,7 +21,14 @@ module Cassandra
21
21
  class ReadTimeoutErrorResponse < ErrorResponse
22
22
  attr_reader :consistency, :received, :blockfor, :data_present
23
23
 
24
- def initialize(custom_payload, warnings, code, message, consistency, received, blockfor, data_present)
24
+ def initialize(custom_payload,
25
+ warnings,
26
+ code,
27
+ message,
28
+ consistency,
29
+ received,
30
+ blockfor,
31
+ data_present)
25
32
  super(custom_payload, warnings, code, message)
26
33
 
27
34
  @consistency = consistency
@@ -31,7 +38,19 @@ module Cassandra
31
38
  end
32
39
 
33
40
  def to_error(keyspace, statement, options, hosts, consistency, retries)
34
- Errors::ReadTimeoutError.new(@message, @custom_payload, @warnings, keyspace, statement, options, hosts, consistency, retries, @data_present, @consistency, @blockfor, @received)
41
+ Errors::ReadTimeoutError.new(@message,
42
+ @custom_payload,
43
+ @warnings,
44
+ keyspace,
45
+ statement,
46
+ options,
47
+ hosts,
48
+ consistency,
49
+ retries,
50
+ @data_present,
51
+ @consistency,
52
+ @blockfor,
53
+ @received)
35
54
  end
36
55
 
37
56
  def to_s
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -20,9 +20,9 @@ module Cassandra
20
20
  module Protocol
21
21
  class ReadyResponse < Response
22
22
  def eql?(rs)
23
- self.class === rs
23
+ rs.is_a?(self.class)
24
24
  end
25
- alias_method :==, :eql?
25
+ alias == eql?
26
26
 
27
27
  def hash
28
28
  @h ||= begin
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -22,7 +22,9 @@ module Cassandra
22
22
  attr_reader :custom_payload, :warnings, :trace_id
23
23
 
24
24
  def initialize(custom_payload, warnings, trace_id)
25
- @custom_payload, @warnings, @trace_id = custom_payload, warnings, trace_id
25
+ @custom_payload = custom_payload
26
+ @warnings = warnings
27
+ @trace_id = trace_id
26
28
  end
27
29
 
28
30
  def void?
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -23,11 +23,13 @@ module Cassandra
23
23
 
24
24
  def initialize(custom_payload, warnings, rows, metadata, paging_state, trace_id)
25
25
  super(custom_payload, warnings, trace_id)
26
- @rows, @metadata, @paging_state = rows, metadata, paging_state
26
+ @rows = rows
27
+ @metadata = metadata
28
+ @paging_state = paging_state
27
29
  end
28
30
 
29
31
  def to_s
30
- %(RESULT ROWS #@metadata #@rows)
32
+ %(RESULT ROWS #{@metadata} #{@rows})
31
33
  end
32
34
 
33
35
  private
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ module Cassandra
43
43
  @target == other.target &&
44
44
  @arguments == other.arguments
45
45
  end
46
- alias_method :==, :eql?
46
+ alias == eql?
47
47
 
48
48
  def hash
49
49
  @h ||= begin
@@ -59,9 +59,10 @@ module Cassandra
59
59
 
60
60
  def to_s
61
61
  if @arguments
62
- %(EVENT SCHEMA_CHANGE #@change #@target "#@keyspace" "#@name" #@arguments)
62
+ %(EVENT SCHEMA_CHANGE #{@change} #{@target} "#{@keyspace}" "#{@name}" ) \
63
+ "#{@arguments}"
63
64
  else
64
- %(EVENT SCHEMA_CHANGE #@change #@target "#@keyspace" "#@name")
65
+ %(EVENT SCHEMA_CHANGE #{@change} #{@target} "#{@keyspace}" "#{@name}")
65
66
  end
66
67
  end
67
68
 
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -19,9 +19,16 @@
19
19
  module Cassandra
20
20
  module Protocol
21
21
  class SchemaChangeResultResponse < ResultResponse
22
- attr_reader :change, :keyspace, :name, :type, :target, :arguments
22
+ attr_reader :arguments, :change, :keyspace, :name, :target, :type
23
23
 
24
- def initialize(custom_payload, warnings, change, keyspace, name, target, arguments, trace_id)
24
+ def initialize(custom_payload,
25
+ warnings,
26
+ change,
27
+ keyspace,
28
+ name,
29
+ target,
30
+ arguments,
31
+ trace_id)
25
32
  super(custom_payload, warnings, trace_id)
26
33
 
27
34
  @change = change
@@ -33,12 +40,12 @@ module Cassandra
33
40
 
34
41
  def eql?(other)
35
42
  @change == other.change &&
36
- @keyspace == other.keyspace &&
37
- @name == other.name &&
38
- @target == other.target &&
39
- @arguments == other.arguments
43
+ @keyspace == other.keyspace &&
44
+ @name == other.name &&
45
+ @target == other.target &&
46
+ @arguments == other.arguments
40
47
  end
41
- alias_method :==, :eql?
48
+ alias == eql?
42
49
 
43
50
  def hash
44
51
  @h ||= begin
@@ -53,7 +60,7 @@ module Cassandra
53
60
  end
54
61
 
55
62
  def to_s
56
- %(RESULT SCHEMA_CHANGE #@change #@target "#@keyspace" "#@name")
63
+ %(RESULT SCHEMA_CHANGE #{@change} #{@target} "#{@keyspace}" "#{@name}")
57
64
  end
58
65
 
59
66
  private
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ module Cassandra
27
27
  end
28
28
 
29
29
  def to_s
30
- %(RESULT SET_KEYSPACE "#@keyspace")
30
+ %(RESULT SET_KEYSPACE "#{@keyspace}")
31
31
  end
32
32
 
33
33
  private
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ module Cassandra
29
29
  end
30
30
 
31
31
  def to_s
32
- %(EVENT #@type #@change #@address:#@port)
32
+ %(EVENT #{@type} #{@change} #{@address}:#{@port})
33
33
  end
34
34
 
35
35
  private
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  #--
4
- # Copyright 2013-2015 DataStax, Inc.
4
+ # Copyright 2013-2016 DataStax, Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -21,7 +21,13 @@ module Cassandra
21
21
  class UnavailableErrorResponse < ErrorResponse
22
22
  attr_reader :consistency, :required, :alive
23
23
 
24
- def initialize(custom_payload, warnings, code, message, consistency, required, alive)
24
+ def initialize(custom_payload,
25
+ warnings,
26
+ code,
27
+ message,
28
+ consistency,
29
+ required,
30
+ alive)
25
31
  super(custom_payload, warnings, code, message)
26
32
 
27
33
  @consistency = consistency
@@ -30,7 +36,18 @@ module Cassandra
30
36
  end
31
37
 
32
38
  def to_error(keyspace, statement, options, hosts, r_consistency, retries)
33
- Errors::UnavailableError.new(@message, @custom_payload, @warnings, keyspace, statement, options, hosts, r_consistency, retries, @consistency, @required, @alive)
39
+ Errors::UnavailableError.new(@message,
40
+ @custom_payload,
41
+ @warnings,
42
+ keyspace,
43
+ statement,
44
+ options,
45
+ hosts,
46
+ r_consistency,
47
+ retries,
48
+ @consistency,
49
+ @required,
50
+ @alive)
34
51
  end
35
52
 
36
53
  def to_s