StartPartitionSessionResponse.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_topic.proto
  4. namespace Ydb\Topic\StreamReadMessage;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Signal for server that cient is ready to recive data for partition.
  10. *
  11. * Generated from protobuf message <code>Ydb.Topic.StreamReadMessage.StartPartitionSessionResponse</code>
  12. */
  13. class StartPartitionSessionResponse extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Partition session identifier of partition to start read.
  17. *
  18. * Generated from protobuf field <code>int64 partition_session_id = 1;</code>
  19. */
  20. protected $partition_session_id = 0;
  21. /**
  22. * Reads in this partition session will start from offset no less than read_offset.
  23. * If read_offset is set, server will check that read_offset is no less that actual committed offset.
  24. * If check fails then server will send an error message (status != SUCCESS) and close stream.
  25. * If read_offset is not set, no check will be made.
  26. * InitRequest.max_lag and InitRequest.read_from could lead to skip of more messages.
  27. * Server will return data starting from offset that is maximum of actual committed offset, read_offset (if set)
  28. * and offsets calculated from InitRequest.max_lag and InitRequest.read_from.
  29. *
  30. * Generated from protobuf field <code>optional int64 read_offset = 2;</code>
  31. */
  32. protected $read_offset = null;
  33. /**
  34. * All messages with offset less than commit_offset are processed by client.
  35. * Server will commit this position if this is not done yet.
  36. *
  37. * Generated from protobuf field <code>optional int64 commit_offset = 3;</code>
  38. */
  39. protected $commit_offset = null;
  40. /**
  41. * Constructor.
  42. *
  43. * @param array $data {
  44. * Optional. Data for populating the Message object.
  45. *
  46. * @type int|string $partition_session_id
  47. * Partition session identifier of partition to start read.
  48. * @type int|string $read_offset
  49. * Reads in this partition session will start from offset no less than read_offset.
  50. * If read_offset is set, server will check that read_offset is no less that actual committed offset.
  51. * If check fails then server will send an error message (status != SUCCESS) and close stream.
  52. * If read_offset is not set, no check will be made.
  53. * InitRequest.max_lag and InitRequest.read_from could lead to skip of more messages.
  54. * Server will return data starting from offset that is maximum of actual committed offset, read_offset (if set)
  55. * and offsets calculated from InitRequest.max_lag and InitRequest.read_from.
  56. * @type int|string $commit_offset
  57. * All messages with offset less than commit_offset are processed by client.
  58. * Server will commit this position if this is not done yet.
  59. * }
  60. */
  61. public function __construct($data = NULL) {
  62. \GPBMetadata\Protos\YdbTopic::initOnce();
  63. parent::__construct($data);
  64. }
  65. /**
  66. * Partition session identifier of partition to start read.
  67. *
  68. * Generated from protobuf field <code>int64 partition_session_id = 1;</code>
  69. * @return int|string
  70. */
  71. public function getPartitionSessionId()
  72. {
  73. return $this->partition_session_id;
  74. }
  75. /**
  76. * Partition session identifier of partition to start read.
  77. *
  78. * Generated from protobuf field <code>int64 partition_session_id = 1;</code>
  79. * @param int|string $var
  80. * @return $this
  81. */
  82. public function setPartitionSessionId($var)
  83. {
  84. GPBUtil::checkInt64($var);
  85. $this->partition_session_id = $var;
  86. return $this;
  87. }
  88. /**
  89. * Reads in this partition session will start from offset no less than read_offset.
  90. * If read_offset is set, server will check that read_offset is no less that actual committed offset.
  91. * If check fails then server will send an error message (status != SUCCESS) and close stream.
  92. * If read_offset is not set, no check will be made.
  93. * InitRequest.max_lag and InitRequest.read_from could lead to skip of more messages.
  94. * Server will return data starting from offset that is maximum of actual committed offset, read_offset (if set)
  95. * and offsets calculated from InitRequest.max_lag and InitRequest.read_from.
  96. *
  97. * Generated from protobuf field <code>optional int64 read_offset = 2;</code>
  98. * @return int|string
  99. */
  100. public function getReadOffset()
  101. {
  102. return isset($this->read_offset) ? $this->read_offset : 0;
  103. }
  104. public function hasReadOffset()
  105. {
  106. return isset($this->read_offset);
  107. }
  108. public function clearReadOffset()
  109. {
  110. unset($this->read_offset);
  111. }
  112. /**
  113. * Reads in this partition session will start from offset no less than read_offset.
  114. * If read_offset is set, server will check that read_offset is no less that actual committed offset.
  115. * If check fails then server will send an error message (status != SUCCESS) and close stream.
  116. * If read_offset is not set, no check will be made.
  117. * InitRequest.max_lag and InitRequest.read_from could lead to skip of more messages.
  118. * Server will return data starting from offset that is maximum of actual committed offset, read_offset (if set)
  119. * and offsets calculated from InitRequest.max_lag and InitRequest.read_from.
  120. *
  121. * Generated from protobuf field <code>optional int64 read_offset = 2;</code>
  122. * @param int|string $var
  123. * @return $this
  124. */
  125. public function setReadOffset($var)
  126. {
  127. GPBUtil::checkInt64($var);
  128. $this->read_offset = $var;
  129. return $this;
  130. }
  131. /**
  132. * All messages with offset less than commit_offset are processed by client.
  133. * Server will commit this position if this is not done yet.
  134. *
  135. * Generated from protobuf field <code>optional int64 commit_offset = 3;</code>
  136. * @return int|string
  137. */
  138. public function getCommitOffset()
  139. {
  140. return isset($this->commit_offset) ? $this->commit_offset : 0;
  141. }
  142. public function hasCommitOffset()
  143. {
  144. return isset($this->commit_offset);
  145. }
  146. public function clearCommitOffset()
  147. {
  148. unset($this->commit_offset);
  149. }
  150. /**
  151. * All messages with offset less than commit_offset are processed by client.
  152. * Server will commit this position if this is not done yet.
  153. *
  154. * Generated from protobuf field <code>optional int64 commit_offset = 3;</code>
  155. * @param int|string $var
  156. * @return $this
  157. */
  158. public function setCommitOffset($var)
  159. {
  160. GPBUtil::checkInt64($var);
  161. $this->commit_offset = $var;
  162. return $this;
  163. }
  164. }
  165. // Adding a class alias for backwards compatibility with the previous class name.
  166. class_alias(StartPartitionSessionResponse::class, \Ydb\Topic\StreamReadMessage_StartPartitionSessionResponse::class);