SemaphoreDescription.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_coordination.proto
  4. namespace Ydb\Coordination;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. **
  10. * Describes the state of a semaphore
  11. *
  12. * Generated from protobuf message <code>Ydb.Coordination.SemaphoreDescription</code>
  13. */
  14. class SemaphoreDescription extends \Google\Protobuf\Internal\Message
  15. {
  16. /**
  17. * Name of the semaphore
  18. *
  19. * Generated from protobuf field <code>string name = 1;</code>
  20. */
  21. protected $name = '';
  22. /**
  23. * User-defined data attached to the semaphore
  24. *
  25. * Generated from protobuf field <code>bytes data = 2;</code>
  26. */
  27. protected $data = '';
  28. /**
  29. * Number of tokens currently acquired by owners
  30. *
  31. * Generated from protobuf field <code>uint64 count = 7;</code>
  32. */
  33. protected $count = 0;
  34. /**
  35. * Maximum number of tokens that may acquired
  36. *
  37. * Generated from protobuf field <code>uint64 limit = 3;</code>
  38. */
  39. protected $limit = 0;
  40. /**
  41. * Ephemeral semaphores are deleted when released by all owners and waiters
  42. *
  43. * Generated from protobuf field <code>bool ephemeral = 4;</code>
  44. */
  45. protected $ephemeral = false;
  46. /**
  47. * A list of current owners of the semaphore
  48. *
  49. * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession owners = 5;</code>
  50. */
  51. private $owners;
  52. /**
  53. * A list of current waiters on the semaphore
  54. *
  55. * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession waiters = 6;</code>
  56. */
  57. private $waiters;
  58. /**
  59. * Constructor.
  60. *
  61. * @param array $data {
  62. * Optional. Data for populating the Message object.
  63. *
  64. * @type string $name
  65. * Name of the semaphore
  66. * @type string $data
  67. * User-defined data attached to the semaphore
  68. * @type int|string $count
  69. * Number of tokens currently acquired by owners
  70. * @type int|string $limit
  71. * Maximum number of tokens that may acquired
  72. * @type bool $ephemeral
  73. * Ephemeral semaphores are deleted when released by all owners and waiters
  74. * @type array<\Ydb\Coordination\SemaphoreSession>|\Google\Protobuf\Internal\RepeatedField $owners
  75. * A list of current owners of the semaphore
  76. * @type array<\Ydb\Coordination\SemaphoreSession>|\Google\Protobuf\Internal\RepeatedField $waiters
  77. * A list of current waiters on the semaphore
  78. * }
  79. */
  80. public function __construct($data = NULL) {
  81. \GPBMetadata\Protos\YdbCoordination::initOnce();
  82. parent::__construct($data);
  83. }
  84. /**
  85. * Name of the semaphore
  86. *
  87. * Generated from protobuf field <code>string name = 1;</code>
  88. * @return string
  89. */
  90. public function getName()
  91. {
  92. return $this->name;
  93. }
  94. /**
  95. * Name of the semaphore
  96. *
  97. * Generated from protobuf field <code>string name = 1;</code>
  98. * @param string $var
  99. * @return $this
  100. */
  101. public function setName($var)
  102. {
  103. GPBUtil::checkString($var, True);
  104. $this->name = $var;
  105. return $this;
  106. }
  107. /**
  108. * User-defined data attached to the semaphore
  109. *
  110. * Generated from protobuf field <code>bytes data = 2;</code>
  111. * @return string
  112. */
  113. public function getData()
  114. {
  115. return $this->data;
  116. }
  117. /**
  118. * User-defined data attached to the semaphore
  119. *
  120. * Generated from protobuf field <code>bytes data = 2;</code>
  121. * @param string $var
  122. * @return $this
  123. */
  124. public function setData($var)
  125. {
  126. GPBUtil::checkString($var, False);
  127. $this->data = $var;
  128. return $this;
  129. }
  130. /**
  131. * Number of tokens currently acquired by owners
  132. *
  133. * Generated from protobuf field <code>uint64 count = 7;</code>
  134. * @return int|string
  135. */
  136. public function getCount()
  137. {
  138. return $this->count;
  139. }
  140. /**
  141. * Number of tokens currently acquired by owners
  142. *
  143. * Generated from protobuf field <code>uint64 count = 7;</code>
  144. * @param int|string $var
  145. * @return $this
  146. */
  147. public function setCount($var)
  148. {
  149. GPBUtil::checkUint64($var);
  150. $this->count = $var;
  151. return $this;
  152. }
  153. /**
  154. * Maximum number of tokens that may acquired
  155. *
  156. * Generated from protobuf field <code>uint64 limit = 3;</code>
  157. * @return int|string
  158. */
  159. public function getLimit()
  160. {
  161. return $this->limit;
  162. }
  163. /**
  164. * Maximum number of tokens that may acquired
  165. *
  166. * Generated from protobuf field <code>uint64 limit = 3;</code>
  167. * @param int|string $var
  168. * @return $this
  169. */
  170. public function setLimit($var)
  171. {
  172. GPBUtil::checkUint64($var);
  173. $this->limit = $var;
  174. return $this;
  175. }
  176. /**
  177. * Ephemeral semaphores are deleted when released by all owners and waiters
  178. *
  179. * Generated from protobuf field <code>bool ephemeral = 4;</code>
  180. * @return bool
  181. */
  182. public function getEphemeral()
  183. {
  184. return $this->ephemeral;
  185. }
  186. /**
  187. * Ephemeral semaphores are deleted when released by all owners and waiters
  188. *
  189. * Generated from protobuf field <code>bool ephemeral = 4;</code>
  190. * @param bool $var
  191. * @return $this
  192. */
  193. public function setEphemeral($var)
  194. {
  195. GPBUtil::checkBool($var);
  196. $this->ephemeral = $var;
  197. return $this;
  198. }
  199. /**
  200. * A list of current owners of the semaphore
  201. *
  202. * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession owners = 5;</code>
  203. * @return \Google\Protobuf\Internal\RepeatedField
  204. */
  205. public function getOwners()
  206. {
  207. return $this->owners;
  208. }
  209. /**
  210. * A list of current owners of the semaphore
  211. *
  212. * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession owners = 5;</code>
  213. * @param array<\Ydb\Coordination\SemaphoreSession>|\Google\Protobuf\Internal\RepeatedField $var
  214. * @return $this
  215. */
  216. public function setOwners($var)
  217. {
  218. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Coordination\SemaphoreSession::class);
  219. $this->owners = $arr;
  220. return $this;
  221. }
  222. /**
  223. * A list of current waiters on the semaphore
  224. *
  225. * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession waiters = 6;</code>
  226. * @return \Google\Protobuf\Internal\RepeatedField
  227. */
  228. public function getWaiters()
  229. {
  230. return $this->waiters;
  231. }
  232. /**
  233. * A list of current waiters on the semaphore
  234. *
  235. * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession waiters = 6;</code>
  236. * @param array<\Ydb\Coordination\SemaphoreSession>|\Google\Protobuf\Internal\RepeatedField $var
  237. * @return $this
  238. */
  239. public function setWaiters($var)
  240. {
  241. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Coordination\SemaphoreSession::class);
  242. $this->waiters = $arr;
  243. return $this;
  244. }
  245. }