InitRequest.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_topic.proto
  4. namespace Ydb\Topic\StreamWriteMessage;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Handshake request that must be sent to server first.
  10. *
  11. * Generated from protobuf message <code>Ydb.Topic.StreamWriteMessage.InitRequest</code>
  12. */
  13. class InitRequest extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Full path of topic to write to.
  17. *
  18. * Generated from protobuf field <code>string path = 1;</code>
  19. */
  20. protected $path = '';
  21. /**
  22. * Producer identifier of client data stream.
  23. * Used for message deduplication by sequence numbers.
  24. *
  25. * Generated from protobuf field <code>string producer_id = 2;</code>
  26. */
  27. protected $producer_id = '';
  28. /**
  29. * User metadata attached to this write session.
  30. * Reader will get this session meta data with each message read.
  31. *
  32. * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
  33. */
  34. private $write_session_meta;
  35. /**
  36. * Explicitly request for last sequential number
  37. * It may be expensive, if producer wrote to many partitions before.
  38. *
  39. * Generated from protobuf field <code>bool get_last_seq_no = 6;</code>
  40. */
  41. protected $get_last_seq_no = false;
  42. protected $partitioning;
  43. /**
  44. * Constructor.
  45. *
  46. * @param array $data {
  47. * Optional. Data for populating the Message object.
  48. *
  49. * @type string $path
  50. * Full path of topic to write to.
  51. * @type string $producer_id
  52. * Producer identifier of client data stream.
  53. * Used for message deduplication by sequence numbers.
  54. * @type array|\Google\Protobuf\Internal\MapField $write_session_meta
  55. * User metadata attached to this write session.
  56. * Reader will get this session meta data with each message read.
  57. * @type string $message_group_id
  58. * All messages with given pair (producer_id, message_group_id) go to single partition in order of writes.
  59. * @type int|string $partition_id
  60. * Explicit partition id to write to.
  61. * @type bool $get_last_seq_no
  62. * Explicitly request for last sequential number
  63. * It may be expensive, if producer wrote to many partitions before.
  64. * }
  65. */
  66. public function __construct($data = NULL) {
  67. \GPBMetadata\Protos\YdbTopic::initOnce();
  68. parent::__construct($data);
  69. }
  70. /**
  71. * Full path of topic to write to.
  72. *
  73. * Generated from protobuf field <code>string path = 1;</code>
  74. * @return string
  75. */
  76. public function getPath()
  77. {
  78. return $this->path;
  79. }
  80. /**
  81. * Full path of topic to write to.
  82. *
  83. * Generated from protobuf field <code>string path = 1;</code>
  84. * @param string $var
  85. * @return $this
  86. */
  87. public function setPath($var)
  88. {
  89. GPBUtil::checkString($var, True);
  90. $this->path = $var;
  91. return $this;
  92. }
  93. /**
  94. * Producer identifier of client data stream.
  95. * Used for message deduplication by sequence numbers.
  96. *
  97. * Generated from protobuf field <code>string producer_id = 2;</code>
  98. * @return string
  99. */
  100. public function getProducerId()
  101. {
  102. return $this->producer_id;
  103. }
  104. /**
  105. * Producer identifier of client data stream.
  106. * Used for message deduplication by sequence numbers.
  107. *
  108. * Generated from protobuf field <code>string producer_id = 2;</code>
  109. * @param string $var
  110. * @return $this
  111. */
  112. public function setProducerId($var)
  113. {
  114. GPBUtil::checkString($var, True);
  115. $this->producer_id = $var;
  116. return $this;
  117. }
  118. /**
  119. * User metadata attached to this write session.
  120. * Reader will get this session meta data with each message read.
  121. *
  122. * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
  123. * @return \Google\Protobuf\Internal\MapField
  124. */
  125. public function getWriteSessionMeta()
  126. {
  127. return $this->write_session_meta;
  128. }
  129. /**
  130. * User metadata attached to this write session.
  131. * Reader will get this session meta data with each message read.
  132. *
  133. * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
  134. * @param array|\Google\Protobuf\Internal\MapField $var
  135. * @return $this
  136. */
  137. public function setWriteSessionMeta($var)
  138. {
  139. $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
  140. $this->write_session_meta = $arr;
  141. return $this;
  142. }
  143. /**
  144. * All messages with given pair (producer_id, message_group_id) go to single partition in order of writes.
  145. *
  146. * Generated from protobuf field <code>string message_group_id = 4;</code>
  147. * @return string
  148. */
  149. public function getMessageGroupId()
  150. {
  151. return $this->readOneof(4);
  152. }
  153. public function hasMessageGroupId()
  154. {
  155. return $this->hasOneof(4);
  156. }
  157. /**
  158. * All messages with given pair (producer_id, message_group_id) go to single partition in order of writes.
  159. *
  160. * Generated from protobuf field <code>string message_group_id = 4;</code>
  161. * @param string $var
  162. * @return $this
  163. */
  164. public function setMessageGroupId($var)
  165. {
  166. GPBUtil::checkString($var, True);
  167. $this->writeOneof(4, $var);
  168. return $this;
  169. }
  170. /**
  171. * Explicit partition id to write to.
  172. *
  173. * Generated from protobuf field <code>int64 partition_id = 5;</code>
  174. * @return int|string
  175. */
  176. public function getPartitionId()
  177. {
  178. return $this->readOneof(5);
  179. }
  180. public function hasPartitionId()
  181. {
  182. return $this->hasOneof(5);
  183. }
  184. /**
  185. * Explicit partition id to write to.
  186. *
  187. * Generated from protobuf field <code>int64 partition_id = 5;</code>
  188. * @param int|string $var
  189. * @return $this
  190. */
  191. public function setPartitionId($var)
  192. {
  193. GPBUtil::checkInt64($var);
  194. $this->writeOneof(5, $var);
  195. return $this;
  196. }
  197. /**
  198. * Explicitly request for last sequential number
  199. * It may be expensive, if producer wrote to many partitions before.
  200. *
  201. * Generated from protobuf field <code>bool get_last_seq_no = 6;</code>
  202. * @return bool
  203. */
  204. public function getGetLastSeqNo()
  205. {
  206. return $this->get_last_seq_no;
  207. }
  208. /**
  209. * Explicitly request for last sequential number
  210. * It may be expensive, if producer wrote to many partitions before.
  211. *
  212. * Generated from protobuf field <code>bool get_last_seq_no = 6;</code>
  213. * @param bool $var
  214. * @return $this
  215. */
  216. public function setGetLastSeqNo($var)
  217. {
  218. GPBUtil::checkBool($var);
  219. $this->get_last_seq_no = $var;
  220. return $this;
  221. }
  222. /**
  223. * @return string
  224. */
  225. public function getPartitioning()
  226. {
  227. return $this->whichOneof("partitioning");
  228. }
  229. }
  230. // Adding a class alias for backwards compatibility with the previous class name.
  231. class_alias(InitRequest::class, \Ydb\Topic\StreamWriteMessage_InitRequest::class);