]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | /** |
2 | * Autogenerated by Thrift Compiler (0.14.0) | |
3 | * | |
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING | |
5 | * @generated | |
6 | */ | |
7 | #ifndef ZipkinCollector_H | |
8 | #define ZipkinCollector_H | |
9 | ||
10 | #include <thrift/TDispatchProcessor.h> | |
11 | #include <thrift/async/TConcurrentClientSyncInfo.h> | |
12 | #include <memory> | |
13 | #include "zipkincore_types.h" | |
14 | ||
15 | namespace twitter { namespace zipkin { namespace thrift { | |
16 | ||
17 | #ifdef _MSC_VER | |
18 | #pragma warning( push ) | |
19 | #pragma warning (disable : 4250 ) //inheriting methods via dominance | |
20 | #endif | |
21 | ||
22 | class ZipkinCollectorIf { | |
23 | public: | |
24 | virtual ~ZipkinCollectorIf() {} | |
25 | virtual void submitZipkinBatch(std::vector<Response> & _return, const std::vector<Span> & spans) = 0; | |
26 | }; | |
27 | ||
28 | class ZipkinCollectorIfFactory { | |
29 | public: | |
30 | typedef ZipkinCollectorIf Handler; | |
31 | ||
32 | virtual ~ZipkinCollectorIfFactory() {} | |
33 | ||
34 | virtual ZipkinCollectorIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; | |
35 | virtual void releaseHandler(ZipkinCollectorIf* /* handler */) = 0; | |
36 | }; | |
37 | ||
38 | class ZipkinCollectorIfSingletonFactory : virtual public ZipkinCollectorIfFactory { | |
39 | public: | |
40 | ZipkinCollectorIfSingletonFactory(const ::std::shared_ptr<ZipkinCollectorIf>& iface) : iface_(iface) {} | |
41 | virtual ~ZipkinCollectorIfSingletonFactory() {} | |
42 | ||
43 | virtual ZipkinCollectorIf* getHandler(const ::apache::thrift::TConnectionInfo&) { | |
44 | return iface_.get(); | |
45 | } | |
46 | virtual void releaseHandler(ZipkinCollectorIf* /* handler */) {} | |
47 | ||
48 | protected: | |
49 | ::std::shared_ptr<ZipkinCollectorIf> iface_; | |
50 | }; | |
51 | ||
52 | class ZipkinCollectorNull : virtual public ZipkinCollectorIf { | |
53 | public: | |
54 | virtual ~ZipkinCollectorNull() {} | |
55 | void submitZipkinBatch(std::vector<Response> & /* _return */, const std::vector<Span> & /* spans */) { | |
56 | return; | |
57 | } | |
58 | }; | |
59 | ||
60 | typedef struct _ZipkinCollector_submitZipkinBatch_args__isset { | |
61 | _ZipkinCollector_submitZipkinBatch_args__isset() : spans(false) {} | |
62 | bool spans :1; | |
63 | } _ZipkinCollector_submitZipkinBatch_args__isset; | |
64 | ||
65 | class ZipkinCollector_submitZipkinBatch_args { | |
66 | public: | |
67 | ||
68 | ZipkinCollector_submitZipkinBatch_args(const ZipkinCollector_submitZipkinBatch_args&); | |
69 | ZipkinCollector_submitZipkinBatch_args& operator=(const ZipkinCollector_submitZipkinBatch_args&); | |
70 | ZipkinCollector_submitZipkinBatch_args() { | |
71 | } | |
72 | ||
73 | virtual ~ZipkinCollector_submitZipkinBatch_args() noexcept; | |
74 | std::vector<Span> spans; | |
75 | ||
76 | _ZipkinCollector_submitZipkinBatch_args__isset __isset; | |
77 | ||
78 | void __set_spans(const std::vector<Span> & val); | |
79 | ||
80 | bool operator == (const ZipkinCollector_submitZipkinBatch_args & rhs) const | |
81 | { | |
82 | if (!(spans == rhs.spans)) | |
83 | return false; | |
84 | return true; | |
85 | } | |
86 | bool operator != (const ZipkinCollector_submitZipkinBatch_args &rhs) const { | |
87 | return !(*this == rhs); | |
88 | } | |
89 | ||
90 | bool operator < (const ZipkinCollector_submitZipkinBatch_args & ) const; | |
91 | ||
92 | uint32_t read(::apache::thrift::protocol::TProtocol* iprot); | |
93 | uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; | |
94 | ||
95 | }; | |
96 | ||
97 | ||
98 | class ZipkinCollector_submitZipkinBatch_pargs { | |
99 | public: | |
100 | ||
101 | ||
102 | virtual ~ZipkinCollector_submitZipkinBatch_pargs() noexcept; | |
103 | const std::vector<Span> * spans; | |
104 | ||
105 | uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; | |
106 | ||
107 | }; | |
108 | ||
109 | typedef struct _ZipkinCollector_submitZipkinBatch_result__isset { | |
110 | _ZipkinCollector_submitZipkinBatch_result__isset() : success(false) {} | |
111 | bool success :1; | |
112 | } _ZipkinCollector_submitZipkinBatch_result__isset; | |
113 | ||
114 | class ZipkinCollector_submitZipkinBatch_result { | |
115 | public: | |
116 | ||
117 | ZipkinCollector_submitZipkinBatch_result(const ZipkinCollector_submitZipkinBatch_result&); | |
118 | ZipkinCollector_submitZipkinBatch_result& operator=(const ZipkinCollector_submitZipkinBatch_result&); | |
119 | ZipkinCollector_submitZipkinBatch_result() { | |
120 | } | |
121 | ||
122 | virtual ~ZipkinCollector_submitZipkinBatch_result() noexcept; | |
123 | std::vector<Response> success; | |
124 | ||
125 | _ZipkinCollector_submitZipkinBatch_result__isset __isset; | |
126 | ||
127 | void __set_success(const std::vector<Response> & val); | |
128 | ||
129 | bool operator == (const ZipkinCollector_submitZipkinBatch_result & rhs) const | |
130 | { | |
131 | if (!(success == rhs.success)) | |
132 | return false; | |
133 | return true; | |
134 | } | |
135 | bool operator != (const ZipkinCollector_submitZipkinBatch_result &rhs) const { | |
136 | return !(*this == rhs); | |
137 | } | |
138 | ||
139 | bool operator < (const ZipkinCollector_submitZipkinBatch_result & ) const; | |
140 | ||
141 | uint32_t read(::apache::thrift::protocol::TProtocol* iprot); | |
142 | uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; | |
143 | ||
144 | }; | |
145 | ||
146 | typedef struct _ZipkinCollector_submitZipkinBatch_presult__isset { | |
147 | _ZipkinCollector_submitZipkinBatch_presult__isset() : success(false) {} | |
148 | bool success :1; | |
149 | } _ZipkinCollector_submitZipkinBatch_presult__isset; | |
150 | ||
151 | class ZipkinCollector_submitZipkinBatch_presult { | |
152 | public: | |
153 | ||
154 | ||
155 | virtual ~ZipkinCollector_submitZipkinBatch_presult() noexcept; | |
156 | std::vector<Response> * success; | |
157 | ||
158 | _ZipkinCollector_submitZipkinBatch_presult__isset __isset; | |
159 | ||
160 | uint32_t read(::apache::thrift::protocol::TProtocol* iprot); | |
161 | ||
162 | }; | |
163 | ||
164 | class ZipkinCollectorClient : virtual public ZipkinCollectorIf { | |
165 | public: | |
166 | ZipkinCollectorClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { | |
167 | setProtocol(prot); | |
168 | } | |
169 | ZipkinCollectorClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { | |
170 | setProtocol(iprot,oprot); | |
171 | } | |
172 | private: | |
173 | void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { | |
174 | setProtocol(prot,prot); | |
175 | } | |
176 | void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { | |
177 | piprot_=iprot; | |
178 | poprot_=oprot; | |
179 | iprot_ = iprot.get(); | |
180 | oprot_ = oprot.get(); | |
181 | } | |
182 | public: | |
183 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { | |
184 | return piprot_; | |
185 | } | |
186 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { | |
187 | return poprot_; | |
188 | } | |
189 | void submitZipkinBatch(std::vector<Response> & _return, const std::vector<Span> & spans); | |
190 | void send_submitZipkinBatch(const std::vector<Span> & spans); | |
191 | void recv_submitZipkinBatch(std::vector<Response> & _return); | |
192 | protected: | |
193 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; | |
194 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; | |
195 | ::apache::thrift::protocol::TProtocol* iprot_; | |
196 | ::apache::thrift::protocol::TProtocol* oprot_; | |
197 | }; | |
198 | ||
199 | class ZipkinCollectorProcessor : public ::apache::thrift::TDispatchProcessor { | |
200 | protected: | |
201 | ::std::shared_ptr<ZipkinCollectorIf> iface_; | |
202 | virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext); | |
203 | private: | |
204 | typedef void (ZipkinCollectorProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); | |
205 | typedef std::map<std::string, ProcessFunction> ProcessMap; | |
206 | ProcessMap processMap_; | |
207 | void process_submitZipkinBatch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); | |
208 | public: | |
209 | ZipkinCollectorProcessor(::std::shared_ptr<ZipkinCollectorIf> iface) : | |
210 | iface_(iface) { | |
211 | processMap_["submitZipkinBatch"] = &ZipkinCollectorProcessor::process_submitZipkinBatch; | |
212 | } | |
213 | ||
214 | virtual ~ZipkinCollectorProcessor() {} | |
215 | }; | |
216 | ||
217 | class ZipkinCollectorProcessorFactory : public ::apache::thrift::TProcessorFactory { | |
218 | public: | |
219 | ZipkinCollectorProcessorFactory(const ::std::shared_ptr< ZipkinCollectorIfFactory >& handlerFactory) : | |
220 | handlerFactory_(handlerFactory) {} | |
221 | ||
222 | ::std::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); | |
223 | ||
224 | protected: | |
225 | ::std::shared_ptr< ZipkinCollectorIfFactory > handlerFactory_; | |
226 | }; | |
227 | ||
228 | class ZipkinCollectorMultiface : virtual public ZipkinCollectorIf { | |
229 | public: | |
230 | ZipkinCollectorMultiface(std::vector<std::shared_ptr<ZipkinCollectorIf> >& ifaces) : ifaces_(ifaces) { | |
231 | } | |
232 | virtual ~ZipkinCollectorMultiface() {} | |
233 | protected: | |
234 | std::vector<std::shared_ptr<ZipkinCollectorIf> > ifaces_; | |
235 | ZipkinCollectorMultiface() {} | |
236 | void add(::std::shared_ptr<ZipkinCollectorIf> iface) { | |
237 | ifaces_.push_back(iface); | |
238 | } | |
239 | public: | |
240 | void submitZipkinBatch(std::vector<Response> & _return, const std::vector<Span> & spans) { | |
241 | size_t sz = ifaces_.size(); | |
242 | size_t i = 0; | |
243 | for (; i < (sz - 1); ++i) { | |
244 | ifaces_[i]->submitZipkinBatch(_return, spans); | |
245 | } | |
246 | ifaces_[i]->submitZipkinBatch(_return, spans); | |
247 | return; | |
248 | } | |
249 | ||
250 | }; | |
251 | ||
252 | // The 'concurrent' client is a thread safe client that correctly handles | |
253 | // out of order responses. It is slower than the regular client, so should | |
254 | // only be used when you need to share a connection among multiple threads | |
255 | class ZipkinCollectorConcurrentClient : virtual public ZipkinCollectorIf { | |
256 | public: | |
257 | ZipkinCollectorConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot, std::shared_ptr<::apache::thrift::async::TConcurrentClientSyncInfo> sync) : sync_(sync) | |
258 | { | |
259 | setProtocol(prot); | |
260 | } | |
261 | ZipkinCollectorConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot, std::shared_ptr<::apache::thrift::async::TConcurrentClientSyncInfo> sync) : sync_(sync) | |
262 | { | |
263 | setProtocol(iprot,oprot); | |
264 | } | |
265 | private: | |
266 | void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { | |
267 | setProtocol(prot,prot); | |
268 | } | |
269 | void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { | |
270 | piprot_=iprot; | |
271 | poprot_=oprot; | |
272 | iprot_ = iprot.get(); | |
273 | oprot_ = oprot.get(); | |
274 | } | |
275 | public: | |
276 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { | |
277 | return piprot_; | |
278 | } | |
279 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { | |
280 | return poprot_; | |
281 | } | |
282 | void submitZipkinBatch(std::vector<Response> & _return, const std::vector<Span> & spans); | |
283 | int32_t send_submitZipkinBatch(const std::vector<Span> & spans); | |
284 | void recv_submitZipkinBatch(std::vector<Response> & _return, const int32_t seqid); | |
285 | protected: | |
286 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; | |
287 | std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; | |
288 | ::apache::thrift::protocol::TProtocol* iprot_; | |
289 | ::apache::thrift::protocol::TProtocol* oprot_; | |
290 | std::shared_ptr<::apache::thrift::async::TConcurrentClientSyncInfo> sync_; | |
291 | }; | |
292 | ||
293 | #ifdef _MSC_VER | |
294 | #pragma warning( pop ) | |
295 | #endif | |
296 | ||
297 | }}} // namespace | |
298 | ||
299 | #endif |