hadoop_rpc.proto 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. /**
  19. * These are the messages used by Hadoop RPC to marshal the
  20. * request and response in the RPC layer.
  21. */
  22. option java_package = "org.apache.hadoop.ipc.protobuf";
  23. option java_outer_classname = "HadoopRpcProtos";
  24. option java_generate_equals_and_hash = true;
  25. /**
  26. * Message used to marshal the client request
  27. * from RPC client to the RPC server.
  28. */
  29. message HadoopRpcRequestProto {
  30. /** Name of the RPC method */
  31. required string methodName = 1;
  32. /** Bytes corresponding to the client protobuf request */
  33. optional bytes request = 2;
  34. /** protocol name of class declaring the called method */
  35. required string declaringClassProtocolName = 3;
  36. /** protocol version of class declaring the called method */
  37. required uint64 clientProtocolVersion = 4;
  38. }
  39. /**
  40. * At the RPC layer, this message is used to indicate
  41. * the server side exception the the RPC client.
  42. *
  43. * Hadoop RPC client throws an exception indicated
  44. * by exceptionName with the stackTrace.
  45. */
  46. message HadoopRpcExceptionProto {
  47. /** Class name of the exception thrown from the server */
  48. optional string exceptionName = 1;
  49. /** Exception stack trace from the server side */
  50. optional string stackTrace = 2;
  51. }
  52. /**
  53. * This message is used to marshal the response from
  54. * RPC server to the client.
  55. */
  56. message HadoopRpcResponseProto {
  57. /** Status of IPC call */
  58. enum ResponseStatus {
  59. SUCCESS = 1;
  60. ERRROR = 2;
  61. }
  62. required ResponseStatus status = 1;
  63. // Protobuf response payload from the server, when status is SUCCESS.
  64. optional bytes response = 2;
  65. // Exception when status is ERROR or FATAL
  66. optional HadoopRpcExceptionProto exception = 3;
  67. }