upfluence-thrift 2.4.4 → 2.6.8
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.
- checksums.yaml +4 -4
- data/benchmark/gen-rb/benchmark_constants.rb +1 -1
- data/benchmark/gen-rb/benchmark_service.rb +90 -44
- data/benchmark/gen-rb/benchmark_types.rb +1 -1
- data/lib/thrift/definition.rb +33 -8
- data/lib/thrift/processor.rb +96 -0
- data/lib/thrift/types/annotation/deprecation/deprecation_constants.rb +17 -0
- data/lib/thrift/types/annotation/deprecation/deprecation_types.rb +44 -0
- data/lib/thrift/types/annotation/naming/naming.rb +23 -0
- data/lib/thrift/types/annotation/naming/naming_constants.rb +17 -0
- data/lib/thrift/types/annotation/naming/naming_types.rb +59 -0
- data/lib/thrift/types/known/{any.rb → any/any.rb} +1 -1
- data/lib/thrift/types/known/{any_constants.rb → any/any_constants.rb} +2 -2
- data/lib/thrift/types/known/{any_types.rb → any/any_types.rb} +21 -3
- data/lib/thrift/types/known/{duration.rb → duration/duration.rb} +1 -1
- data/lib/thrift/types/known/{duration_constants.rb → duration/duration_constants.rb} +2 -2
- data/lib/thrift/types/known/{duration_types.rb → duration/duration_types.rb} +21 -3
- data/lib/thrift/types/known/{timestamp.rb → timestamp/timestamp.rb} +1 -1
- data/lib/thrift/types/known/{timestamp_constants.rb → timestamp/timestamp_constants.rb} +2 -2
- data/lib/thrift/types/known/{timestamp_types.rb → timestamp/timestamp_types.rb} +21 -3
- data/lib/thrift/types/{value.rb → value/value.rb} +1 -1
- data/lib/thrift/types/{value_constants.rb → value/value_constants.rb} +2 -2
- data/lib/thrift/types/{value_types.rb → value/value_types.rb} +135 -15
- data/lib/thrift.rb +5 -0
- data/spec/gen-rb/base/base_service.rb +90 -44
- data/spec/gen-rb/base/base_service_constants.rb +1 -1
- data/spec/gen-rb/base/base_service_types.rb +14 -2
- data/spec/gen-rb/extended/extended_service.rb +74 -40
- data/spec/gen-rb/extended/extended_service_constants.rb +1 -1
- data/spec/gen-rb/extended/extended_service_types.rb +1 -1
- data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +285 -121
- data/spec/gen-rb/flat/referenced_constants.rb +1 -1
- data/spec/gen-rb/flat/referenced_types.rb +1 -1
- data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +1 -1
- data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +14 -2
- data/spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb +285 -121
- data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb +1 -1
- data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb +14 -2
- data/spec/gen-rb/nonblocking_service.rb +285 -121
- data/spec/gen-rb/other_namespace/referenced_constants.rb +1 -1
- data/spec/gen-rb/other_namespace/referenced_types.rb +1 -1
- data/spec/gen-rb/thrift_spec_constants.rb +1 -1
- data/spec/gen-rb/thrift_spec_types.rb +531 -57
- data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +71 -71
- data/test/debug_proto/gen-rb/debug_proto_test_types.rb +1180 -148
- data/test/debug_proto/gen-rb/empty_service.rb +12 -3
- data/test/debug_proto/gen-rb/inherited.rb +90 -44
- data/test/debug_proto/gen-rb/reverse_order_service.rb +102 -44
- data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +86 -46
- data/test/debug_proto/gen-rb/srv.rb +339 -150
- metadata +45 -35
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (
|
2
|
+
# Autogenerated by Thrift Compiler ()
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
@@ -11,6 +11,14 @@ module EmptyService
|
|
11
11
|
SERVICE = 'EmptyService'.freeze
|
12
12
|
NAMESPACE = ''.freeze
|
13
13
|
|
14
|
+
LEGACY_ANNOTATIONS = {
|
15
|
+
}.freeze
|
16
|
+
|
17
|
+
STRUCTURED_ANNOTATIONS = [
|
18
|
+
].freeze
|
19
|
+
|
20
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
21
|
+
|
14
22
|
class Client
|
15
23
|
def initialize(client)
|
16
24
|
@client = ::Thrift.build_client(client)
|
@@ -29,9 +37,10 @@ module EmptyService
|
|
29
37
|
provider.build(NAMESPACE, SERVICE, Processor, handler)
|
30
38
|
end
|
31
39
|
|
32
|
-
|
40
|
+
METHODS = {
|
41
|
+
}.freeze
|
33
42
|
|
34
|
-
|
43
|
+
end
|
35
44
|
|
36
45
|
::Thrift.register_service_type(self)
|
37
46
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (
|
2
|
+
# Autogenerated by Thrift Compiler ()
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
@@ -12,48 +12,11 @@ module Inherited
|
|
12
12
|
SERVICE = 'Inherited'.freeze
|
13
13
|
NAMESPACE = ''.freeze
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
@client = ::Thrift.build_client(client)
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.from_provider(provider)
|
21
|
-
Client.new(provider.build(NAMESPACE, SERVICE))
|
22
|
-
end
|
23
|
-
|
24
|
-
def identity(arg)
|
25
|
-
result = @client.call_binary(
|
26
|
-
'identity',
|
27
|
-
Identity_args.new(arg: arg),
|
28
|
-
Identity_result
|
29
|
-
)
|
30
|
-
|
31
|
-
return result.success unless result.success.nil?
|
32
|
-
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'identity failed: unknown result')
|
33
|
-
result
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
15
|
+
LEGACY_ANNOTATIONS = {
|
16
|
+
}.freeze
|
37
17
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
def self.from_provider(handler, provider)
|
42
|
-
provider.build(NAMESPACE, SERVICE, Processor, handler)
|
43
|
-
end
|
44
|
-
|
45
|
-
def process_identity(seqid, iprot, oprot)
|
46
|
-
args = read_args(iprot, Identity_args)
|
47
|
-
result = @middleware.handle_binary('identity', args) do |args|
|
48
|
-
result = Identity_result.new()
|
49
|
-
result.success = @handler.identity(args.arg)
|
50
|
-
result
|
51
|
-
end
|
52
|
-
|
53
|
-
write_result(result, oprot, 'identity', seqid)
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
18
|
+
STRUCTURED_ANNOTATIONS = [
|
19
|
+
].freeze
|
57
20
|
|
58
21
|
# HELPER FUNCTIONS AND STRUCTURES
|
59
22
|
|
@@ -63,10 +26,22 @@ module Inherited
|
|
63
26
|
NAME = 'identity_args'.freeze
|
64
27
|
NAMESPACE = ''.freeze
|
65
28
|
|
29
|
+
LEGACY_ANNOTATIONS = {
|
30
|
+
}.freeze
|
31
|
+
|
32
|
+
STRUCTURED_ANNOTATIONS = [
|
33
|
+
].freeze
|
34
|
+
|
66
35
|
THRIFT_FIELD_INDEX_ARG = 1
|
67
36
|
|
37
|
+
THRIFT_FIELD_ARG_LEGACY_ANNOTATIONS = {
|
38
|
+
}.freeze
|
39
|
+
|
40
|
+
THRIFT_FIELD_ARG_STRUCTURED_ANNOTATIONS = [
|
41
|
+
].freeze
|
42
|
+
|
68
43
|
FIELDS = {
|
69
|
-
THRIFT_FIELD_INDEX_ARG => {type: ::Thrift::Types::I32, name: 'arg'}
|
44
|
+
THRIFT_FIELD_INDEX_ARG => {type: ::Thrift::Types::I32, name: 'arg', legacy_annotations: THRIFT_FIELD_ARG_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ARG_STRUCTURED_ANNOTATIONS}
|
70
45
|
}
|
71
46
|
|
72
47
|
def struct_fields; FIELDS; end
|
@@ -84,10 +59,22 @@ module Inherited
|
|
84
59
|
NAME = 'identity_result'.freeze
|
85
60
|
NAMESPACE = ''.freeze
|
86
61
|
|
62
|
+
LEGACY_ANNOTATIONS = {
|
63
|
+
}.freeze
|
64
|
+
|
65
|
+
STRUCTURED_ANNOTATIONS = [
|
66
|
+
].freeze
|
67
|
+
|
87
68
|
THRIFT_FIELD_INDEX_SUCCESS = 0
|
88
69
|
|
70
|
+
THRIFT_FIELD_SUCCESS_LEGACY_ANNOTATIONS = {
|
71
|
+
}.freeze
|
72
|
+
|
73
|
+
THRIFT_FIELD_SUCCESS_STRUCTURED_ANNOTATIONS = [
|
74
|
+
].freeze
|
75
|
+
|
89
76
|
FIELDS = {
|
90
|
-
THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::I32, name: 'success'}
|
77
|
+
THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::I32, name: 'success', legacy_annotations: THRIFT_FIELD_SUCCESS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_SUCCESS_STRUCTURED_ANNOTATIONS}
|
91
78
|
}
|
92
79
|
|
93
80
|
def struct_fields; FIELDS; end
|
@@ -99,6 +86,65 @@ module Inherited
|
|
99
86
|
::Thrift.register_struct_type self
|
100
87
|
end
|
101
88
|
|
89
|
+
class Client < ::Srv::Client
|
90
|
+
def initialize(client)
|
91
|
+
@client = ::Thrift.build_client(client)
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.from_provider(provider)
|
95
|
+
Client.new(provider.build(NAMESPACE, SERVICE))
|
96
|
+
end
|
97
|
+
|
98
|
+
def identity(arg)
|
99
|
+
result = @client.call_binary(
|
100
|
+
'identity',
|
101
|
+
Identity_args.new(arg: arg),
|
102
|
+
Identity_result
|
103
|
+
)
|
104
|
+
|
105
|
+
return result.success unless result.success.nil?
|
106
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'identity failed: unknown result')
|
107
|
+
result
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
class Processor < ::Srv::Processor
|
113
|
+
include ::Thrift::Processor
|
114
|
+
|
115
|
+
def self.from_provider(handler, provider)
|
116
|
+
provider.build(NAMESPACE, SERVICE, Processor, handler)
|
117
|
+
end
|
118
|
+
|
119
|
+
THRIFT_METHOD_IDENTITY_LEGACY_ANNOTATIONS = {
|
120
|
+
}.freeze
|
121
|
+
|
122
|
+
THRIFT_METHOD_IDENTITY_STRUCTURED_ANNOTATIONS = [
|
123
|
+
].freeze
|
124
|
+
|
125
|
+
METHODS = {
|
126
|
+
'identity' => { args_klass: Identity_args, oneway: false, legacy_annotations: THRIFT_METHOD_IDENTITY_STRUCTURED_ANNOTATIONS, structured_annotations: THRIFT_METHOD_IDENTITY_STRUCTURED_ANNOTATIONS},
|
127
|
+
}.freeze
|
128
|
+
|
129
|
+
def execute_identity(args)
|
130
|
+
result = Identity_result.new()
|
131
|
+
|
132
|
+
result.success = @handler.identity(args.arg)
|
133
|
+
|
134
|
+
result
|
135
|
+
end
|
136
|
+
|
137
|
+
def process_identity(seqid, iprot, oprot)
|
138
|
+
args = read_args(iprot, Identity_args)
|
139
|
+
result = @middleware.handle_binary('identity', args) do |args|
|
140
|
+
execute_identity(args)
|
141
|
+
end
|
142
|
+
|
143
|
+
write_result(result, oprot, 'identity', seqid)
|
144
|
+
end
|
145
|
+
|
146
|
+
end
|
147
|
+
|
102
148
|
::Thrift.register_service_type(self)
|
103
149
|
|
104
150
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (
|
2
|
+
# Autogenerated by Thrift Compiler ()
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
@@ -11,46 +11,11 @@ module ReverseOrderService
|
|
11
11
|
SERVICE = 'ReverseOrderService'.freeze
|
12
12
|
NAMESPACE = ''.freeze
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
@client = ::Thrift.build_client(client)
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.from_provider(provider)
|
20
|
-
Client.new(provider.build(NAMESPACE, SERVICE))
|
21
|
-
end
|
22
|
-
|
23
|
-
def myMethod(first, second, third, fourth)
|
24
|
-
result = @client.call_binary(
|
25
|
-
'myMethod',
|
26
|
-
MyMethod_args.new(first: first, second: second, third: third, fourth: fourth),
|
27
|
-
MyMethod_result
|
28
|
-
)
|
29
|
-
|
30
|
-
nil
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
class Processor
|
36
|
-
include ::Thrift::Processor
|
14
|
+
LEGACY_ANNOTATIONS = {
|
15
|
+
}.freeze
|
37
16
|
|
38
|
-
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
def process_myMethod(seqid, iprot, oprot)
|
43
|
-
args = read_args(iprot, MyMethod_args)
|
44
|
-
result = @middleware.handle_binary('myMethod', args) do |args|
|
45
|
-
result = MyMethod_result.new()
|
46
|
-
@handler.myMethod(args.first, args.second, args.third, args.fourth)
|
47
|
-
result
|
48
|
-
end
|
49
|
-
|
50
|
-
write_result(result, oprot, 'myMethod', seqid)
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
17
|
+
STRUCTURED_ANNOTATIONS = [
|
18
|
+
].freeze
|
54
19
|
|
55
20
|
# HELPER FUNCTIONS AND STRUCTURES
|
56
21
|
|
@@ -60,16 +25,46 @@ module ReverseOrderService
|
|
60
25
|
NAME = 'myMethod_args'.freeze
|
61
26
|
NAMESPACE = ''.freeze
|
62
27
|
|
28
|
+
LEGACY_ANNOTATIONS = {
|
29
|
+
}.freeze
|
30
|
+
|
31
|
+
STRUCTURED_ANNOTATIONS = [
|
32
|
+
].freeze
|
33
|
+
|
63
34
|
THRIFT_FIELD_INDEX_FIRST = 4
|
64
35
|
THRIFT_FIELD_INDEX_SECOND = 3
|
65
36
|
THRIFT_FIELD_INDEX_THIRD = 2
|
66
37
|
THRIFT_FIELD_INDEX_FOURTH = 1
|
67
38
|
|
39
|
+
THRIFT_FIELD_FIRST_LEGACY_ANNOTATIONS = {
|
40
|
+
}.freeze
|
41
|
+
|
42
|
+
THRIFT_FIELD_FIRST_STRUCTURED_ANNOTATIONS = [
|
43
|
+
].freeze
|
44
|
+
|
45
|
+
THRIFT_FIELD_SECOND_LEGACY_ANNOTATIONS = {
|
46
|
+
}.freeze
|
47
|
+
|
48
|
+
THRIFT_FIELD_SECOND_STRUCTURED_ANNOTATIONS = [
|
49
|
+
].freeze
|
50
|
+
|
51
|
+
THRIFT_FIELD_THIRD_LEGACY_ANNOTATIONS = {
|
52
|
+
}.freeze
|
53
|
+
|
54
|
+
THRIFT_FIELD_THIRD_STRUCTURED_ANNOTATIONS = [
|
55
|
+
].freeze
|
56
|
+
|
57
|
+
THRIFT_FIELD_FOURTH_LEGACY_ANNOTATIONS = {
|
58
|
+
}.freeze
|
59
|
+
|
60
|
+
THRIFT_FIELD_FOURTH_STRUCTURED_ANNOTATIONS = [
|
61
|
+
].freeze
|
62
|
+
|
68
63
|
FIELDS = {
|
69
|
-
THRIFT_FIELD_INDEX_FIRST => {type: ::Thrift::Types::STRING, name: 'first'},
|
70
|
-
THRIFT_FIELD_INDEX_SECOND => {type: ::Thrift::Types::I16, name: 'second'},
|
71
|
-
THRIFT_FIELD_INDEX_THIRD => {type: ::Thrift::Types::I32, name: 'third'},
|
72
|
-
THRIFT_FIELD_INDEX_FOURTH => {type: ::Thrift::Types::I64, name: 'fourth'}
|
64
|
+
THRIFT_FIELD_INDEX_FIRST => {type: ::Thrift::Types::STRING, name: 'first', legacy_annotations: THRIFT_FIELD_FIRST_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_FIRST_STRUCTURED_ANNOTATIONS},
|
65
|
+
THRIFT_FIELD_INDEX_SECOND => {type: ::Thrift::Types::I16, name: 'second', legacy_annotations: THRIFT_FIELD_SECOND_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_SECOND_STRUCTURED_ANNOTATIONS},
|
66
|
+
THRIFT_FIELD_INDEX_THIRD => {type: ::Thrift::Types::I32, name: 'third', legacy_annotations: THRIFT_FIELD_THIRD_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_THIRD_STRUCTURED_ANNOTATIONS},
|
67
|
+
THRIFT_FIELD_INDEX_FOURTH => {type: ::Thrift::Types::I64, name: 'fourth', legacy_annotations: THRIFT_FIELD_FOURTH_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_FOURTH_STRUCTURED_ANNOTATIONS}
|
73
68
|
}
|
74
69
|
|
75
70
|
def struct_fields; FIELDS; end
|
@@ -87,6 +82,12 @@ module ReverseOrderService
|
|
87
82
|
NAME = 'myMethod_result'.freeze
|
88
83
|
NAMESPACE = ''.freeze
|
89
84
|
|
85
|
+
LEGACY_ANNOTATIONS = {
|
86
|
+
}.freeze
|
87
|
+
|
88
|
+
STRUCTURED_ANNOTATIONS = [
|
89
|
+
].freeze
|
90
|
+
|
90
91
|
|
91
92
|
FIELDS = {
|
92
93
|
|
@@ -101,6 +102,63 @@ module ReverseOrderService
|
|
101
102
|
::Thrift.register_struct_type self
|
102
103
|
end
|
103
104
|
|
105
|
+
class Client
|
106
|
+
def initialize(client)
|
107
|
+
@client = ::Thrift.build_client(client)
|
108
|
+
end
|
109
|
+
|
110
|
+
def self.from_provider(provider)
|
111
|
+
Client.new(provider.build(NAMESPACE, SERVICE))
|
112
|
+
end
|
113
|
+
|
114
|
+
def myMethod(first, second, third, fourth)
|
115
|
+
result = @client.call_binary(
|
116
|
+
'myMethod',
|
117
|
+
MyMethod_args.new(first: first, second: second, third: third, fourth: fourth),
|
118
|
+
MyMethod_result
|
119
|
+
)
|
120
|
+
|
121
|
+
nil
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
class Processor
|
127
|
+
include ::Thrift::Processor
|
128
|
+
|
129
|
+
def self.from_provider(handler, provider)
|
130
|
+
provider.build(NAMESPACE, SERVICE, Processor, handler)
|
131
|
+
end
|
132
|
+
|
133
|
+
THRIFT_METHOD_MYMETHOD_LEGACY_ANNOTATIONS = {
|
134
|
+
}.freeze
|
135
|
+
|
136
|
+
THRIFT_METHOD_MYMETHOD_STRUCTURED_ANNOTATIONS = [
|
137
|
+
].freeze
|
138
|
+
|
139
|
+
METHODS = {
|
140
|
+
'myMethod' => { args_klass: MyMethod_args, oneway: false, legacy_annotations: THRIFT_METHOD_MYMETHOD_STRUCTURED_ANNOTATIONS, structured_annotations: THRIFT_METHOD_MYMETHOD_STRUCTURED_ANNOTATIONS},
|
141
|
+
}.freeze
|
142
|
+
|
143
|
+
def execute_myMethod(args)
|
144
|
+
result = MyMethod_result.new()
|
145
|
+
|
146
|
+
@handler.myMethod(args.first, args.second, args.third, args.fourth)
|
147
|
+
|
148
|
+
result
|
149
|
+
end
|
150
|
+
|
151
|
+
def process_myMethod(seqid, iprot, oprot)
|
152
|
+
args = read_args(iprot, MyMethod_args)
|
153
|
+
result = @middleware.handle_binary('myMethod', args) do |args|
|
154
|
+
execute_myMethod(args)
|
155
|
+
end
|
156
|
+
|
157
|
+
write_result(result, oprot, 'myMethod', seqid)
|
158
|
+
end
|
159
|
+
|
160
|
+
end
|
161
|
+
|
104
162
|
::Thrift.register_service_type(self)
|
105
163
|
|
106
164
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (
|
2
|
+
# Autogenerated by Thrift Compiler ()
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
@@ -11,51 +11,11 @@ module ServiceForExceptionWithAMap
|
|
11
11
|
SERVICE = 'ServiceForExceptionWithAMap'.freeze
|
12
12
|
NAMESPACE = ''.freeze
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
@client = ::Thrift.build_client(client)
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.from_provider(provider)
|
20
|
-
Client.new(provider.build(NAMESPACE, SERVICE))
|
21
|
-
end
|
14
|
+
LEGACY_ANNOTATIONS = {
|
15
|
+
}.freeze
|
22
16
|
|
23
|
-
|
24
|
-
|
25
|
-
'methodThatThrowsAnException',
|
26
|
-
MethodThatThrowsAnException_args.new(),
|
27
|
-
MethodThatThrowsAnException_result
|
28
|
-
)
|
29
|
-
|
30
|
-
raise result.xwamap unless result.xwamap.nil?
|
31
|
-
nil
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
class Processor
|
37
|
-
include ::Thrift::Processor
|
38
|
-
|
39
|
-
def self.from_provider(handler, provider)
|
40
|
-
provider.build(NAMESPACE, SERVICE, Processor, handler)
|
41
|
-
end
|
42
|
-
|
43
|
-
def process_methodThatThrowsAnException(seqid, iprot, oprot)
|
44
|
-
args = read_args(iprot, MethodThatThrowsAnException_args)
|
45
|
-
result = @middleware.handle_binary('methodThatThrowsAnException', args) do |args|
|
46
|
-
result = MethodThatThrowsAnException_result.new()
|
47
|
-
begin
|
48
|
-
@handler.methodThatThrowsAnException()
|
49
|
-
rescue ::ExceptionWithAMap => xwamap
|
50
|
-
result.xwamap = xwamap
|
51
|
-
end
|
52
|
-
result
|
53
|
-
end
|
54
|
-
|
55
|
-
write_result(result, oprot, 'methodThatThrowsAnException', seqid)
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
17
|
+
STRUCTURED_ANNOTATIONS = [
|
18
|
+
].freeze
|
59
19
|
|
60
20
|
# HELPER FUNCTIONS AND STRUCTURES
|
61
21
|
|
@@ -65,6 +25,12 @@ module ServiceForExceptionWithAMap
|
|
65
25
|
NAME = 'methodThatThrowsAnException_args'.freeze
|
66
26
|
NAMESPACE = ''.freeze
|
67
27
|
|
28
|
+
LEGACY_ANNOTATIONS = {
|
29
|
+
}.freeze
|
30
|
+
|
31
|
+
STRUCTURED_ANNOTATIONS = [
|
32
|
+
].freeze
|
33
|
+
|
68
34
|
|
69
35
|
FIELDS = {
|
70
36
|
|
@@ -85,10 +51,22 @@ module ServiceForExceptionWithAMap
|
|
85
51
|
NAME = 'methodThatThrowsAnException_result'.freeze
|
86
52
|
NAMESPACE = ''.freeze
|
87
53
|
|
54
|
+
LEGACY_ANNOTATIONS = {
|
55
|
+
}.freeze
|
56
|
+
|
57
|
+
STRUCTURED_ANNOTATIONS = [
|
58
|
+
].freeze
|
59
|
+
|
88
60
|
THRIFT_FIELD_INDEX_XWAMAP = 1
|
89
61
|
|
62
|
+
THRIFT_FIELD_XWAMAP_LEGACY_ANNOTATIONS = {
|
63
|
+
}.freeze
|
64
|
+
|
65
|
+
THRIFT_FIELD_XWAMAP_STRUCTURED_ANNOTATIONS = [
|
66
|
+
].freeze
|
67
|
+
|
90
68
|
FIELDS = {
|
91
|
-
THRIFT_FIELD_INDEX_XWAMAP => {type: ::Thrift::Types::STRUCT, name: 'xwamap', class: ::ExceptionWithAMap}
|
69
|
+
THRIFT_FIELD_INDEX_XWAMAP => {type: ::Thrift::Types::STRUCT, name: 'xwamap', class: ::ExceptionWithAMap, legacy_annotations: THRIFT_FIELD_XWAMAP_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_XWAMAP_STRUCTURED_ANNOTATIONS}
|
92
70
|
}
|
93
71
|
|
94
72
|
def struct_fields; FIELDS; end
|
@@ -100,6 +78,68 @@ module ServiceForExceptionWithAMap
|
|
100
78
|
::Thrift.register_struct_type self
|
101
79
|
end
|
102
80
|
|
81
|
+
class Client
|
82
|
+
def initialize(client)
|
83
|
+
@client = ::Thrift.build_client(client)
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.from_provider(provider)
|
87
|
+
Client.new(provider.build(NAMESPACE, SERVICE))
|
88
|
+
end
|
89
|
+
|
90
|
+
def methodThatThrowsAnException()
|
91
|
+
result = @client.call_binary(
|
92
|
+
'methodThatThrowsAnException',
|
93
|
+
MethodThatThrowsAnException_args.new(),
|
94
|
+
MethodThatThrowsAnException_result
|
95
|
+
)
|
96
|
+
|
97
|
+
raise result.xwamap unless result.xwamap.nil?
|
98
|
+
nil
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
class Processor
|
104
|
+
include ::Thrift::Processor
|
105
|
+
|
106
|
+
def self.from_provider(handler, provider)
|
107
|
+
provider.build(NAMESPACE, SERVICE, Processor, handler)
|
108
|
+
end
|
109
|
+
|
110
|
+
THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_LEGACY_ANNOTATIONS = {
|
111
|
+
}.freeze
|
112
|
+
|
113
|
+
THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS = [
|
114
|
+
].freeze
|
115
|
+
|
116
|
+
METHODS = {
|
117
|
+
'methodThatThrowsAnException' => { args_klass: MethodThatThrowsAnException_args, oneway: false, legacy_annotations: THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS, structured_annotations: THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS},
|
118
|
+
}.freeze
|
119
|
+
|
120
|
+
def execute_methodThatThrowsAnException(args)
|
121
|
+
result = MethodThatThrowsAnException_result.new()
|
122
|
+
|
123
|
+
begin
|
124
|
+
@handler.methodThatThrowsAnException()
|
125
|
+
rescue ::ExceptionWithAMap => xwamap
|
126
|
+
result.xwamap = xwamap
|
127
|
+
end
|
128
|
+
|
129
|
+
result
|
130
|
+
end
|
131
|
+
|
132
|
+
def process_methodThatThrowsAnException(seqid, iprot, oprot)
|
133
|
+
args = read_args(iprot, MethodThatThrowsAnException_args)
|
134
|
+
result = @middleware.handle_binary('methodThatThrowsAnException', args) do |args|
|
135
|
+
execute_methodThatThrowsAnException(args)
|
136
|
+
end
|
137
|
+
|
138
|
+
write_result(result, oprot, 'methodThatThrowsAnException', seqid)
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
103
143
|
::Thrift.register_service_type(self)
|
104
144
|
|
105
145
|
end
|