CBlockClientServerProtocol.proto 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 .proto interfaces are private and unstable.
  20. * Please see http://wiki.apache.org/hadoop/Compatibility
  21. * for what changes are allowed for a *unstable* .proto interface.
  22. */
  23. option java_package = "org.apache.hadoop.cblock.protocol.proto";
  24. option java_outer_classname = "CBlockClientServerProtocolProtos";
  25. option java_generic_services = true;
  26. option java_generate_equals_and_hash = true;
  27. package hadoop.cblock;
  28. import "hdds.proto";
  29. import "CBlockServiceProtocol.proto";
  30. /**
  31. * This message is sent from CBlock client side to CBlock server to
  32. * mount a volume specified by owner name and volume name.
  33. *
  34. * Right now, this is the only communication between client and server.
  35. * After the volume is mounted, CBlock client will talk to containers
  36. * by itself, nothing to do with CBlock server.
  37. */
  38. message MountVolumeRequestProto {
  39. required string userName = 1;
  40. required string volumeName = 2;
  41. }
  42. /**
  43. * This message is sent from CBlock server to CBlock client as response
  44. * of mount a volume. It checks the whether the volume is valid to access
  45. * at all.(e.g. volume exist)
  46. *
  47. * And include enough information (volume size, block size, list of
  48. * containers for this volume) for client side to perform read/write on
  49. * the volume.
  50. */
  51. message MountVolumeResponseProto {
  52. required bool isValid = 1;
  53. optional string userName = 2;
  54. optional string volumeName = 3;
  55. optional uint64 volumeSize = 4;
  56. optional uint32 blockSize = 5;
  57. repeated ContainerIDProto allContainerIDs = 6;
  58. }
  59. /**
  60. * This message include ID of container which can be used to locate the
  61. * container. Since the order of containers needs to be maintained, also
  62. * includes a index field to verify the correctness of the order.
  63. */
  64. message ContainerIDProto {
  65. required string containerID = 1;
  66. required uint64 index = 2;
  67. // making pipeline optional to be compatible with exisiting tests
  68. optional hadoop.hdds.Pipeline pipeline = 3;
  69. }
  70. message ListVolumesRequestProto {
  71. }
  72. message ListVolumesResponseProto {
  73. repeated VolumeInfoProto volumeEntry = 1;
  74. }
  75. service CBlockClientServerProtocolService {
  76. /**
  77. * mount the volume.
  78. */
  79. rpc mountVolume(MountVolumeRequestProto) returns (MountVolumeResponseProto);
  80. rpc listVolumes(ListVolumesRequestProto) returns(ListVolumesResponseProto);
  81. }