ScmBlockLocationProtocol.proto 3.9 KB

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