cassandra-driver 3.0.0.beta.1-java → 3.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +106 -39
- data/lib/cassandra.rb +396 -148
- data/lib/cassandra/address_resolution.rb +1 -1
- data/lib/cassandra/address_resolution/policies/ec2_multi_region.rb +1 -1
- data/lib/cassandra/address_resolution/policies/none.rb +1 -1
- data/lib/cassandra/aggregate.rb +21 -7
- data/lib/cassandra/argument.rb +2 -2
- data/lib/cassandra/attr_boolean.rb +33 -0
- data/lib/cassandra/auth.rb +6 -5
- data/lib/cassandra/auth/providers.rb +1 -1
- data/lib/cassandra/auth/providers/password.rb +5 -13
- data/lib/cassandra/cassandra_logger.rb +80 -0
- data/lib/cassandra/cluster.rb +49 -9
- data/lib/cassandra/cluster/client.rb +835 -209
- data/lib/cassandra/cluster/connection_pool.rb +2 -2
- data/lib/cassandra/cluster/connector.rb +86 -27
- data/lib/cassandra/cluster/control_connection.rb +222 -95
- data/lib/cassandra/cluster/failed_connection.rb +1 -1
- data/lib/cassandra/cluster/metadata.rb +14 -8
- data/lib/cassandra/cluster/options.rb +68 -22
- data/lib/cassandra/cluster/registry.rb +81 -17
- data/lib/cassandra/cluster/schema.rb +70 -8
- data/lib/cassandra/cluster/schema/cql_type_parser.rb +15 -10
- data/lib/cassandra/cluster/schema/fetchers.rb +601 -241
- data/lib/cassandra/cluster/schema/fqcn_type_parser.rb +39 -38
- data/lib/cassandra/cluster/schema/partitioners.rb +1 -1
- data/lib/cassandra/cluster/schema/partitioners/murmur3.rb +6 -8
- data/lib/cassandra/cluster/schema/partitioners/ordered.rb +1 -1
- data/lib/cassandra/cluster/schema/partitioners/random.rb +1 -1
- data/lib/cassandra/cluster/schema/replication_strategies.rb +1 -1
- data/lib/cassandra/cluster/schema/replication_strategies/network_topology.rb +19 -18
- data/lib/cassandra/cluster/schema/replication_strategies/none.rb +1 -1
- data/lib/cassandra/cluster/schema/replication_strategies/simple.rb +1 -1
- data/lib/cassandra/column.rb +4 -23
- data/lib/cassandra/column_container.rb +322 -0
- data/lib/cassandra/compression.rb +1 -1
- data/lib/cassandra/compression/compressors/lz4.rb +7 -8
- data/lib/cassandra/compression/compressors/snappy.rb +4 -3
- data/lib/cassandra/driver.rb +107 -46
- data/lib/cassandra/errors.rb +303 -52
- data/lib/cassandra/execution/info.rb +16 -5
- data/lib/cassandra/execution/options.rb +102 -55
- data/lib/cassandra/execution/trace.rb +16 -9
- data/lib/cassandra/executors.rb +1 -1
- data/lib/cassandra/function.rb +19 -13
- data/lib/cassandra/function_collection.rb +85 -0
- data/lib/cassandra/future.rb +101 -49
- data/lib/cassandra/host.rb +25 -5
- data/lib/cassandra/index.rb +118 -0
- data/lib/cassandra/keyspace.rb +169 -33
- data/lib/cassandra/listener.rb +1 -1
- data/lib/cassandra/load_balancing.rb +2 -2
- data/lib/cassandra/load_balancing/policies.rb +1 -1
- data/lib/cassandra/load_balancing/policies/dc_aware_round_robin.rb +39 -25
- data/lib/cassandra/load_balancing/policies/round_robin.rb +8 -1
- data/lib/cassandra/load_balancing/policies/token_aware.rb +22 -13
- data/lib/cassandra/load_balancing/policies/white_list.rb +18 -5
- data/lib/cassandra/materialized_view.rb +90 -0
- data/lib/cassandra/null_logger.rb +27 -6
- data/lib/cassandra/protocol.rb +1 -1
- data/lib/cassandra/protocol/coder.rb +81 -42
- data/lib/cassandra/protocol/cql_byte_buffer.rb +58 -44
- data/lib/cassandra/protocol/cql_protocol_handler.rb +57 -54
- data/lib/cassandra/protocol/request.rb +6 -7
- data/lib/cassandra/protocol/requests/auth_response_request.rb +3 -3
- data/lib/cassandra/protocol/requests/batch_request.rb +17 -8
- data/lib/cassandra/protocol/requests/credentials_request.rb +3 -3
- data/lib/cassandra/protocol/requests/execute_request.rb +39 -20
- data/lib/cassandra/protocol/requests/options_request.rb +1 -1
- data/lib/cassandra/protocol/requests/prepare_request.rb +5 -5
- data/lib/cassandra/protocol/requests/query_request.rb +28 -23
- data/lib/cassandra/protocol/requests/register_request.rb +2 -2
- data/lib/cassandra/protocol/requests/startup_request.rb +8 -8
- data/lib/cassandra/protocol/requests/void_query_request.rb +1 -1
- data/lib/cassandra/protocol/response.rb +3 -4
- data/lib/cassandra/protocol/responses/already_exists_error_response.rb +12 -2
- data/lib/cassandra/protocol/responses/auth_challenge_response.rb +4 -5
- data/lib/cassandra/protocol/responses/auth_success_response.rb +4 -5
- data/lib/cassandra/protocol/responses/authenticate_response.rb +4 -5
- data/lib/cassandra/protocol/responses/error_response.rb +104 -17
- data/lib/cassandra/protocol/responses/event_response.rb +3 -4
- data/lib/cassandra/protocol/responses/function_failure_error_response.rb +13 -2
- data/lib/cassandra/protocol/responses/prepared_result_response.rb +14 -9
- data/lib/cassandra/protocol/responses/raw_rows_result_response.rb +14 -9
- data/lib/cassandra/protocol/responses/read_failure_error_response.rb +26 -4
- data/lib/cassandra/protocol/responses/read_timeout_error_response.rb +22 -3
- data/lib/cassandra/protocol/responses/ready_response.rb +6 -7
- data/lib/cassandra/protocol/responses/result_response.rb +11 -10
- data/lib/cassandra/protocol/responses/rows_result_response.rb +8 -7
- data/lib/cassandra/protocol/responses/schema_change_event_response.rb +8 -8
- data/lib/cassandra/protocol/responses/schema_change_result_response.rb +19 -13
- data/lib/cassandra/protocol/responses/set_keyspace_result_response.rb +5 -6
- data/lib/cassandra/protocol/responses/status_change_event_response.rb +5 -6
- data/lib/cassandra/protocol/responses/supported_response.rb +4 -5
- data/lib/cassandra/protocol/responses/topology_change_event_response.rb +4 -5
- data/lib/cassandra/protocol/responses/unavailable_error_response.rb +20 -3
- data/lib/cassandra/protocol/responses/unprepared_error_response.rb +11 -2
- data/lib/cassandra/protocol/responses/void_result_response.rb +4 -5
- data/lib/cassandra/protocol/responses/write_failure_error_response.rb +26 -4
- data/lib/cassandra/protocol/responses/write_timeout_error_response.rb +22 -3
- data/lib/cassandra/protocol/v1.rb +98 -37
- data/lib/cassandra/protocol/v3.rb +121 -50
- data/lib/cassandra/protocol/v4.rb +172 -68
- data/lib/cassandra/reconnection.rb +1 -1
- data/lib/cassandra/reconnection/policies.rb +1 -1
- data/lib/cassandra/reconnection/policies/constant.rb +2 -4
- data/lib/cassandra/reconnection/policies/exponential.rb +6 -6
- data/lib/cassandra/result.rb +55 -20
- data/lib/cassandra/retry.rb +8 -8
- data/lib/cassandra/retry/policies.rb +1 -1
- data/lib/cassandra/retry/policies/default.rb +1 -1
- data/lib/cassandra/retry/policies/downgrading_consistency.rb +4 -2
- data/lib/cassandra/retry/policies/fallthrough.rb +1 -1
- data/lib/cassandra/session.rb +24 -16
- data/lib/cassandra/statement.rb +1 -1
- data/lib/cassandra/statements.rb +1 -1
- data/lib/cassandra/statements/batch.rb +16 -10
- data/lib/cassandra/statements/bound.rb +10 -3
- data/lib/cassandra/statements/prepared.rb +62 -18
- data/lib/cassandra/statements/simple.rb +23 -10
- data/lib/cassandra/statements/void.rb +1 -1
- data/lib/cassandra/table.rb +53 -185
- data/lib/cassandra/time.rb +11 -6
- data/lib/cassandra/time_uuid.rb +12 -14
- data/lib/cassandra/timestamp_generator.rb +37 -0
- data/lib/cassandra/timestamp_generator/simple.rb +38 -0
- data/lib/cassandra/timestamp_generator/ticking_on_duplicate.rb +58 -0
- data/lib/cassandra/tuple.rb +4 -4
- data/lib/cassandra/types.rb +109 -71
- data/lib/cassandra/udt.rb +66 -50
- data/lib/cassandra/util.rb +155 -15
- data/lib/cassandra/uuid.rb +20 -21
- data/lib/cassandra/uuid/generator.rb +7 -5
- data/lib/cassandra/version.rb +2 -2
- data/lib/cassandra_murmur3.jar +0 -0
- data/lib/datastax/cassandra.rb +1 -1
- metadata +27 -16
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright 2013-
|
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,
|
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,
|
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-
|
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
|
26
|
+
rs.is_a?(self.class)
|
24
27
|
end
|
25
|
-
|
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-
|
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
|
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-
|
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
|
29
|
+
@rows = rows
|
30
|
+
@metadata = metadata
|
31
|
+
@paging_state = paging_state
|
27
32
|
end
|
28
33
|
|
29
34
|
def to_s
|
30
|
-
%(RESULT 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-
|
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
|
-
|
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
|
65
|
+
%(EVENT SCHEMA_CHANGE #{@change} #{@target} "#{@keyspace}" "#{@name}" ) \
|
66
|
+
"#{@arguments}"
|
63
67
|
else
|
64
|
-
%(EVENT SCHEMA_CHANGE
|
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-
|
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
|
-
|
22
|
+
# @private
|
23
|
+
RESULT_TYPES[0x05] = self
|
24
|
+
|
25
|
+
attr_reader :arguments, :change, :keyspace, :name, :target, :type
|
23
26
|
|
24
|
-
def initialize(custom_payload,
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
46
|
+
@keyspace == other.keyspace &&
|
47
|
+
@name == other.name &&
|
48
|
+
@target == other.target &&
|
49
|
+
@arguments == other.arguments
|
40
50
|
end
|
41
|
-
|
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
|
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-
|
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 "
|
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-
|
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
|
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-
|
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-
|
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-
|
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,
|
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,
|
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-
|
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,
|
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
|