123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <?php
- # Generated by the protocol buffer compiler. DO NOT EDIT!
- # source: protos/ydb_coordination.proto
- namespace Ydb\Coordination;
- use Google\Protobuf\Internal\GPBType;
- use Google\Protobuf\Internal\RepeatedField;
- use Google\Protobuf\Internal\GPBUtil;
- /**
- **
- * Describes the state of a semaphore
- *
- * Generated from protobuf message <code>Ydb.Coordination.SemaphoreDescription</code>
- */
- class SemaphoreDescription extends \Google\Protobuf\Internal\Message
- {
- /**
- * Name of the semaphore
- *
- * Generated from protobuf field <code>string name = 1;</code>
- */
- protected $name = '';
- /**
- * User-defined data attached to the semaphore
- *
- * Generated from protobuf field <code>bytes data = 2;</code>
- */
- protected $data = '';
- /**
- * Number of tokens currently acquired by owners
- *
- * Generated from protobuf field <code>uint64 count = 7;</code>
- */
- protected $count = 0;
- /**
- * Maximum number of tokens that may acquired
- *
- * Generated from protobuf field <code>uint64 limit = 3;</code>
- */
- protected $limit = 0;
- /**
- * Ephemeral semaphores are deleted when released by all owners and waiters
- *
- * Generated from protobuf field <code>bool ephemeral = 4;</code>
- */
- protected $ephemeral = false;
- /**
- * A list of current owners of the semaphore
- *
- * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession owners = 5;</code>
- */
- private $owners;
- /**
- * A list of current waiters on the semaphore
- *
- * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession waiters = 6;</code>
- */
- private $waiters;
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type string $name
- * Name of the semaphore
- * @type string $data
- * User-defined data attached to the semaphore
- * @type int|string $count
- * Number of tokens currently acquired by owners
- * @type int|string $limit
- * Maximum number of tokens that may acquired
- * @type bool $ephemeral
- * Ephemeral semaphores are deleted when released by all owners and waiters
- * @type array<\Ydb\Coordination\SemaphoreSession>|\Google\Protobuf\Internal\RepeatedField $owners
- * A list of current owners of the semaphore
- * @type array<\Ydb\Coordination\SemaphoreSession>|\Google\Protobuf\Internal\RepeatedField $waiters
- * A list of current waiters on the semaphore
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\Protos\YdbCoordination::initOnce();
- parent::__construct($data);
- }
- /**
- * Name of the semaphore
- *
- * Generated from protobuf field <code>string name = 1;</code>
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Name of the semaphore
- *
- * Generated from protobuf field <code>string name = 1;</code>
- * @param string $var
- * @return $this
- */
- public function setName($var)
- {
- GPBUtil::checkString($var, True);
- $this->name = $var;
- return $this;
- }
- /**
- * User-defined data attached to the semaphore
- *
- * Generated from protobuf field <code>bytes data = 2;</code>
- * @return string
- */
- public function getData()
- {
- return $this->data;
- }
- /**
- * User-defined data attached to the semaphore
- *
- * Generated from protobuf field <code>bytes data = 2;</code>
- * @param string $var
- * @return $this
- */
- public function setData($var)
- {
- GPBUtil::checkString($var, False);
- $this->data = $var;
- return $this;
- }
- /**
- * Number of tokens currently acquired by owners
- *
- * Generated from protobuf field <code>uint64 count = 7;</code>
- * @return int|string
- */
- public function getCount()
- {
- return $this->count;
- }
- /**
- * Number of tokens currently acquired by owners
- *
- * Generated from protobuf field <code>uint64 count = 7;</code>
- * @param int|string $var
- * @return $this
- */
- public function setCount($var)
- {
- GPBUtil::checkUint64($var);
- $this->count = $var;
- return $this;
- }
- /**
- * Maximum number of tokens that may acquired
- *
- * Generated from protobuf field <code>uint64 limit = 3;</code>
- * @return int|string
- */
- public function getLimit()
- {
- return $this->limit;
- }
- /**
- * Maximum number of tokens that may acquired
- *
- * Generated from protobuf field <code>uint64 limit = 3;</code>
- * @param int|string $var
- * @return $this
- */
- public function setLimit($var)
- {
- GPBUtil::checkUint64($var);
- $this->limit = $var;
- return $this;
- }
- /**
- * Ephemeral semaphores are deleted when released by all owners and waiters
- *
- * Generated from protobuf field <code>bool ephemeral = 4;</code>
- * @return bool
- */
- public function getEphemeral()
- {
- return $this->ephemeral;
- }
- /**
- * Ephemeral semaphores are deleted when released by all owners and waiters
- *
- * Generated from protobuf field <code>bool ephemeral = 4;</code>
- * @param bool $var
- * @return $this
- */
- public function setEphemeral($var)
- {
- GPBUtil::checkBool($var);
- $this->ephemeral = $var;
- return $this;
- }
- /**
- * A list of current owners of the semaphore
- *
- * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession owners = 5;</code>
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getOwners()
- {
- return $this->owners;
- }
- /**
- * A list of current owners of the semaphore
- *
- * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession owners = 5;</code>
- * @param array<\Ydb\Coordination\SemaphoreSession>|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setOwners($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Coordination\SemaphoreSession::class);
- $this->owners = $arr;
- return $this;
- }
- /**
- * A list of current waiters on the semaphore
- *
- * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession waiters = 6;</code>
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getWaiters()
- {
- return $this->waiters;
- }
- /**
- * A list of current waiters on the semaphore
- *
- * Generated from protobuf field <code>repeated .Ydb.Coordination.SemaphoreSession waiters = 6;</code>
- * @param array<\Ydb\Coordination\SemaphoreSession>|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setWaiters($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Coordination\SemaphoreSession::class);
- $this->waiters = $arr;
- return $this;
- }
- }
|