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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +106 -39
  3. data/lib/cassandra.rb +396 -148
  4. data/lib/cassandra/address_resolution.rb +1 -1
  5. data/lib/cassandra/address_resolution/policies/ec2_multi_region.rb +1 -1
  6. data/lib/cassandra/address_resolution/policies/none.rb +1 -1
  7. data/lib/cassandra/aggregate.rb +21 -7
  8. data/lib/cassandra/argument.rb +2 -2
  9. data/lib/cassandra/attr_boolean.rb +33 -0
  10. data/lib/cassandra/auth.rb +6 -5
  11. data/lib/cassandra/auth/providers.rb +1 -1
  12. data/lib/cassandra/auth/providers/password.rb +5 -13
  13. data/lib/cassandra/cassandra_logger.rb +80 -0
  14. data/lib/cassandra/cluster.rb +49 -9
  15. data/lib/cassandra/cluster/client.rb +835 -209
  16. data/lib/cassandra/cluster/connection_pool.rb +2 -2
  17. data/lib/cassandra/cluster/connector.rb +86 -27
  18. data/lib/cassandra/cluster/control_connection.rb +222 -95
  19. data/lib/cassandra/cluster/failed_connection.rb +1 -1
  20. data/lib/cassandra/cluster/metadata.rb +14 -8
  21. data/lib/cassandra/cluster/options.rb +68 -22
  22. data/lib/cassandra/cluster/registry.rb +81 -17
  23. data/lib/cassandra/cluster/schema.rb +70 -8
  24. data/lib/cassandra/cluster/schema/cql_type_parser.rb +15 -10
  25. data/lib/cassandra/cluster/schema/fetchers.rb +601 -241
  26. data/lib/cassandra/cluster/schema/fqcn_type_parser.rb +39 -38
  27. data/lib/cassandra/cluster/schema/partitioners.rb +1 -1
  28. data/lib/cassandra/cluster/schema/partitioners/murmur3.rb +6 -8
  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 +4 -23
  36. data/lib/cassandra/column_container.rb +322 -0
  37. data/lib/cassandra/compression.rb +1 -1
  38. data/lib/cassandra/compression/compressors/lz4.rb +7 -8
  39. data/lib/cassandra/compression/compressors/snappy.rb +4 -3
  40. data/lib/cassandra/driver.rb +107 -46
  41. data/lib/cassandra/errors.rb +303 -52
  42. data/lib/cassandra/execution/info.rb +16 -5
  43. data/lib/cassandra/execution/options.rb +102 -55
  44. data/lib/cassandra/execution/trace.rb +16 -9
  45. data/lib/cassandra/executors.rb +1 -1
  46. data/lib/cassandra/function.rb +19 -13
  47. data/lib/cassandra/function_collection.rb +85 -0
  48. data/lib/cassandra/future.rb +101 -49
  49. data/lib/cassandra/host.rb +25 -5
  50. data/lib/cassandra/index.rb +118 -0
  51. data/lib/cassandra/keyspace.rb +169 -33
  52. data/lib/cassandra/listener.rb +1 -1
  53. data/lib/cassandra/load_balancing.rb +2 -2
  54. data/lib/cassandra/load_balancing/policies.rb +1 -1
  55. data/lib/cassandra/load_balancing/policies/dc_aware_round_robin.rb +39 -25
  56. data/lib/cassandra/load_balancing/policies/round_robin.rb +8 -1
  57. data/lib/cassandra/load_balancing/policies/token_aware.rb +22 -13
  58. data/lib/cassandra/load_balancing/policies/white_list.rb +18 -5
  59. data/lib/cassandra/materialized_view.rb +90 -0
  60. data/lib/cassandra/null_logger.rb +27 -6
  61. data/lib/cassandra/protocol.rb +1 -1
  62. data/lib/cassandra/protocol/coder.rb +81 -42
  63. data/lib/cassandra/protocol/cql_byte_buffer.rb +58 -44
  64. data/lib/cassandra/protocol/cql_protocol_handler.rb +57 -54
  65. data/lib/cassandra/protocol/request.rb +6 -7
  66. data/lib/cassandra/protocol/requests/auth_response_request.rb +3 -3
  67. data/lib/cassandra/protocol/requests/batch_request.rb +17 -8
  68. data/lib/cassandra/protocol/requests/credentials_request.rb +3 -3
  69. data/lib/cassandra/protocol/requests/execute_request.rb +39 -20
  70. data/lib/cassandra/protocol/requests/options_request.rb +1 -1
  71. data/lib/cassandra/protocol/requests/prepare_request.rb +5 -5
  72. data/lib/cassandra/protocol/requests/query_request.rb +28 -23
  73. data/lib/cassandra/protocol/requests/register_request.rb +2 -2
  74. data/lib/cassandra/protocol/requests/startup_request.rb +8 -8
  75. data/lib/cassandra/protocol/requests/void_query_request.rb +1 -1
  76. data/lib/cassandra/protocol/response.rb +3 -4
  77. data/lib/cassandra/protocol/responses/already_exists_error_response.rb +12 -2
  78. data/lib/cassandra/protocol/responses/auth_challenge_response.rb +4 -5
  79. data/lib/cassandra/protocol/responses/auth_success_response.rb +4 -5
  80. data/lib/cassandra/protocol/responses/authenticate_response.rb +4 -5
  81. data/lib/cassandra/protocol/responses/error_response.rb +104 -17
  82. data/lib/cassandra/protocol/responses/event_response.rb +3 -4
  83. data/lib/cassandra/protocol/responses/function_failure_error_response.rb +13 -2
  84. data/lib/cassandra/protocol/responses/prepared_result_response.rb +14 -9
  85. data/lib/cassandra/protocol/responses/raw_rows_result_response.rb +14 -9
  86. data/lib/cassandra/protocol/responses/read_failure_error_response.rb +26 -4
  87. data/lib/cassandra/protocol/responses/read_timeout_error_response.rb +22 -3
  88. data/lib/cassandra/protocol/responses/ready_response.rb +6 -7
  89. data/lib/cassandra/protocol/responses/result_response.rb +11 -10
  90. data/lib/cassandra/protocol/responses/rows_result_response.rb +8 -7
  91. data/lib/cassandra/protocol/responses/schema_change_event_response.rb +8 -8
  92. data/lib/cassandra/protocol/responses/schema_change_result_response.rb +19 -13
  93. data/lib/cassandra/protocol/responses/set_keyspace_result_response.rb +5 -6
  94. data/lib/cassandra/protocol/responses/status_change_event_response.rb +5 -6
  95. data/lib/cassandra/protocol/responses/supported_response.rb +4 -5
  96. data/lib/cassandra/protocol/responses/topology_change_event_response.rb +4 -5
  97. data/lib/cassandra/protocol/responses/unavailable_error_response.rb +20 -3
  98. data/lib/cassandra/protocol/responses/unprepared_error_response.rb +11 -2
  99. data/lib/cassandra/protocol/responses/void_result_response.rb +4 -5
  100. data/lib/cassandra/protocol/responses/write_failure_error_response.rb +26 -4
  101. data/lib/cassandra/protocol/responses/write_timeout_error_response.rb +22 -3
  102. data/lib/cassandra/protocol/v1.rb +98 -37
  103. data/lib/cassandra/protocol/v3.rb +121 -50
  104. data/lib/cassandra/protocol/v4.rb +172 -68
  105. data/lib/cassandra/reconnection.rb +1 -1
  106. data/lib/cassandra/reconnection/policies.rb +1 -1
  107. data/lib/cassandra/reconnection/policies/constant.rb +2 -4
  108. data/lib/cassandra/reconnection/policies/exponential.rb +6 -6
  109. data/lib/cassandra/result.rb +55 -20
  110. data/lib/cassandra/retry.rb +8 -8
  111. data/lib/cassandra/retry/policies.rb +1 -1
  112. data/lib/cassandra/retry/policies/default.rb +1 -1
  113. data/lib/cassandra/retry/policies/downgrading_consistency.rb +4 -2
  114. data/lib/cassandra/retry/policies/fallthrough.rb +1 -1
  115. data/lib/cassandra/session.rb +24 -16
  116. data/lib/cassandra/statement.rb +1 -1
  117. data/lib/cassandra/statements.rb +1 -1
  118. data/lib/cassandra/statements/batch.rb +16 -10
  119. data/lib/cassandra/statements/bound.rb +10 -3
  120. data/lib/cassandra/statements/prepared.rb +62 -18
  121. data/lib/cassandra/statements/simple.rb +23 -10
  122. data/lib/cassandra/statements/void.rb +1 -1
  123. data/lib/cassandra/table.rb +53 -185
  124. data/lib/cassandra/time.rb +11 -6
  125. data/lib/cassandra/time_uuid.rb +12 -14
  126. data/lib/cassandra/timestamp_generator.rb +37 -0
  127. data/lib/cassandra/timestamp_generator/simple.rb +38 -0
  128. data/lib/cassandra/timestamp_generator/ticking_on_duplicate.rb +58 -0
  129. data/lib/cassandra/tuple.rb +4 -4
  130. data/lib/cassandra/types.rb +109 -71
  131. data/lib/cassandra/udt.rb +66 -50
  132. data/lib/cassandra/util.rb +155 -15
  133. data/lib/cassandra/uuid.rb +20 -21
  134. data/lib/cassandra/uuid/generator.rb +7 -5
  135. data/lib/cassandra/version.rb +2 -2
  136. data/lib/cassandra_murmur3.jar +0 -0
  137. data/lib/datastax/cassandra.rb +1 -1
  138. metadata +27 -16
