123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <?php
- # Generated by the protocol buffer compiler. DO NOT EDIT!
- # source: protos/ydb_coordination.proto
- namespace Ydb\Coordination\SessionRequest;
- use Google\Protobuf\Internal\GPBType;
- use Google\Protobuf\Internal\RepeatedField;
- use Google\Protobuf\Internal\GPBUtil;
- /**
- **
- * Used to acquire a semaphore
- * WARNING: a single session cannot acquire the same semaphore multiple times
- * Later requests override previous operations with the same semaphore,
- * e.g. to reduce acquired count, change timeout or attached data.
- *
- * Generated from protobuf message <code>Ydb.Coordination.SessionRequest.AcquireSemaphore</code>
- */
- class AcquireSemaphore extends \Google\Protobuf\Internal\Message
- {
- /**
- * Client-defined request id, echoed in the response
- *
- * Generated from protobuf field <code>uint64 req_id = 1;</code>
- */
- protected $req_id = 0;
- /**
- * Name of the semaphore to acquire
- *
- * Generated from protobuf field <code>string name = 2;</code>
- */
- protected $name = '';
- /**
- * Timeout in milliseconds after which operation will fail
- * if it's still waiting in the waiters queue
- *
- * Generated from protobuf field <code>uint64 timeout_millis = 3;</code>
- */
- protected $timeout_millis = 0;
- /**
- * Number of tokens to acquire on the semaphore
- *
- * Generated from protobuf field <code>uint64 count = 4;</code>
- */
- protected $count = 0;
- /**
- * User-defined binary data that may be attached to the operation
- *
- * Generated from protobuf field <code>bytes data = 5;</code>
- */
- protected $data = '';
- /**
- * Ephemeral semaphores are created with the first acquire operation
- * and automatically deleted with the last release operation
- *
- * Generated from protobuf field <code>bool ephemeral = 6;</code>
- */
- protected $ephemeral = false;
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type int|string $req_id
- * Client-defined request id, echoed in the response
- * @type string $name
- * Name of the semaphore to acquire
- * @type int|string $timeout_millis
- * Timeout in milliseconds after which operation will fail
- * if it's still waiting in the waiters queue
- * @type int|string $count
- * Number of tokens to acquire on the semaphore
- * @type string $data
- * User-defined binary data that may be attached to the operation
- * @type bool $ephemeral
- * Ephemeral semaphores are created with the first acquire operation
- * and automatically deleted with the last release operation
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\Protos\YdbCoordination::initOnce();
- parent::__construct($data);
- }
- /**
- * Client-defined request id, echoed in the response
- *
- * Generated from protobuf field <code>uint64 req_id = 1;</code>
- * @return int|string
- */
- public function getReqId()
- {
- return $this->req_id;
- }
- /**
- * Client-defined request id, echoed in the response
- *
- * Generated from protobuf field <code>uint64 req_id = 1;</code>
- * @param int|string $var
- * @return $this
- */
- public function setReqId($var)
- {
- GPBUtil::checkUint64($var);
- $this->req_id = $var;
- return $this;
- }
- /**
- * Name of the semaphore to acquire
- *
- * Generated from protobuf field <code>string name = 2;</code>
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Name of the semaphore to acquire
- *
- * Generated from protobuf field <code>string name = 2;</code>
- * @param string $var
- * @return $this
- */
- public function setName($var)
- {
- GPBUtil::checkString($var, True);
- $this->name = $var;
- return $this;
- }
- /**
- * Timeout in milliseconds after which operation will fail
- * if it's still waiting in the waiters queue
- *
- * Generated from protobuf field <code>uint64 timeout_millis = 3;</code>
- * @return int|string
- */
- public function getTimeoutMillis()
- {
- return $this->timeout_millis;
- }
- /**
- * Timeout in milliseconds after which operation will fail
- * if it's still waiting in the waiters queue
- *
- * Generated from protobuf field <code>uint64 timeout_millis = 3;</code>
- * @param int|string $var
- * @return $this
- */
- public function setTimeoutMillis($var)
- {
- GPBUtil::checkUint64($var);
- $this->timeout_millis = $var;
- return $this;
- }
- /**
- * Number of tokens to acquire on the semaphore
- *
- * Generated from protobuf field <code>uint64 count = 4;</code>
- * @return int|string
- */
- public function getCount()
- {
- return $this->count;
- }
- /**
- * Number of tokens to acquire on the semaphore
- *
- * Generated from protobuf field <code>uint64 count = 4;</code>
- * @param int|string $var
- * @return $this
- */
- public function setCount($var)
- {
- GPBUtil::checkUint64($var);
- $this->count = $var;
- return $this;
- }
- /**
- * User-defined binary data that may be attached to the operation
- *
- * Generated from protobuf field <code>bytes data = 5;</code>
- * @return string
- */
- public function getData()
- {
- return $this->data;
- }
- /**
- * User-defined binary data that may be attached to the operation
- *
- * Generated from protobuf field <code>bytes data = 5;</code>
- * @param string $var
- * @return $this
- */
- public function setData($var)
- {
- GPBUtil::checkString($var, False);
- $this->data = $var;
- return $this;
- }
- /**
- * Ephemeral semaphores are created with the first acquire operation
- * and automatically deleted with the last release operation
- *
- * Generated from protobuf field <code>bool ephemeral = 6;</code>
- * @return bool
- */
- public function getEphemeral()
- {
- return $this->ephemeral;
- }
- /**
- * Ephemeral semaphores are created with the first acquire operation
- * and automatically deleted with the last release operation
- *
- * Generated from protobuf field <code>bool ephemeral = 6;</code>
- * @param bool $var
- * @return $this
- */
- public function setEphemeral($var)
- {
- GPBUtil::checkBool($var);
- $this->ephemeral = $var;
- return $this;
- }
- }
- // Adding a class alias for backwards compatibility with the previous class name.
- class_alias(AcquireSemaphore::class, \Ydb\Coordination\SessionRequest_AcquireSemaphore::class);
|