]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/jaeger-client-cpp/src/jaegertracing/thrift-gen/TracedService.cpp
buildsys: switch source download to quincy
[ceph.git] / ceph / src / jaegertracing / jaeger-client-cpp / src / jaegertracing / thrift-gen / TracedService.cpp
1 /**
2 * Autogenerated by Thrift Compiler (0.11.0)
3 *
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 * @generated
6 */
7 #include "TracedService.h"
8
9 namespace jaegertracing { namespace crossdock { namespace thrift {
10
11
12 TracedService_startTrace_args::~TracedService_startTrace_args() throw() {
13 }
14
15
16 uint32_t TracedService_startTrace_args::read(::apache::thrift::protocol::TProtocol* iprot) {
17
18 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
19 uint32_t xfer = 0;
20 std::string fname;
21 ::apache::thrift::protocol::TType ftype;
22 int16_t fid;
23
24 xfer += iprot->readStructBegin(fname);
25
26 using ::apache::thrift::protocol::TProtocolException;
27
28
29 while (true)
30 {
31 xfer += iprot->readFieldBegin(fname, ftype, fid);
32 if (ftype == ::apache::thrift::protocol::T_STOP) {
33 break;
34 }
35 switch (fid)
36 {
37 case 1:
38 if (ftype == ::apache::thrift::protocol::T_STRUCT) {
39 xfer += this->request.read(iprot);
40 this->__isset.request = true;
41 } else {
42 xfer += iprot->skip(ftype);
43 }
44 break;
45 default:
46 xfer += iprot->skip(ftype);
47 break;
48 }
49 xfer += iprot->readFieldEnd();
50 }
51
52 xfer += iprot->readStructEnd();
53
54 return xfer;
55 }
56
57 uint32_t TracedService_startTrace_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
58 uint32_t xfer = 0;
59 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
60 xfer += oprot->writeStructBegin("TracedService_startTrace_args");
61
62 xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1);
63 xfer += this->request.write(oprot);
64 xfer += oprot->writeFieldEnd();
65
66 xfer += oprot->writeFieldStop();
67 xfer += oprot->writeStructEnd();
68 return xfer;
69 }
70
71
72 TracedService_startTrace_pargs::~TracedService_startTrace_pargs() throw() {
73 }
74
75
76 uint32_t TracedService_startTrace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
77 uint32_t xfer = 0;
78 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
79 xfer += oprot->writeStructBegin("TracedService_startTrace_pargs");
80
81 xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1);
82 xfer += (*(this->request)).write(oprot);
83 xfer += oprot->writeFieldEnd();
84
85 xfer += oprot->writeFieldStop();
86 xfer += oprot->writeStructEnd();
87 return xfer;
88 }
89
90
91 TracedService_startTrace_result::~TracedService_startTrace_result() throw() {
92 }
93
94
95 uint32_t TracedService_startTrace_result::read(::apache::thrift::protocol::TProtocol* iprot) {
96
97 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
98 uint32_t xfer = 0;
99 std::string fname;
100 ::apache::thrift::protocol::TType ftype;
101 int16_t fid;
102
103 xfer += iprot->readStructBegin(fname);
104
105 using ::apache::thrift::protocol::TProtocolException;
106
107
108 while (true)
109 {
110 xfer += iprot->readFieldBegin(fname, ftype, fid);
111 if (ftype == ::apache::thrift::protocol::T_STOP) {
112 break;
113 }
114 switch (fid)
115 {
116 case 0:
117 if (ftype == ::apache::thrift::protocol::T_STRUCT) {
118 xfer += this->success.read(iprot);
119 this->__isset.success = true;
120 } else {
121 xfer += iprot->skip(ftype);
122 }
123 break;
124 default:
125 xfer += iprot->skip(ftype);
126 break;
127 }
128 xfer += iprot->readFieldEnd();
129 }
130
131 xfer += iprot->readStructEnd();
132
133 return xfer;
134 }
135
136 uint32_t TracedService_startTrace_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
137
138 uint32_t xfer = 0;
139
140 xfer += oprot->writeStructBegin("TracedService_startTrace_result");
141
142 if (this->__isset.success) {
143 xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
144 xfer += this->success.write(oprot);
145 xfer += oprot->writeFieldEnd();
146 }
147 xfer += oprot->writeFieldStop();
148 xfer += oprot->writeStructEnd();
149 return xfer;
150 }
151
152
153 TracedService_startTrace_presult::~TracedService_startTrace_presult() throw() {
154 }
155
156
157 uint32_t TracedService_startTrace_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
158
159 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
160 uint32_t xfer = 0;
161 std::string fname;
162 ::apache::thrift::protocol::TType ftype;
163 int16_t fid;
164
165 xfer += iprot->readStructBegin(fname);
166
167 using ::apache::thrift::protocol::TProtocolException;
168
169
170 while (true)
171 {
172 xfer += iprot->readFieldBegin(fname, ftype, fid);
173 if (ftype == ::apache::thrift::protocol::T_STOP) {
174 break;
175 }
176 switch (fid)
177 {
178 case 0:
179 if (ftype == ::apache::thrift::protocol::T_STRUCT) {
180 xfer += (*(this->success)).read(iprot);
181 this->__isset.success = true;
182 } else {
183 xfer += iprot->skip(ftype);
184 }
185 break;
186 default:
187 xfer += iprot->skip(ftype);
188 break;
189 }
190 xfer += iprot->readFieldEnd();
191 }
192
193 xfer += iprot->readStructEnd();
194
195 return xfer;
196 }
197
198
199 TracedService_joinTrace_args::~TracedService_joinTrace_args() throw() {
200 }
201
202
203 uint32_t TracedService_joinTrace_args::read(::apache::thrift::protocol::TProtocol* iprot) {
204
205 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
206 uint32_t xfer = 0;
207 std::string fname;
208 ::apache::thrift::protocol::TType ftype;
209 int16_t fid;
210
211 xfer += iprot->readStructBegin(fname);
212
213 using ::apache::thrift::protocol::TProtocolException;
214
215
216 while (true)
217 {
218 xfer += iprot->readFieldBegin(fname, ftype, fid);
219 if (ftype == ::apache::thrift::protocol::T_STOP) {
220 break;
221 }
222 switch (fid)
223 {
224 case 1:
225 if (ftype == ::apache::thrift::protocol::T_STRUCT) {
226 xfer += this->request.read(iprot);
227 this->__isset.request = true;
228 } else {
229 xfer += iprot->skip(ftype);
230 }
231 break;
232 default:
233 xfer += iprot->skip(ftype);
234 break;
235 }
236 xfer += iprot->readFieldEnd();
237 }
238
239 xfer += iprot->readStructEnd();
240
241 return xfer;
242 }
243
244 uint32_t TracedService_joinTrace_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
245 uint32_t xfer = 0;
246 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
247 xfer += oprot->writeStructBegin("TracedService_joinTrace_args");
248
249 xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1);
250 xfer += this->request.write(oprot);
251 xfer += oprot->writeFieldEnd();
252
253 xfer += oprot->writeFieldStop();
254 xfer += oprot->writeStructEnd();
255 return xfer;
256 }
257
258
259 TracedService_joinTrace_pargs::~TracedService_joinTrace_pargs() throw() {
260 }
261
262
263 uint32_t TracedService_joinTrace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
264 uint32_t xfer = 0;
265 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
266 xfer += oprot->writeStructBegin("TracedService_joinTrace_pargs");
267
268 xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1);
269 xfer += (*(this->request)).write(oprot);
270 xfer += oprot->writeFieldEnd();
271
272 xfer += oprot->writeFieldStop();
273 xfer += oprot->writeStructEnd();
274 return xfer;
275 }
276
277
278 TracedService_joinTrace_result::~TracedService_joinTrace_result() throw() {
279 }
280
281
282 uint32_t TracedService_joinTrace_result::read(::apache::thrift::protocol::TProtocol* iprot) {
283
284 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
285 uint32_t xfer = 0;
286 std::string fname;
287 ::apache::thrift::protocol::TType ftype;
288 int16_t fid;
289
290 xfer += iprot->readStructBegin(fname);
291
292 using ::apache::thrift::protocol::TProtocolException;
293
294
295 while (true)
296 {
297 xfer += iprot->readFieldBegin(fname, ftype, fid);
298 if (ftype == ::apache::thrift::protocol::T_STOP) {
299 break;
300 }
301 switch (fid)
302 {
303 case 0:
304 if (ftype == ::apache::thrift::protocol::T_STRUCT) {
305 xfer += this->success.read(iprot);
306 this->__isset.success = true;
307 } else {
308 xfer += iprot->skip(ftype);
309 }
310 break;
311 default:
312 xfer += iprot->skip(ftype);
313 break;
314 }
315 xfer += iprot->readFieldEnd();
316 }
317
318 xfer += iprot->readStructEnd();
319
320 return xfer;
321 }
322
323 uint32_t TracedService_joinTrace_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
324
325 uint32_t xfer = 0;
326
327 xfer += oprot->writeStructBegin("TracedService_joinTrace_result");
328
329 if (this->__isset.success) {
330 xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
331 xfer += this->success.write(oprot);
332 xfer += oprot->writeFieldEnd();
333 }
334 xfer += oprot->writeFieldStop();
335 xfer += oprot->writeStructEnd();
336 return xfer;
337 }
338
339
340 TracedService_joinTrace_presult::~TracedService_joinTrace_presult() throw() {
341 }
342
343
344 uint32_t TracedService_joinTrace_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
345
346 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
347 uint32_t xfer = 0;
348 std::string fname;
349 ::apache::thrift::protocol::TType ftype;
350 int16_t fid;
351
352 xfer += iprot->readStructBegin(fname);
353
354 using ::apache::thrift::protocol::TProtocolException;
355
356
357 while (true)
358 {
359 xfer += iprot->readFieldBegin(fname, ftype, fid);
360 if (ftype == ::apache::thrift::protocol::T_STOP) {
361 break;
362 }
363 switch (fid)
364 {
365 case 0:
366 if (ftype == ::apache::thrift::protocol::T_STRUCT) {
367 xfer += (*(this->success)).read(iprot);
368 this->__isset.success = true;
369 } else {
370 xfer += iprot->skip(ftype);
371 }
372 break;
373 default:
374 xfer += iprot->skip(ftype);
375 break;
376 }
377 xfer += iprot->readFieldEnd();
378 }
379
380 xfer += iprot->readStructEnd();
381
382 return xfer;
383 }
384
385 void TracedServiceClient::startTrace(TraceResponse& _return, const StartTraceRequest& request)
386 {
387 send_startTrace(request);
388 recv_startTrace(_return);
389 }
390
391 void TracedServiceClient::send_startTrace(const StartTraceRequest& request)
392 {
393 int32_t cseqid = 0;
394 oprot_->writeMessageBegin("startTrace", ::apache::thrift::protocol::T_CALL, cseqid);
395
396 TracedService_startTrace_pargs args;
397 args.request = &request;
398 args.write(oprot_);
399
400 oprot_->writeMessageEnd();
401 oprot_->getTransport()->writeEnd();
402 oprot_->getTransport()->flush();
403 }
404
405 void TracedServiceClient::recv_startTrace(TraceResponse& _return)
406 {
407
408 int32_t rseqid = 0;
409 std::string fname;
410 ::apache::thrift::protocol::TMessageType mtype;
411
412 iprot_->readMessageBegin(fname, mtype, rseqid);
413 if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
414 ::apache::thrift::TApplicationException x;
415 x.read(iprot_);
416 iprot_->readMessageEnd();
417 iprot_->getTransport()->readEnd();
418 throw x;
419 }
420 if (mtype != ::apache::thrift::protocol::T_REPLY) {
421 iprot_->skip(::apache::thrift::protocol::T_STRUCT);
422 iprot_->readMessageEnd();
423 iprot_->getTransport()->readEnd();
424 }
425 if (fname.compare("startTrace") != 0) {
426 iprot_->skip(::apache::thrift::protocol::T_STRUCT);
427 iprot_->readMessageEnd();
428 iprot_->getTransport()->readEnd();
429 }
430 TracedService_startTrace_presult result;
431 result.success = &_return;
432 result.read(iprot_);
433 iprot_->readMessageEnd();
434 iprot_->getTransport()->readEnd();
435
436 if (result.__isset.success) {
437 // _return pointer has now been filled
438 return;
439 }
440 throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "startTrace failed: unknown result");
441 }
442
443 void TracedServiceClient::joinTrace(TraceResponse& _return, const JoinTraceRequest& request)
444 {
445 send_joinTrace(request);
446 recv_joinTrace(_return);
447 }
448
449 void TracedServiceClient::send_joinTrace(const JoinTraceRequest& request)
450 {
451 int32_t cseqid = 0;
452 oprot_->writeMessageBegin("joinTrace", ::apache::thrift::protocol::T_CALL, cseqid);
453
454 TracedService_joinTrace_pargs args;
455 args.request = &request;
456 args.write(oprot_);
457
458 oprot_->writeMessageEnd();
459 oprot_->getTransport()->writeEnd();
460 oprot_->getTransport()->flush();
461 }
462
463 void TracedServiceClient::recv_joinTrace(TraceResponse& _return)
464 {
465
466 int32_t rseqid = 0;
467 std::string fname;
468 ::apache::thrift::protocol::TMessageType mtype;
469
470 iprot_->readMessageBegin(fname, mtype, rseqid);
471 if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
472 ::apache::thrift::TApplicationException x;
473 x.read(iprot_);
474 iprot_->readMessageEnd();
475 iprot_->getTransport()->readEnd();
476 throw x;
477 }
478 if (mtype != ::apache::thrift::protocol::T_REPLY) {
479 iprot_->skip(::apache::thrift::protocol::T_STRUCT);
480 iprot_->readMessageEnd();
481 iprot_->getTransport()->readEnd();
482 }
483 if (fname.compare("joinTrace") != 0) {
484 iprot_->skip(::apache::thrift::protocol::T_STRUCT);
485 iprot_->readMessageEnd();
486 iprot_->getTransport()->readEnd();
487 }
488 TracedService_joinTrace_presult result;
489 result.success = &_return;
490 result.read(iprot_);
491 iprot_->readMessageEnd();
492 iprot_->getTransport()->readEnd();
493
494 if (result.__isset.success) {
495 // _return pointer has now been filled
496 return;
497 }
498 throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "joinTrace failed: unknown result");
499 }
500
501 bool TracedServiceProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) {
502 ProcessMap::iterator pfn;
503 pfn = processMap_.find(fname);
504 if (pfn == processMap_.end()) {
505 iprot->skip(::apache::thrift::protocol::T_STRUCT);
506 iprot->readMessageEnd();
507 iprot->getTransport()->readEnd();
508 ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'");
509 oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
510 x.write(oprot);
511 oprot->writeMessageEnd();
512 oprot->getTransport()->writeEnd();
513 oprot->getTransport()->flush();
514 return true;
515 }
516 (this->*(pfn->second))(seqid, iprot, oprot, callContext);
517 return true;
518 }
519
520 void TracedServiceProcessor::process_startTrace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
521 {
522 void* ctx = NULL;
523 if (this->eventHandler_.get() != NULL) {
524 ctx = this->eventHandler_->getContext("TracedService.startTrace", callContext);
525 }
526 ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TracedService.startTrace");
527
528 if (this->eventHandler_.get() != NULL) {
529 this->eventHandler_->preRead(ctx, "TracedService.startTrace");
530 }
531
532 TracedService_startTrace_args args;
533 args.read(iprot);
534 iprot->readMessageEnd();
535 uint32_t bytes = iprot->getTransport()->readEnd();
536
537 if (this->eventHandler_.get() != NULL) {
538 this->eventHandler_->postRead(ctx, "TracedService.startTrace", bytes);
539 }
540
541 TracedService_startTrace_result result;
542 try {
543 iface_->startTrace(result.success, args.request);
544 result.__isset.success = true;
545 } catch (const std::exception& e) {
546 if (this->eventHandler_.get() != NULL) {
547 this->eventHandler_->handlerError(ctx, "TracedService.startTrace");
548 }
549
550 ::apache::thrift::TApplicationException x(e.what());
551 oprot->writeMessageBegin("startTrace", ::apache::thrift::protocol::T_EXCEPTION, seqid);
552 x.write(oprot);
553 oprot->writeMessageEnd();
554 oprot->getTransport()->writeEnd();
555 oprot->getTransport()->flush();
556 return;
557 }
558
559 if (this->eventHandler_.get() != NULL) {
560 this->eventHandler_->preWrite(ctx, "TracedService.startTrace");
561 }
562
563 oprot->writeMessageBegin("startTrace", ::apache::thrift::protocol::T_REPLY, seqid);
564 result.write(oprot);
565 oprot->writeMessageEnd();
566 bytes = oprot->getTransport()->writeEnd();
567 oprot->getTransport()->flush();
568
569 if (this->eventHandler_.get() != NULL) {
570 this->eventHandler_->postWrite(ctx, "TracedService.startTrace", bytes);
571 }
572 }
573
574 void TracedServiceProcessor::process_joinTrace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
575 {
576 void* ctx = NULL;
577 if (this->eventHandler_.get() != NULL) {
578 ctx = this->eventHandler_->getContext("TracedService.joinTrace", callContext);
579 }
580 ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TracedService.joinTrace");
581
582 if (this->eventHandler_.get() != NULL) {
583 this->eventHandler_->preRead(ctx, "TracedService.joinTrace");
584 }
585
586 TracedService_joinTrace_args args;
587 args.read(iprot);
588 iprot->readMessageEnd();
589 uint32_t bytes = iprot->getTransport()->readEnd();
590
591 if (this->eventHandler_.get() != NULL) {
592 this->eventHandler_->postRead(ctx, "TracedService.joinTrace", bytes);
593 }
594
595 TracedService_joinTrace_result result;
596 try {
597 iface_->joinTrace(result.success, args.request);
598 result.__isset.success = true;
599 } catch (const std::exception& e) {
600 if (this->eventHandler_.get() != NULL) {
601 this->eventHandler_->handlerError(ctx, "TracedService.joinTrace");
602 }
603
604 ::apache::thrift::TApplicationException x(e.what());
605 oprot->writeMessageBegin("joinTrace", ::apache::thrift::protocol::T_EXCEPTION, seqid);
606 x.write(oprot);
607 oprot->writeMessageEnd();
608 oprot->getTransport()->writeEnd();
609 oprot->getTransport()->flush();
610 return;
611 }
612
613 if (this->eventHandler_.get() != NULL) {
614 this->eventHandler_->preWrite(ctx, "TracedService.joinTrace");
615 }
616
617 oprot->writeMessageBegin("joinTrace", ::apache::thrift::protocol::T_REPLY, seqid);
618 result.write(oprot);
619 oprot->writeMessageEnd();
620 bytes = oprot->getTransport()->writeEnd();
621 oprot->getTransport()->flush();
622
623 if (this->eventHandler_.get() != NULL) {
624 this->eventHandler_->postWrite(ctx, "TracedService.joinTrace", bytes);
625 }
626 }
627
628 ::std::shared_ptr< ::apache::thrift::TProcessor > TracedServiceProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
629 ::apache::thrift::ReleaseHandler< TracedServiceIfFactory > cleanup(handlerFactory_);
630 ::std::shared_ptr< TracedServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
631 ::std::shared_ptr< ::apache::thrift::TProcessor > processor(new TracedServiceProcessor(handler));
632 return processor;
633 }
634
635 void TracedServiceConcurrentClient::startTrace(TraceResponse& _return, const StartTraceRequest& request)
636 {
637 int32_t seqid = send_startTrace(request);
638 recv_startTrace(_return, seqid);
639 }
640
641 int32_t TracedServiceConcurrentClient::send_startTrace(const StartTraceRequest& request)
642 {
643 int32_t cseqid = this->sync_.generateSeqId();
644 ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_);
645 oprot_->writeMessageBegin("startTrace", ::apache::thrift::protocol::T_CALL, cseqid);
646
647 TracedService_startTrace_pargs args;
648 args.request = &request;
649 args.write(oprot_);
650
651 oprot_->writeMessageEnd();
652 oprot_->getTransport()->writeEnd();
653 oprot_->getTransport()->flush();
654
655 sentry.commit();
656 return cseqid;
657 }
658
659 void TracedServiceConcurrentClient::recv_startTrace(TraceResponse& _return, const int32_t seqid)
660 {
661
662 int32_t rseqid = 0;
663 std::string fname;
664 ::apache::thrift::protocol::TMessageType mtype;
665
666 // the read mutex gets dropped and reacquired as part of waitForWork()
667 // The destructor of this sentry wakes up other clients
668 ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid);
669
670 while(true) {
671 if(!this->sync_.getPending(fname, mtype, rseqid)) {
672 iprot_->readMessageBegin(fname, mtype, rseqid);
673 }
674 if(seqid == rseqid) {
675 if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
676 ::apache::thrift::TApplicationException x;
677 x.read(iprot_);
678 iprot_->readMessageEnd();
679 iprot_->getTransport()->readEnd();
680 sentry.commit();
681 throw x;
682 }
683 if (mtype != ::apache::thrift::protocol::T_REPLY) {
684 iprot_->skip(::apache::thrift::protocol::T_STRUCT);
685 iprot_->readMessageEnd();
686 iprot_->getTransport()->readEnd();
687 }
688 if (fname.compare("startTrace") != 0) {
689 iprot_->skip(::apache::thrift::protocol::T_STRUCT);
690 iprot_->readMessageEnd();
691 iprot_->getTransport()->readEnd();
692
693 // in a bad state, don't commit
694 using ::apache::thrift::protocol::TProtocolException;
695 throw TProtocolException(TProtocolException::INVALID_DATA);
696 }
697 TracedService_startTrace_presult result;
698 result.success = &_return;
699 result.read(iprot_);
700 iprot_->readMessageEnd();
701 iprot_->getTransport()->readEnd();
702
703 if (result.__isset.success) {
704 // _return pointer has now been filled
705 sentry.commit();
706 return;
707 }
708 // in a bad state, don't commit
709 throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "startTrace failed: unknown result");
710 }
711 // seqid != rseqid
712 this->sync_.updatePending(fname, mtype, rseqid);
713
714 // this will temporarily unlock the readMutex, and let other clients get work done
715 this->sync_.waitForWork(seqid);
716 } // end while(true)
717 }
718
719 void TracedServiceConcurrentClient::joinTrace(TraceResponse& _return, const JoinTraceRequest& request)
720 {
721 int32_t seqid = send_joinTrace(request);
722 recv_joinTrace(_return, seqid);
723 }
724
725 int32_t TracedServiceConcurrentClient::send_joinTrace(const JoinTraceRequest& request)
726 {
727 int32_t cseqid = this->sync_.generateSeqId();
728 ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_);
729 oprot_->writeMessageBegin("joinTrace", ::apache::thrift::protocol::T_CALL, cseqid);
730
731 TracedService_joinTrace_pargs args;
732 args.request = &request;
733 args.write(oprot_);
734
735 oprot_->writeMessageEnd();
736 oprot_->getTransport()->writeEnd();
737 oprot_->getTransport()->flush();
738
739 sentry.commit();
740 return cseqid;
741 }
742
743 void TracedServiceConcurrentClient::recv_joinTrace(TraceResponse& _return, const int32_t seqid)
744 {
745
746 int32_t rseqid = 0;
747 std::string fname;
748 ::apache::thrift::protocol::TMessageType mtype;
749
750 // the read mutex gets dropped and reacquired as part of waitForWork()
751 // The destructor of this sentry wakes up other clients
752 ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid);
753
754 while(true) {
755 if(!this->sync_.getPending(fname, mtype, rseqid)) {
756 iprot_->readMessageBegin(fname, mtype, rseqid);
757 }
758 if(seqid == rseqid) {
759 if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
760 ::apache::thrift::TApplicationException x;
761 x.read(iprot_);
762 iprot_->readMessageEnd();
763 iprot_->getTransport()->readEnd();
764 sentry.commit();
765 throw x;
766 }
767 if (mtype != ::apache::thrift::protocol::T_REPLY) {
768 iprot_->skip(::apache::thrift::protocol::T_STRUCT);
769 iprot_->readMessageEnd();
770 iprot_->getTransport()->readEnd();
771 }
772 if (fname.compare("joinTrace") != 0) {
773 iprot_->skip(::apache::thrift::protocol::T_STRUCT);
774 iprot_->readMessageEnd();
775 iprot_->getTransport()->readEnd();
776
777 // in a bad state, don't commit
778 using ::apache::thrift::protocol::TProtocolException;
779 throw TProtocolException(TProtocolException::INVALID_DATA);
780 }
781 TracedService_joinTrace_presult result;
782 result.success = &_return;
783 result.read(iprot_);
784 iprot_->readMessageEnd();
785 iprot_->getTransport()->readEnd();
786
787 if (result.__isset.success) {
788 // _return pointer has now been filled
789 sentry.commit();
790 return;
791 }
792 // in a bad state, don't commit
793 throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "joinTrace failed: unknown result");
794 }
795 // seqid != rseqid
796 this->sync_.updatePending(fname, mtype, rseqid);
797
798 // this will temporarily unlock the readMutex, and let other clients get work done
799 this->sync_.waitForWork(seqid);
800 } // end while(true)
801 }
802
803 }}} // namespace
804