ScmBlockLocationProtocol.proto 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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.hdds.protocol.proto";
  24. option java_outer_classname = "ScmBlockLocationProtocolProtos";
  25. option java_generic_services = true;
  26. option java_generate_equals_and_hash = true;
  27. package hadoop.hdds;
  28. import "hdds.proto";
  29. // SCM Block protocol
  30. /**
  31. * Request send to SCM asking allocate block of specified size.
  32. */
  33. message AllocateScmBlockRequestProto {
  34. required uint64 size = 1;
  35. required ReplicationType type = 2;
  36. required hadoop.hdds.ReplicationFactor factor = 3;
  37. required string owner = 4;
  38. }
  39. /**
  40. * A delete key request sent by OM to SCM, it contains
  41. * multiple number of keys (and their blocks).
  42. */
  43. message DeleteScmKeyBlocksRequestProto {
  44. repeated KeyBlocks keyBlocks = 1;
  45. }
  46. /**
  47. * A object key and all its associated blocks.
  48. * We need to encapsulate object key name plus the blocks in this potocol
  49. * because SCM needs to response OM with the keys it has deleted.
  50. * If the response only contains blocks, it will be very expensive for
  51. * OM to figure out what keys have been deleted.
  52. */
  53. message KeyBlocks {
  54. required string key = 1;
  55. repeated BlockID blocks = 2;
  56. }
  57. /**
  58. * A delete key response from SCM to OM, it contains multiple child-results.
  59. * Each child-result represents a key deletion result, only if all blocks of
  60. * a key are successfully deleted, this key result is considered as succeed.
  61. */
  62. message DeleteScmKeyBlocksResponseProto {
  63. repeated DeleteKeyBlocksResultProto results = 1;
  64. }
  65. /**
  66. * A key deletion result. It contains all the block deletion results.
  67. */
  68. message DeleteKeyBlocksResultProto {
  69. required string objectKey = 1;
  70. repeated DeleteScmBlockResult blockResults = 2;
  71. }
  72. message DeleteScmBlockResult {
  73. enum Result {
  74. success = 1;
  75. chillMode = 2;
  76. errorNotFound = 3;
  77. unknownFailure = 4;
  78. }
  79. required Result result = 1;
  80. required BlockID blockID = 2;
  81. }
  82. /**
  83. * Reply from SCM indicating that the container.
  84. */
  85. message AllocateScmBlockResponseProto {
  86. enum Error {
  87. success = 1;
  88. errorNotEnoughSpace = 2;
  89. errorSizeTooBig = 3;
  90. unknownFailure = 4;
  91. }
  92. required Error errorCode = 1;
  93. optional ContainerBlockID containerBlockID = 2;
  94. optional hadoop.hdds.Pipeline pipeline = 3;
  95. optional string errorMessage = 4;
  96. }
  97. /**
  98. * Protocol used from OzoneManager to StorageContainerManager.
  99. * See request and response messages for details of the RPC calls.
  100. */
  101. service ScmBlockLocationProtocolService {
  102. /**
  103. * Creates a block entry in SCM.
  104. */
  105. rpc allocateScmBlock(AllocateScmBlockRequestProto)
  106. returns (AllocateScmBlockResponseProto);
  107. /**
  108. * Deletes blocks for a set of object keys from SCM.
  109. */
  110. rpc deleteScmKeyBlocks(DeleteScmKeyBlocksRequestProto)
  111. returns (DeleteScmKeyBlocksResponseProto);
  112. /**
  113. * Gets the scmInfo from SCM.
  114. */
  115. rpc getScmInfo(hadoop.hdds.GetScmInfoRequestProto)
  116. returns (hadoop.hdds.GetScmInfoRespsonseProto);
  117. }