@@ -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.
@@ -19,10 +19,13 @@
19
19
  module Cassandra
20
20
  module Protocol
21
21
  class ReadyResponse < Response
22
+ # @private
23
+ RESPONSE_TYPES[0x02] = self
24
+
22
25
  def eql?(rs)
23
- self.class === rs
26
+ rs.is_a?(self.class)
24
27
  end
25
- alias_method :==, :eql?
28
+ alias == eql?
26
29
 
27
30
  def hash
28
31
  @h ||= begin
@@ -35,10 +38,6 @@ module Cassandra
35
38
  def to_s
36
39
  'READY'
37
40
  end
38
-
39
- private
40
-
41
- RESPONSE_TYPES[0x02] = self
42
41
  end
43
42
  end
44
43
  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.
@@ -19,23 +19,24 @@
19
19
  module Cassandra
20
20
  module Protocol
21
21
  class ResultResponse < Response
22
+ # @private
23
+ RESPONSE_TYPES[0x08] = self
24
+ # @private
25
+ RESULT_TYPES = [
26
+ # populated by subclasses
27
+ ]
28
+
22
29
  attr_reader :custom_payload, :warnings, :trace_id
23
30
 
24
31
  def initialize(custom_payload, warnings, trace_id)
25
- @custom_payload, @warnings, @trace_id = custom_payload, warnings, trace_id
32
+ @custom_payload = custom_payload
33
+ @warnings = warnings
34
+ @trace_id = trace_id
26
35
  end
