AcquireSemaphore.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_coordination.proto
  4. namespace Ydb\Coordination\SessionRequest;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. **
  10. * Used to acquire a semaphore
  11. * WARNING: a single session cannot acquire the same semaphore multiple times
  12. * Later requests override previous operations with the same semaphore,
  13. * e.g. to reduce acquired count, change timeout or attached data.
  14. *
  15. * Generated from protobuf message <code>Ydb.Coordination.SessionRequest.AcquireSemaphore</code>
  16. */
  17. class AcquireSemaphore extends \Google\Protobuf\Internal\Message
  18. {
  19. /**
  20. * Client-defined request id, echoed in the response
  21. *
  22. * Generated from protobuf field <code>uint64 req_id = 1;</code>
  23. */
  24. protected $req_id = 0;
  25. /**
  26. * Name of the semaphore to acquire
  27. *
  28. * Generated from protobuf field <code>string name = 2;</code>
  29. */
  30. protected $name = '';
  31. /**
  32. * Timeout in milliseconds after which operation will fail
  33. * if it's still waiting in the waiters queue
  34. *
  35. * Generated from protobuf field <code>uint64 timeout_millis = 3;</code>
  36. */
  37. protected $timeout_millis = 0;
  38. /**
  39. * Number of tokens to acquire on the semaphore
  40. *
  41. * Generated from protobuf field <code>uint64 count = 4;</code>
  42. */
  43. protected $count = 0;
  44. /**
  45. * User-defined binary data that may be attached to the operation
  46. *
  47. * Generated from protobuf field <code>bytes data = 5;</code>
  48. */
  49. protected $data = '';
  50. /**
  51. * Ephemeral semaphores are created with the first acquire operation
  52. * and automatically deleted with the last release operation
  53. *
  54. * Generated from protobuf field <code>bool ephemeral = 6;</code>
  55. */
  56. protected $ephemeral = false;
  57. /**
  58. * Constructor.
  59. *
  60. * @param array $data {
  61. * Optional. Data for populating the Message object.
  62. *
  63. * @type int|string $req_id
  64. * Client-defined request id, echoed in the response
  65. * @type string $name
  66. * Name of the semaphore to acquire
  67. * @type int|string $timeout_millis
  68. * Timeout in milliseconds after which operation will fail
  69. * if it's still waiting in the waiters queue
  70. * @type int|string $count
  71. * Number of tokens to acquire on the semaphore
  72. * @type string $data
  73. * User-defined binary data that may be attached to the operation
  74. * @type bool $ephemeral
  75. * Ephemeral semaphores are created with the first acquire operation
  76. * and automatically deleted with the last release operation
  77. * }
  78. */
  79. public function __construct($data = NULL) {
  80. \GPBMetadata\Protos\YdbCoordination::initOnce();
  81. parent::__construct($data);
  82. }
  83. /**
  84. * Client-defined request id, echoed in the response
  85. *
  86. * Generated from protobuf field <code>uint64 req_id = 1;</code>
  87. * @return int|string
  88. */
  89. public function getReqId()
  90. {
  91. return $this->req_id;
  92. }
  93. /**
  94. * Client-defined request id, echoed in the response
  95. *
  96. * Generated from protobuf field <code>uint64 req_id = 1;</code>
  97. * @param int|string $var
  98. * @return $this
  99. */
  100. public function setReqId($var)
  101. {
  102. GPBUtil::checkUint64($var);
  103. $this->req_id = $var;
  104. return $this;
  105. }
  106. /**
  107. * Name of the semaphore to acquire
  108. *
  109. * Generated from protobuf field <code>string name = 2;</code>
  110. * @return string
  111. */
  112. public function getName()
  113. {
  114. return $this->name;
  115. }
  116. /**
  117. * Name of the semaphore to acquire
  118. *
  119. * Generated from protobuf field <code>string name = 2;</code>
  120. * @param string $var
  121. * @return $this
  122. */
  123. public function setName($var)
  124. {
  125. GPBUtil::checkString($var, True);
  126. $this->name = $var;
  127. return $this;
  128. }
  129. /**
  130. * Timeout in milliseconds after which operation will fail
  131. * if it's still waiting in the waiters queue
  132. *
  133. * Generated from protobuf field <code>uint64 timeout_millis = 3;</code>
  134. * @return int|string
  135. */
  136. public function getTimeoutMillis()
  137. {
  138. return $this->timeout_millis;
  139. }
  140. /**
  141. * Timeout in milliseconds after which operation will fail
  142. * if it's still waiting in the waiters queue
  143. *
  144. * Generated from protobuf field <code>uint64 timeout_millis = 3;</code>
  145. * @param int|string $var
  146. * @return $this
  147. */
  148. public function setTimeoutMillis($var)
  149. {
  150. GPBUtil::checkUint64($var);
  151. $this->timeout_millis = $var;
  152. return $this;
  153. }
  154. /**
  155. * Number of tokens to acquire on the semaphore
  156. *
  157. * Generated from protobuf field <code>uint64 count = 4;</code>
  158. * @return int|string
  159. */
  160. public function getCount()
  161. {
  162. return $this->count;
  163. }
  164. /**
  165. * Number of tokens to acquire on the semaphore
  166. *
  167. * Generated from protobuf field <code>uint64 count = 4;</code>
  168. * @param int|string $var
  169. * @return $this
  170. */
  171. public function setCount($var)
  172. {
  173. GPBUtil::checkUint64($var);
  174. $this->count = $var;
  175. return $this;
  176. }
  177. /**
  178. * User-defined binary data that may be attached to the operation
  179. *
  180. * Generated from protobuf field <code>bytes data = 5;</code>
  181. * @return string
  182. */
  183. public function getData()
  184. {
  185. return $this->data;
  186. }
  187. /**
  188. * User-defined binary data that may be attached to the operation
  189. *
  190. * Generated from protobuf field <code>bytes data = 5;</code>
  191. * @param string $var
  192. * @return $this
  193. */
  194. public function setData($var)
  195. {
  196. GPBUtil::checkString($var, False);
  197. $this->data = $var;
  198. return $this;
  199. }
  200. /**
  201. * Ephemeral semaphores are created with the first acquire operation
  202. * and automatically deleted with the last release operation
  203. *
  204. * Generated from protobuf field <code>bool ephemeral = 6;</code>
  205. * @return bool
  206. */
  207. public function getEphemeral()
  208. {
  209. return $this->ephemeral;
  210. }
  211. /**
  212. * Ephemeral semaphores are created with the first acquire operation
  213. * and automatically deleted with the last release operation
  214. *
  215. * Generated from protobuf field <code>bool ephemeral = 6;</code>
  216. * @param bool $var
  217. * @return $this
  218. */
  219. public function setEphemeral($var)
  220. {
  221. GPBUtil::checkBool($var);
  222. $this->ephemeral = $var;
  223. return $this;
  224. }
  225. }
  226. // Adding a class alias for backwards compatibility with the previous class name.
  227. class_alias(AcquireSemaphore::class, \Ydb\Coordination\SessionRequest_AcquireSemaphore::class);