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.
- checksums.yaml +8 -8
- data/README.md +90 -38
- data/ext/cassandra_murmur3/cassandra_murmur3.c +1 -1
- data/lib/cassandra.rb +327 -130
- 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/auth.rb +4 -4
- data/lib/cassandra/auth/providers.rb +1 -1
- data/lib/cassandra/auth/providers/password.rb +9 -5
- data/lib/cassandra/cassandra_logger.rb +80 -0
- data/lib/cassandra/cluster.rb +38 -9
- data/lib/cassandra/cluster/client.rb +801 -205
- data/lib/cassandra/cluster/connection_pool.rb +2 -2
- data/lib/cassandra/cluster/connector.rb +74 -25
- data/lib/cassandra/cluster/control_connection.rb +217 -82
- data/lib/cassandra/cluster/failed_connection.rb +1 -1
- data/lib/cassandra/cluster/metadata.rb +12 -4
- data/lib/cassandra/cluster/options.rb +60 -11
- data/lib/cassandra/cluster/registry.rb +69 -16
- data/lib/cassandra/cluster/schema.rb +25 -7
- data/lib/cassandra/cluster/schema/cql_type_parser.rb +15 -10
- data/lib/cassandra/cluster/schema/fetchers.rb +263 -106
- data/lib/cassandra/cluster/schema/fqcn_type_parser.rb +41 -36
- data/lib/cassandra/cluster/schema/partitioners.rb +1 -1
- data/lib/cassandra/cluster/schema/partitioners/murmur3.rb +3 -3
- 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 +3 -3
- data/lib/cassandra/compression.rb +1 -1
- data/lib/cassandra/compression/compressors/lz4.rb +4 -3
- data/lib/cassandra/compression/compressors/snappy.rb +4 -3
- data/lib/cassandra/driver.rb +103 -41
- data/lib/cassandra/errors.rb +265 -30
- data/lib/cassandra/execution/info.rb +16 -5
- data/lib/cassandra/execution/options.rb +99 -54
- 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 +106 -48
- data/lib/cassandra/host.rb +10 -4
- data/lib/cassandra/keyspace.rb +90 -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 +18 -18
- data/lib/cassandra/load_balancing/policies/round_robin.rb +1 -1
- data/lib/cassandra/load_balancing/policies/token_aware.rb +15 -13
- data/lib/cassandra/load_balancing/policies/white_list.rb +11 -5
- data/lib/cassandra/null_logger.rb +27 -6
- data/lib/cassandra/protocol.rb +1 -1
- data/lib/cassandra/protocol/coder.rb +78 -39
- data/lib/cassandra/protocol/cql_byte_buffer.rb +50 -33
- data/lib/cassandra/protocol/cql_protocol_handler.rb +44 -45
- data/lib/cassandra/protocol/request.rb +2 -2
- data/lib/cassandra/protocol/requests/auth_response_request.rb +3 -3
- data/lib/cassandra/protocol/requests/batch_request.rb +16 -7
- data/lib/cassandra/protocol/requests/credentials_request.rb +3 -3
- data/lib/cassandra/protocol/requests/execute_request.rb +41 -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 +27 -22
- data/lib/cassandra/protocol/requests/register_request.rb +2 -2
- data/lib/cassandra/protocol/requests/startup_request.rb +6 -4
- data/lib/cassandra/protocol/requests/void_query_request.rb +1 -1
- data/lib/cassandra/protocol/response.rb +2 -2
- data/lib/cassandra/protocol/responses/already_exists_error_response.rb +12 -2
- data/lib/cassandra/protocol/responses/auth_challenge_response.rb +1 -1
- data/lib/cassandra/protocol/responses/auth_success_response.rb +1 -1
- data/lib/cassandra/protocol/responses/authenticate_response.rb +1 -1
- data/lib/cassandra/protocol/responses/error_response.rb +101 -13
- data/lib/cassandra/protocol/responses/event_response.rb +1 -1
- data/lib/cassandra/protocol/responses/function_failure_error_response.rb +13 -2
- data/lib/cassandra/protocol/responses/prepared_result_response.rb +11 -5
- 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 +3 -3
- data/lib/cassandra/protocol/responses/result_response.rb +4 -2
- data/lib/cassandra/protocol/responses/rows_result_response.rb +5 -3
- data/lib/cassandra/protocol/responses/schema_change_event_response.rb +5 -4
- data/lib/cassandra/protocol/responses/schema_change_result_response.rb +16 -9
- data/lib/cassandra/protocol/responses/set_keyspace_result_response.rb +2 -2
- data/lib/cassandra/protocol/responses/status_change_event_response.rb +2 -2
- data/lib/cassandra/protocol/responses/supported_response.rb +1 -1
- data/lib/cassandra/protocol/responses/topology_change_event_response.rb +1 -1
- 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 +1 -1
- 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 +101 -36
- data/lib/cassandra/protocol/v3.rb +124 -51
- 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 +53 -19
- 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 +7 -3
- data/lib/cassandra/retry/policies/fallthrough.rb +1 -1
- data/lib/cassandra/session.rb +22 -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 +59 -15
- data/lib/cassandra/statements/simple.rb +23 -10
- data/lib/cassandra/statements/void.rb +1 -1
- data/lib/cassandra/table.rb +79 -30
- data/lib/cassandra/time.rb +11 -6
- data/lib/cassandra/time_uuid.rb +7 -7
- data/lib/cassandra/tuple.rb +16 -8
- data/lib/cassandra/types.rb +20 -9
- data/lib/cassandra/udt.rb +32 -36
- data/lib/cassandra/util.rb +20 -13
- data/lib/cassandra/uuid.rb +22 -15
- data/lib/cassandra/uuid/generator.rb +7 -5
- data/lib/cassandra/version.rb +2 -2
- data/lib/datastax/cassandra.rb +1 -1
- metadata +5 -3
@@ -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.
|
@@ -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,
|
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-
|
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,
|
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
|
-
|
39
|
+
id == other.id && metadata == other.metadata && trace_id == other.trace_id
|
34
40
|
end
|
35
|
-
|
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}
|
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-
|
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,
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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-
|
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,
|
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,
|
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}
|
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-
|
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.
|
@@ -20,9 +20,9 @@ module Cassandra
|
|
20
20
|
module Protocol
|
21
21
|
class ReadyResponse < Response
|
22
22
|
def eql?(rs)
|
23
|
-
self.class
|
23
|
+
rs.is_a?(self.class)
|
24
24
|
end
|
25
|
-
|
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-
|
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
|
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-
|
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
|
26
|
+
@rows = rows
|
27
|
+
@metadata = metadata
|
28
|
+
@paging_state = paging_state
|
27
29
|
end
|
28
30
|
|
29
31
|
def to_s
|
30
|
-
%(RESULT 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-
|
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
|
-
|
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
|
62
|
+
%(EVENT SCHEMA_CHANGE #{@change} #{@target} "#{@keyspace}" "#{@name}" ) \
|
63
|
+
"#{@arguments}"
|
63
64
|
else
|
64
|
-
%(EVENT SCHEMA_CHANGE
|
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-
|
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, :
|
22
|
+
attr_reader :arguments, :change, :keyspace, :name, :target, :type
|
23
23
|
|
24
|
-
def initialize(custom_payload,
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
43
|
+
@keyspace == other.keyspace &&
|
44
|
+
@name == other.name &&
|
45
|
+
@target == other.target &&
|
46
|
+
@arguments == other.arguments
|
40
47
|
end
|
41
|
-
|
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
|
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-
|
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 "
|
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-
|
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
|
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-
|
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
|