27
36
 
28
37
  def void?
29
38
  false
30
39
  end
31
-
32
- private
33
-
34
- RESPONSE_TYPES[0x08] = self
35
-
36
- RESULT_TYPES = [
37
- # populated by subclasses
38
- ]
39
40
  end
40
41
  end
41
42
  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.
@@ -19,20 +19,21 @@
19
19
  module Cassandra
20
20
  module Protocol
21
21
  class RowsResultResponse < ResultResponse
22
+ # @private
23
+ RESULT_TYPES[0x02] = self
24
+
22
25
  attr_reader :rows, :metadata, :paging_state
23
26
 
24
27
  def initialize(custom_payload, warnings, rows, metadata, paging_state, trace_id)
25
28
  super(custom_payload, warnings, trace_id)
26
- @rows, @metadata, @paging_state = rows, metadata, paging_state
29
+ @rows = rows
30
+ @metadata = metadata
31
+ @paging_state = paging_state
27
32
  end
28
33
 
29
34
  def to_s
30
- %(RESULT ROWS #@metadata #@rows)
35
+ %(RESULT ROWS #{@metadata} #{@rows})
31
36
  end
32
-
33
- private
34
-
35
- RESULT_TYPES[0x02] = self
36
37
  end
37
38
  end
38
39
  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,6 +21,9 @@ module Cassandra
21
21
  class SchemaChangeEventResponse < EventResponse
22
22
  TYPE = 'SCHEMA_CHANGE'.freeze
23
23
 
24
+ # @private
25
+ EVENT_TYPES[TYPE] = self
26
+
24
27
  attr_reader :change, :keyspace, :name, :target, :arguments
25
28
 
26
29
  def initialize(change, keyspace, name, target, arguments)
@@ -43,7 +46,7 @@ module Cassandra
43
46
  @target == other.target &&
44
47
  @arguments == other.arguments
45
48
  end
46
- alias_method :==, :eql?
49
+ alias == eql?
47
50
 
48
51
  def hash
49
52
  @h ||= begin
@@ -59,15 +62,12 @@ module Cassandra
59
62
 
60
63
  def to_s
61
64
  if @arguments
62
- %(EVENT SCHEMA_CHANGE #@change #@target "#@keyspace" "#@name" #@arguments)
65
+ %(EVENT SCHEMA_CHANGE #{@change} #{@target} "#{@keyspace}" "#{@name}" ) \
66
+ "#{@arguments}"
63
67
  else
64
- %(EVENT SCHEMA_CHANGE #@change #@target "#@keyspace" "#@name")
68
+ %(EVENT SCHEMA_CHANGE #{@change} #{@target} "#{@keyspace}" "#{@name}")
65
69
  end
66
70
  end
67
-
68
- private
69
-
70
- EVENT_TYPES[TYPE] = self
71
71
  end
72
72
  end
73
73
  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.
@@ -19,9 +19,19 @@
19
19
  module Cassandra
20
20
  module Protocol
21
21
  class SchemaChangeResultResponse < ResultResponse
22
- attr_reader :change, :keyspace, :name, :type, :target, :arguments
22
+ # @private
23
+ RESULT_TYPES[0x05] = self
24
+
25
+ attr_reader :arguments, :change, :keyspace, :name, :target, :type
23
26
 
24
- def initialize(custom_payload, warnings, change, keyspace, name, target, arguments, trace_id)
27
+ def initialize(custom_payload,
28
+ warnings,
29
+ change,
30
+ keyspace,
31
+ name,
32
+ target,
33
+ arguments,
34
+ trace_id)
25
35
  super(custom_payload, warnings, trace_id)
26
36
 
27
37
  @change = change
@@ -33,12 +43,12 @@ module Cassandra
33
43
 
34
44
  def eql?(other)
35
45
  @change == other.change &&
36
- @keyspace == other.keyspace &&
37
- @name == other.name &&
38
- @target == other.target &&
39
- @arguments == other.arguments
46
+ @keyspace == other.keyspace &&
47
+ @name == other.name &&
48
+ @target == other.target &&
49
+ @arguments == other.arguments
40
50
  end
41
- alias_method :==, :eql?
51
+ alias == eql?
42
52
 
43
53
  def hash
44
54
  @h ||= begin
@@ -53,12 +63,8 @@ module Cassandra
53
63
  end
54
64
 
55
65
  def to_s
56
- %(RESULT SCHEMA_CHANGE #@change #@target "#@keyspace" "#@name")
66
+ %(RESULT SCHEMA_CHANGE #{@change} #{@target} "#{@keyspace}" "#{@name}")
57
67
  end
58
-
59
- private
60
-
61
- RESULT_TYPES[0x05] = self
62
68
  end
63
69
  end
64
70
  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.
@@ -19,6 +19,9 @@
19
19
  module Cassandra
20
20
  module Protocol
21
21
  class SetKeyspaceResultResponse < ResultResponse
22
+ # @private
23
+ RESULT_TYPES[0x03] = self
24
+
22
25
  attr_reader :keyspace
23
26
 
24
27
  def initialize(custom_payload, warnings, keyspace, trace_id)
@@ -27,12 +30,8 @@ module Cassandra
27
30
  end
28
31
 
29
32
  def to_s
30
- %(RESULT SET_KEYSPACE "#@keyspace")
33
+ %(RESULT SET_KEYSPACE "#{@keyspace}")
31
34
  end
32
-
33
- private
34
-
35
- RESULT_TYPES[0x03] = self
36
35
  end
37
36
  end
38
37
  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,6 +21,9 @@ module Cassandra
21
21
  class StatusChangeEventResponse < EventResponse
22
22
  TYPE = 'STATUS_CHANGE'.freeze
23
23
 
24
+ # @private
25
+ EVENT_TYPES[TYPE] = self
26
+
24
27
  attr_reader :type, :change, :address, :port
25
28
 
26
29
  def initialize(*args)
@@ -29,12 +32,8 @@ module Cassandra
29
32
  end
30
33
 
31
34
  def to_s
32
- %(EVENT #@type #@change #@address:#@port)
35
+ %(EVENT #{@type} #{@change} #{@address}:#{@port})
33
36
  end
34
-
35
- private
36
-
37
- EVENT_TYPES[TYPE] = self
38
37
  end
39
38
  end
40
39
  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.
@@ -19,6 +19,9 @@
19
19
  module Cassandra
20
20
  module Protocol
21
21
  class SupportedResponse < Response
22
+ # @private
23
+ RESPONSE_TYPES[0x06] = self
24
+
22
25
  attr_reader :options
23
26
 
24
27
  def initialize(options)
@@ -28,10 +31,6 @@ module Cassandra
28
31
  def to_s
29
32
  %(SUPPORTED #{options})
30
33
  end
31
-
32
- private
33
-
34
- RESPONSE_TYPES[0x06] = self
35
34
  end
36
35
  end
37
36
  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,14 +21,13 @@ module Cassandra
21
21
  class TopologyChangeEventResponse < StatusChangeEventResponse
22
22
  TYPE = 'TOPOLOGY_CHANGE'.freeze
23
23
 
24
+ # @private
25
+ EVENT_TYPES[TYPE] = self
26
+
24
27
  def initialize(*args)
25
28
  super
26
29
  @type = TYPE
27
30
  end
28
-
29
- private
30
-
31
- EVENT_TYPES[TYPE] = self
32
31
  end
33
32
  end
34
33
  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,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
@@ -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.
@@ -28,7 +28,16 @@ module Cassandra
28
28
  end
29
29
 
30
30
  def to_error(keyspace, statement, options, hosts, consistency, retries)
31
- Errors::UnpreparedError.new(@message, @custom_payload, @warnings, keyspace, statement, options, hosts, consistency, retries, @id)
31
+ Errors::UnpreparedError.new(@message,
32
+ @custom_payload,
33
+ @warnings,
34
+ keyspace,
35
+ statement,
36
+ options,
37
+ hosts,
38
+ consistency,
39
+ retries,
40
+ @id)
32
41
  end
33
42
 
34
43
  def to_s