001// Generated by the protocol buffer compiler.  DO NOT EDIT!
002// source: test_rpc_service.proto
003
004package org.apache.hadoop.ipc.protobuf;
005
006public final class TestRpcServiceProtos {
007  private TestRpcServiceProtos() {}
008  public static void registerAllExtensions(
009      com.google.protobuf.ExtensionRegistry registry) {
010  }
011  /**
012   * Protobuf service {@code hadoop.common.TestProtobufRpcProto}
013   *
014   * <pre>
015   **
016   * A protobuf service for use in tests
017   * </pre>
018   */
019  public static abstract class TestProtobufRpcProto
020      implements com.google.protobuf.Service {
021    protected TestProtobufRpcProto() {}
022
023    public interface Interface {
024      /**
025       * <code>rpc ping(.hadoop.common.EmptyRequestProto) returns (.hadoop.common.EmptyResponseProto);</code>
026       */
027      public abstract void ping(
028          com.google.protobuf.RpcController controller,
029          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
030          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done);
031
032      /**
033       * <code>rpc echo(.hadoop.common.EchoRequestProto) returns (.hadoop.common.EchoResponseProto);</code>
034       */
035      public abstract void echo(
036          com.google.protobuf.RpcController controller,
037          org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request,
038          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto> done);
039
040      /**
041       * <code>rpc error(.hadoop.common.EmptyRequestProto) returns (.hadoop.common.EmptyResponseProto);</code>
042       */
043      public abstract void error(
044          com.google.protobuf.RpcController controller,
045          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
046          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done);
047
048      /**
049       * <code>rpc error2(.hadoop.common.EmptyRequestProto) returns (.hadoop.common.EmptyResponseProto);</code>
050       */
051      public abstract void error2(
052          com.google.protobuf.RpcController controller,
053          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
054          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done);
055
056    }
057
058    public static com.google.protobuf.Service newReflectiveService(
059        final Interface impl) {
060      return new TestProtobufRpcProto() {
061        @java.lang.Override
062        public  void ping(
063            com.google.protobuf.RpcController controller,
064            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
065            com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done) {
066          impl.ping(controller, request, done);
067        }
068
069        @java.lang.Override
070        public  void echo(
071            com.google.protobuf.RpcController controller,
072            org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request,
073            com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto> done) {
074          impl.echo(controller, request, done);
075        }
076
077        @java.lang.Override
078        public  void error(
079            com.google.protobuf.RpcController controller,
080            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
081            com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done) {
082          impl.error(controller, request, done);
083        }
084
085        @java.lang.Override
086        public  void error2(
087            com.google.protobuf.RpcController controller,
088            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
089            com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done) {
090          impl.error2(controller, request, done);
091        }
092
093      };
094    }
095
096    public static com.google.protobuf.BlockingService
097        newReflectiveBlockingService(final BlockingInterface impl) {
098      return new com.google.protobuf.BlockingService() {
099        public final com.google.protobuf.Descriptors.ServiceDescriptor
100            getDescriptorForType() {
101          return getDescriptor();
102        }
103
104        public final com.google.protobuf.Message callBlockingMethod(
105            com.google.protobuf.Descriptors.MethodDescriptor method,
106            com.google.protobuf.RpcController controller,
107            com.google.protobuf.Message request)
108            throws com.google.protobuf.ServiceException {
109          if (method.getService() != getDescriptor()) {
110            throw new java.lang.IllegalArgumentException(
111              "Service.callBlockingMethod() given method descriptor for " +
112              "wrong service type.");
113          }
114          switch(method.getIndex()) {
115            case 0:
116              return impl.ping(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto)request);
117            case 1:
118              return impl.echo(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto)request);
119            case 2:
120              return impl.error(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto)request);
121            case 3:
122              return impl.error2(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto)request);
123            default:
124              throw new java.lang.AssertionError("Can't get here.");
125          }
126        }
127
128        public final com.google.protobuf.Message
129            getRequestPrototype(
130            com.google.protobuf.Descriptors.MethodDescriptor method) {
131          if (method.getService() != getDescriptor()) {
132            throw new java.lang.IllegalArgumentException(
133              "Service.getRequestPrototype() given method " +
134              "descriptor for wrong service type.");
135          }
136          switch(method.getIndex()) {
137            case 0:
138              return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto.getDefaultInstance();
139            case 1:
140              return org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto.getDefaultInstance();
141            case 2:
142              return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto.getDefaultInstance();
143            case 3:
144              return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto.getDefaultInstance();
145            default:
146              throw new java.lang.AssertionError("Can't get here.");
147          }
148        }
149
150        public final com.google.protobuf.Message
151            getResponsePrototype(
152            com.google.protobuf.Descriptors.MethodDescriptor method) {
153          if (method.getService() != getDescriptor()) {
154            throw new java.lang.IllegalArgumentException(
155              "Service.getResponsePrototype() given method " +
156              "descriptor for wrong service type.");
157          }
158          switch(method.getIndex()) {
159            case 0:
160              return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance();
161            case 1:
162              return org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance();
163            case 2:
164              return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance();
165            case 3:
166              return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance();
167            default:
168              throw new java.lang.AssertionError("Can't get here.");
169          }
170        }
171
172      };
173    }
174
175    /**
176     * <code>rpc ping(.hadoop.common.EmptyRequestProto) returns (.hadoop.common.EmptyResponseProto);</code>
177     */
178    public abstract void ping(
179        com.google.protobuf.RpcController controller,
180        org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
181        com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done);
182
183    /**
184     * <code>rpc echo(.hadoop.common.EchoRequestProto) returns (.hadoop.common.EchoResponseProto);</code>
185     */
186    public abstract void echo(
187        com.google.protobuf.RpcController controller,
188        org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request,
189        com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto> done);
190
191    /**
192     * <code>rpc error(.hadoop.common.EmptyRequestProto) returns (.hadoop.common.EmptyResponseProto);</code>
193     */
194    public abstract void error(
195        com.google.protobuf.RpcController controller,
196        org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
197        com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done);
198
199    /**
200     * <code>rpc error2(.hadoop.common.EmptyRequestProto) returns (.hadoop.common.EmptyResponseProto);</code>
201     */
202    public abstract void error2(
203        com.google.protobuf.RpcController controller,
204        org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
205        com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done);
206
207    public static final
208        com.google.protobuf.Descriptors.ServiceDescriptor
209        getDescriptor() {
210      return org.apache.hadoop.ipc.protobuf.TestRpcServiceProtos.getDescriptor().getServices().get(0);
211    }
212    public final com.google.protobuf.Descriptors.ServiceDescriptor
213        getDescriptorForType() {
214      return getDescriptor();
215    }
216
217    public final void callMethod(
218        com.google.protobuf.Descriptors.MethodDescriptor method,
219        com.google.protobuf.RpcController controller,
220        com.google.protobuf.Message request,
221        com.google.protobuf.RpcCallback<
222          com.google.protobuf.Message> done) {
223      if (method.getService() != getDescriptor()) {
224        throw new java.lang.IllegalArgumentException(
225          "Service.callMethod() given method descriptor for wrong " +
226          "service type.");
227      }
228      switch(method.getIndex()) {
229        case 0:
230          this.ping(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto)request,
231            com.google.protobuf.RpcUtil.<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto>specializeCallback(
232              done));
233          return;
234        case 1:
235          this.echo(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto)request,
236            com.google.protobuf.RpcUtil.<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto>specializeCallback(
237              done));
238          return;
239        case 2:
240          this.error(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto)request,
241            com.google.protobuf.RpcUtil.<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto>specializeCallback(
242              done));
243          return;
244        case 3:
245          this.error2(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto)request,
246            com.google.protobuf.RpcUtil.<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto>specializeCallback(
247              done));
248          return;
249        default:
250          throw new java.lang.AssertionError("Can't get here.");
251      }
252    }
253
254    public final com.google.protobuf.Message
255        getRequestPrototype(
256        com.google.protobuf.Descriptors.MethodDescriptor method) {
257      if (method.getService() != getDescriptor()) {
258        throw new java.lang.IllegalArgumentException(
259          "Service.getRequestPrototype() given method " +
260          "descriptor for wrong service type.");
261      }
262      switch(method.getIndex()) {
263        case 0:
264          return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto.getDefaultInstance();
265        case 1:
266          return org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto.getDefaultInstance();
267        case 2:
268          return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto.getDefaultInstance();
269        case 3:
270          return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto.getDefaultInstance();
271        default:
272          throw new java.lang.AssertionError("Can't get here.");
273      }
274    }
275
276    public final com.google.protobuf.Message
277        getResponsePrototype(
278        com.google.protobuf.Descriptors.MethodDescriptor method) {
279      if (method.getService() != getDescriptor()) {
280        throw new java.lang.IllegalArgumentException(
281          "Service.getResponsePrototype() given method " +
282          "descriptor for wrong service type.");
283      }
284      switch(method.getIndex()) {
285        case 0:
286          return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance();
287        case 1:
288          return org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance();
289        case 2:
290          return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance();
291        case 3:
292          return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance();
293        default:
294          throw new java.lang.AssertionError("Can't get here.");
295      }
296    }
297
298    public static Stub newStub(
299        com.google.protobuf.RpcChannel channel) {
300      return new Stub(channel);
301    }
302
303    public static final class Stub extends org.apache.hadoop.ipc.protobuf.TestRpcServiceProtos.TestProtobufRpcProto implements Interface {
304      private Stub(com.google.protobuf.RpcChannel channel) {
305        this.channel = channel;
306      }
307
308      private final com.google.protobuf.RpcChannel channel;
309
310      public com.google.protobuf.RpcChannel getChannel() {
311        return channel;
312      }
313
314      public  void ping(
315          com.google.protobuf.RpcController controller,
316          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
317          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done) {
318        channel.callMethod(
319          getDescriptor().getMethods().get(0),
320          controller,
321          request,
322          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance(),
323          com.google.protobuf.RpcUtil.generalizeCallback(
324            done,
325            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.class,
326            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance()));
327      }
328
329      public  void echo(
330          com.google.protobuf.RpcController controller,
331          org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request,
332          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto> done) {
333        channel.callMethod(
334          getDescriptor().getMethods().get(1),
335          controller,
336          request,
337          org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance(),
338          com.google.protobuf.RpcUtil.generalizeCallback(
339            done,
340            org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.class,
341            org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance()));
342      }
343
344      public  void error(
345          com.google.protobuf.RpcController controller,
346          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
347          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done) {
348        channel.callMethod(
349          getDescriptor().getMethods().get(2),
350          controller,
351          request,
352          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance(),
353          com.google.protobuf.RpcUtil.generalizeCallback(
354            done,
355            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.class,
356            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance()));
357      }
358
359      public  void error2(
360          com.google.protobuf.RpcController controller,
361          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
362          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done) {
363        channel.callMethod(
364          getDescriptor().getMethods().get(3),
365          controller,
366          request,
367          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance(),
368          com.google.protobuf.RpcUtil.generalizeCallback(
369            done,
370            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.class,
371            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance()));
372      }
373    }
374
375    public static BlockingInterface newBlockingStub(
376        com.google.protobuf.BlockingRpcChannel channel) {
377      return new BlockingStub(channel);
378    }
379
380    public interface BlockingInterface {
381      public org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto ping(
382          com.google.protobuf.RpcController controller,
383          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request)
384          throws com.google.protobuf.ServiceException;
385
386      public org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto echo(
387          com.google.protobuf.RpcController controller,
388          org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request)
389          throws com.google.protobuf.ServiceException;
390
391      public org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto error(
392          com.google.protobuf.RpcController controller,
393          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request)
394          throws com.google.protobuf.ServiceException;
395
396      public org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto error2(
397          com.google.protobuf.RpcController controller,
398          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request)
399          throws com.google.protobuf.ServiceException;
400    }
401
402    private static final class BlockingStub implements BlockingInterface {
403      private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) {
404        this.channel = channel;
405      }
406
407      private final com.google.protobuf.BlockingRpcChannel channel;
408
409      public org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto ping(
410          com.google.protobuf.RpcController controller,
411          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request)
412          throws com.google.protobuf.ServiceException {
413        return (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto) channel.callBlockingMethod(
414          getDescriptor().getMethods().get(0),
415          controller,
416          request,
417          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance());
418      }
419
420
421      public org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto echo(
422          com.google.protobuf.RpcController controller,
423          org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request)
424          throws com.google.protobuf.ServiceException {
425        return (org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto) channel.callBlockingMethod(
426          getDescriptor().getMethods().get(1),
427          controller,
428          request,
429          org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance());
430      }
431
432
433      public org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto error(
434          com.google.protobuf.RpcController controller,
435          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request)
436          throws com.google.protobuf.ServiceException {
437        return (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto) channel.callBlockingMethod(
438          getDescriptor().getMethods().get(2),
439          controller,
440          request,
441          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance());
442      }
443
444
445      public org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto error2(
446          com.google.protobuf.RpcController controller,
447          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request)
448          throws com.google.protobuf.ServiceException {
449        return (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto) channel.callBlockingMethod(
450          getDescriptor().getMethods().get(3),
451          controller,
452          request,
453          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance());
454      }
455
456    }
457
458    // @@protoc_insertion_point(class_scope:hadoop.common.TestProtobufRpcProto)
459  }
460
461  /**
462   * Protobuf service {@code hadoop.common.TestProtobufRpc2Proto}
463   */
464  public static abstract class TestProtobufRpc2Proto
465      implements com.google.protobuf.Service {
466    protected TestProtobufRpc2Proto() {}
467
468    public interface Interface {
469      /**
470       * <code>rpc ping2(.hadoop.common.EmptyRequestProto) returns (.hadoop.common.EmptyResponseProto);</code>
471       */
472      public abstract void ping2(
473          com.google.protobuf.RpcController controller,
474          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
475          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done);
476
477      /**
478       * <code>rpc echo2(.hadoop.common.EchoRequestProto) returns (.hadoop.common.EchoResponseProto);</code>
479       */
480      public abstract void echo2(
481          com.google.protobuf.RpcController controller,
482          org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request,
483          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto> done);
484
485      /**
486       * <code>rpc sleep(.hadoop.common.SleepRequestProto) returns (.hadoop.common.SleepResponseProto);</code>
487       */
488      public abstract void sleep(
489          com.google.protobuf.RpcController controller,
490          org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto request,
491          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto> done);
492
493    }
494
495    public static com.google.protobuf.Service newReflectiveService(
496        final Interface impl) {
497      return new TestProtobufRpc2Proto() {
498        @java.lang.Override
499        public  void ping2(
500            com.google.protobuf.RpcController controller,
501            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
502            com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done) {
503          impl.ping2(controller, request, done);
504        }
505
506        @java.lang.Override
507        public  void echo2(
508            com.google.protobuf.RpcController controller,
509            org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request,
510            com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto> done) {
511          impl.echo2(controller, request, done);
512        }
513
514        @java.lang.Override
515        public  void sleep(
516            com.google.protobuf.RpcController controller,
517            org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto request,
518            com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto> done) {
519          impl.sleep(controller, request, done);
520        }
521
522      };
523    }
524
525    public static com.google.protobuf.BlockingService
526        newReflectiveBlockingService(final BlockingInterface impl) {
527      return new com.google.protobuf.BlockingService() {
528        public final com.google.protobuf.Descriptors.ServiceDescriptor
529            getDescriptorForType() {
530          return getDescriptor();
531        }
532
533        public final com.google.protobuf.Message callBlockingMethod(
534            com.google.protobuf.Descriptors.MethodDescriptor method,
535            com.google.protobuf.RpcController controller,
536            com.google.protobuf.Message request)
537            throws com.google.protobuf.ServiceException {
538          if (method.getService() != getDescriptor()) {
539            throw new java.lang.IllegalArgumentException(
540              "Service.callBlockingMethod() given method descriptor for " +
541              "wrong service type.");
542          }
543          switch(method.getIndex()) {
544            case 0:
545              return impl.ping2(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto)request);
546            case 1:
547              return impl.echo2(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto)request);
548            case 2:
549              return impl.sleep(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto)request);
550            default:
551              throw new java.lang.AssertionError("Can't get here.");
552          }
553        }
554
555        public final com.google.protobuf.Message
556            getRequestPrototype(
557            com.google.protobuf.Descriptors.MethodDescriptor method) {
558          if (method.getService() != getDescriptor()) {
559            throw new java.lang.IllegalArgumentException(
560              "Service.getRequestPrototype() given method " +
561              "descriptor for wrong service type.");
562          }
563          switch(method.getIndex()) {
564            case 0:
565              return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto.getDefaultInstance();
566            case 1:
567              return org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto.getDefaultInstance();
568            case 2:
569              return org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto.getDefaultInstance();
570            default:
571              throw new java.lang.AssertionError("Can't get here.");
572          }
573        }
574
575        public final com.google.protobuf.Message
576            getResponsePrototype(
577            com.google.protobuf.Descriptors.MethodDescriptor method) {
578          if (method.getService() != getDescriptor()) {
579            throw new java.lang.IllegalArgumentException(
580              "Service.getResponsePrototype() given method " +
581              "descriptor for wrong service type.");
582          }
583          switch(method.getIndex()) {
584            case 0:
585              return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance();
586            case 1:
587              return org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance();
588            case 2:
589              return org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto.getDefaultInstance();
590            default:
591              throw new java.lang.AssertionError("Can't get here.");
592          }
593        }
594
595      };
596    }
597
598    /**
599     * <code>rpc ping2(.hadoop.common.EmptyRequestProto) returns (.hadoop.common.EmptyResponseProto);</code>
600     */
601    public abstract void ping2(
602        com.google.protobuf.RpcController controller,
603        org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
604        com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done);
605
606    /**
607     * <code>rpc echo2(.hadoop.common.EchoRequestProto) returns (.hadoop.common.EchoResponseProto);</code>
608     */
609    public abstract void echo2(
610        com.google.protobuf.RpcController controller,
611        org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request,
612        com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto> done);
613
614    /**
615     * <code>rpc sleep(.hadoop.common.SleepRequestProto) returns (.hadoop.common.SleepResponseProto);</code>
616     */
617    public abstract void sleep(
618        com.google.protobuf.RpcController controller,
619        org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto request,
620        com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto> done);
621
622    public static final
623        com.google.protobuf.Descriptors.ServiceDescriptor
624        getDescriptor() {
625      return org.apache.hadoop.ipc.protobuf.TestRpcServiceProtos.getDescriptor().getServices().get(1);
626    }
627    public final com.google.protobuf.Descriptors.ServiceDescriptor
628        getDescriptorForType() {
629      return getDescriptor();
630    }
631
632    public final void callMethod(
633        com.google.protobuf.Descriptors.MethodDescriptor method,
634        com.google.protobuf.RpcController controller,
635        com.google.protobuf.Message request,
636        com.google.protobuf.RpcCallback<
637          com.google.protobuf.Message> done) {
638      if (method.getService() != getDescriptor()) {
639        throw new java.lang.IllegalArgumentException(
640          "Service.callMethod() given method descriptor for wrong " +
641          "service type.");
642      }
643      switch(method.getIndex()) {
644        case 0:
645          this.ping2(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto)request,
646            com.google.protobuf.RpcUtil.<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto>specializeCallback(
647              done));
648          return;
649        case 1:
650          this.echo2(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto)request,
651            com.google.protobuf.RpcUtil.<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto>specializeCallback(
652              done));
653          return;
654        case 2:
655          this.sleep(controller, (org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto)request,
656            com.google.protobuf.RpcUtil.<org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto>specializeCallback(
657              done));
658          return;
659        default:
660          throw new java.lang.AssertionError("Can't get here.");
661      }
662    }
663
664    public final com.google.protobuf.Message
665        getRequestPrototype(
666        com.google.protobuf.Descriptors.MethodDescriptor method) {
667      if (method.getService() != getDescriptor()) {
668        throw new java.lang.IllegalArgumentException(
669          "Service.getRequestPrototype() given method " +
670          "descriptor for wrong service type.");
671      }
672      switch(method.getIndex()) {
673        case 0:
674          return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto.getDefaultInstance();
675        case 1:
676          return org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto.getDefaultInstance();
677        case 2:
678          return org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto.getDefaultInstance();
679        default:
680          throw new java.lang.AssertionError("Can't get here.");
681      }
682    }
683
684    public final com.google.protobuf.Message
685        getResponsePrototype(
686        com.google.protobuf.Descriptors.MethodDescriptor method) {
687      if (method.getService() != getDescriptor()) {
688        throw new java.lang.IllegalArgumentException(
689          "Service.getResponsePrototype() given method " +
690          "descriptor for wrong service type.");
691      }
692      switch(method.getIndex()) {
693        case 0:
694          return org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance();
695        case 1:
696          return org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance();
697        case 2:
698          return org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto.getDefaultInstance();
699        default:
700          throw new java.lang.AssertionError("Can't get here.");
701      }
702    }
703
704    public static Stub newStub(
705        com.google.protobuf.RpcChannel channel) {
706      return new Stub(channel);
707    }
708
709    public static final class Stub extends org.apache.hadoop.ipc.protobuf.TestRpcServiceProtos.TestProtobufRpc2Proto implements Interface {
710      private Stub(com.google.protobuf.RpcChannel channel) {
711        this.channel = channel;
712      }
713
714      private final com.google.protobuf.RpcChannel channel;
715
716      public com.google.protobuf.RpcChannel getChannel() {
717        return channel;
718      }
719
720      public  void ping2(
721          com.google.protobuf.RpcController controller,
722          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request,
723          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto> done) {
724        channel.callMethod(
725          getDescriptor().getMethods().get(0),
726          controller,
727          request,
728          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance(),
729          com.google.protobuf.RpcUtil.generalizeCallback(
730            done,
731            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.class,
732            org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance()));
733      }
734
735      public  void echo2(
736          com.google.protobuf.RpcController controller,
737          org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request,
738          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto> done) {
739        channel.callMethod(
740          getDescriptor().getMethods().get(1),
741          controller,
742          request,
743          org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance(),
744          com.google.protobuf.RpcUtil.generalizeCallback(
745            done,
746            org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.class,
747            org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance()));
748      }
749
750      public  void sleep(
751          com.google.protobuf.RpcController controller,
752          org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto request,
753          com.google.protobuf.RpcCallback<org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto> done) {
754        channel.callMethod(
755          getDescriptor().getMethods().get(2),
756          controller,
757          request,
758          org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto.getDefaultInstance(),
759          com.google.protobuf.RpcUtil.generalizeCallback(
760            done,
761            org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto.class,
762            org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto.getDefaultInstance()));
763      }
764    }
765
766    public static BlockingInterface newBlockingStub(
767        com.google.protobuf.BlockingRpcChannel channel) {
768      return new BlockingStub(channel);
769    }
770
771    public interface BlockingInterface {
772      public org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto ping2(
773          com.google.protobuf.RpcController controller,
774          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request)
775          throws com.google.protobuf.ServiceException;
776
777      public org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto echo2(
778          com.google.protobuf.RpcController controller,
779          org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request)
780          throws com.google.protobuf.ServiceException;
781
782      public org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto sleep(
783          com.google.protobuf.RpcController controller,
784          org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto request)
785          throws com.google.protobuf.ServiceException;
786    }
787
788    private static final class BlockingStub implements BlockingInterface {
789      private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) {
790        this.channel = channel;
791      }
792
793      private final com.google.protobuf.BlockingRpcChannel channel;
794
795      public org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto ping2(
796          com.google.protobuf.RpcController controller,
797          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyRequestProto request)
798          throws com.google.protobuf.ServiceException {
799        return (org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto) channel.callBlockingMethod(
800          getDescriptor().getMethods().get(0),
801          controller,
802          request,
803          org.apache.hadoop.ipc.protobuf.TestProtos.EmptyResponseProto.getDefaultInstance());
804      }
805
806
807      public org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto echo2(
808          com.google.protobuf.RpcController controller,
809          org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto request)
810          throws com.google.protobuf.ServiceException {
811        return (org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto) channel.callBlockingMethod(
812          getDescriptor().getMethods().get(1),
813          controller,
814          request,
815          org.apache.hadoop.ipc.protobuf.TestProtos.EchoResponseProto.getDefaultInstance());
816      }
817
818
819      public org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto sleep(
820          com.google.protobuf.RpcController controller,
821          org.apache.hadoop.ipc.protobuf.TestProtos.SleepRequestProto request)
822          throws com.google.protobuf.ServiceException {
823        return (org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto) channel.callBlockingMethod(
824          getDescriptor().getMethods().get(2),
825          controller,
826          request,
827          org.apache.hadoop.ipc.protobuf.TestProtos.SleepResponseProto.getDefaultInstance());
828      }
829
830    }
831
832    // @@protoc_insertion_point(class_scope:hadoop.common.TestProtobufRpc2Proto)
833  }
834
835
836  public static com.google.protobuf.Descriptors.FileDescriptor
837      getDescriptor() {
838    return descriptor;
839  }
840  private static com.google.protobuf.Descriptors.FileDescriptor
841      descriptor;
842  static {
843    java.lang.String[] descriptorData = {
844      "\n\026test_rpc_service.proto\022\rhadoop.common\032" +
845      "\ntest.proto2\313\002\n\024TestProtobufRpcProto\022K\n\004" +
846      "ping\022 .hadoop.common.EmptyRequestProto\032!" +
847      ".hadoop.common.EmptyResponseProto\022I\n\004ech" +
848      "o\022\037.hadoop.common.EchoRequestProto\032 .had" +
849      "oop.common.EchoResponseProto\022L\n\005error\022 ." +
850      "hadoop.common.EmptyRequestProto\032!.hadoop" +
851      ".common.EmptyResponseProto\022M\n\006error2\022 .h" +
852      "adoop.common.EmptyRequestProto\032!.hadoop." +
853      "common.EmptyResponseProto2\377\001\n\025TestProtob",
854      "ufRpc2Proto\022L\n\005ping2\022 .hadoop.common.Emp" +
855      "tyRequestProto\032!.hadoop.common.EmptyResp" +
856      "onseProto\022J\n\005echo2\022\037.hadoop.common.EchoR" +
857      "equestProto\032 .hadoop.common.EchoResponse" +
858      "Proto\022L\n\005sleep\022 .hadoop.common.SleepRequ" +
859      "estProto\032!.hadoop.common.SleepResponsePr" +
860      "otoB<\n\036org.apache.hadoop.ipc.protobufB\024T" +
861      "estRpcServiceProtos\210\001\001\240\001\001"
862    };
863    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
864      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
865        public com.google.protobuf.ExtensionRegistry assignDescriptors(
866            com.google.protobuf.Descriptors.FileDescriptor root) {
867          descriptor = root;
868          return null;
869        }
870      };
871    com.google.protobuf.Descriptors.FileDescriptor
872      .internalBuildGeneratedFileFrom(descriptorData,
873        new com.google.protobuf.Descriptors.FileDescriptor[] {
874          org.apache.hadoop.ipc.protobuf.TestProtos.getDescriptor(),
875        }, assigner);
876  }
877
878  // @@protoc_insertion_point(outer_class_scope)
879}