TopicReadSettings.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_topic.proto
  4. namespace Ydb\Topic\StreamReadMessage\InitRequest;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Generated from protobuf message <code>Ydb.Topic.StreamReadMessage.InitRequest.TopicReadSettings</code>
  10. */
  11. class TopicReadSettings extends \Google\Protobuf\Internal\Message
  12. {
  13. /**
  14. * Topic path.
  15. *
  16. * Generated from protobuf field <code>string path = 1;</code>
  17. */
  18. protected $path = '';
  19. /**
  20. * Partitions that will be read by this session.
  21. * If list is empty - then session will read all partitions.
  22. *
  23. * Generated from protobuf field <code>repeated int64 partition_ids = 2;</code>
  24. */
  25. private $partition_ids;
  26. /**
  27. * Skip all messages that has write timestamp smaller than now - max_lag.
  28. * Zero means infinite lag.
  29. *
  30. * Generated from protobuf field <code>.google.protobuf.Duration max_lag = 3;</code>
  31. */
  32. protected $max_lag = null;
  33. /**
  34. * Read data only after this timestamp from this topic.
  35. * Read only messages with 'written_at' value greater or equal than this timestamp.
  36. *
  37. * Generated from protobuf field <code>.google.protobuf.Timestamp read_from = 4;</code>
  38. */
  39. protected $read_from = null;
  40. /**
  41. * Constructor.
  42. *
  43. * @param array $data {
  44. * Optional. Data for populating the Message object.
  45. *
  46. * @type string $path
  47. * Topic path.
  48. * @type array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $partition_ids
  49. * Partitions that will be read by this session.
  50. * If list is empty - then session will read all partitions.
  51. * @type \Google\Protobuf\Duration $max_lag
  52. * Skip all messages that has write timestamp smaller than now - max_lag.
  53. * Zero means infinite lag.
  54. * @type \Google\Protobuf\Timestamp $read_from
  55. * Read data only after this timestamp from this topic.
  56. * Read only messages with 'written_at' value greater or equal than this timestamp.
  57. * }
  58. */
  59. public function __construct($data = NULL) {
  60. \GPBMetadata\Protos\YdbTopic::initOnce();
  61. parent::__construct($data);
  62. }
  63. /**
  64. * Topic path.
  65. *
  66. * Generated from protobuf field <code>string path = 1;</code>
  67. * @return string
  68. */
  69. public function getPath()
  70. {
  71. return $this->path;
  72. }
  73. /**
  74. * Topic path.
  75. *
  76. * Generated from protobuf field <code>string path = 1;</code>
  77. * @param string $var
  78. * @return $this
  79. */
  80. public function setPath($var)
  81. {
  82. GPBUtil::checkString($var, True);
  83. $this->path = $var;
  84. return $this;
  85. }
  86. /**
  87. * Partitions that will be read by this session.
  88. * If list is empty - then session will read all partitions.
  89. *
  90. * Generated from protobuf field <code>repeated int64 partition_ids = 2;</code>
  91. * @return \Google\Protobuf\Internal\RepeatedField
  92. */
  93. public function getPartitionIds()
  94. {
  95. return $this->partition_ids;
  96. }
  97. /**
  98. * Partitions that will be read by this session.
  99. * If list is empty - then session will read all partitions.
  100. *
  101. * Generated from protobuf field <code>repeated int64 partition_ids = 2;</code>
  102. * @param array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $var
  103. * @return $this
  104. */
  105. public function setPartitionIds($var)
  106. {
  107. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64);
  108. $this->partition_ids = $arr;
  109. return $this;
  110. }
  111. /**
  112. * Skip all messages that has write timestamp smaller than now - max_lag.
  113. * Zero means infinite lag.
  114. *
  115. * Generated from protobuf field <code>.google.protobuf.Duration max_lag = 3;</code>
  116. * @return \Google\Protobuf\Duration|null
  117. */
  118. public function getMaxLag()
  119. {
  120. return $this->max_lag;
  121. }
  122. public function hasMaxLag()
  123. {
  124. return isset($this->max_lag);
  125. }
  126. public function clearMaxLag()
  127. {
  128. unset($this->max_lag);
  129. }
  130. /**
  131. * Skip all messages that has write timestamp smaller than now - max_lag.
  132. * Zero means infinite lag.
  133. *
  134. * Generated from protobuf field <code>.google.protobuf.Duration max_lag = 3;</code>
  135. * @param \Google\Protobuf\Duration $var
  136. * @return $this
  137. */
  138. public function setMaxLag($var)
  139. {
  140. GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
  141. $this->max_lag = $var;
  142. return $this;
  143. }
  144. /**
  145. * Read data only after this timestamp from this topic.
  146. * Read only messages with 'written_at' value greater or equal than this timestamp.
  147. *
  148. * Generated from protobuf field <code>.google.protobuf.Timestamp read_from = 4;</code>
  149. * @return \Google\Protobuf\Timestamp|null
  150. */
  151. public function getReadFrom()
  152. {
  153. return $this->read_from;
  154. }
  155. public function hasReadFrom()
  156. {
  157. return isset($this->read_from);
  158. }
  159. public function clearReadFrom()
  160. {
  161. unset($this->read_from);
  162. }
  163. /**
  164. * Read data only after this timestamp from this topic.
  165. * Read only messages with 'written_at' value greater or equal than this timestamp.
  166. *
  167. * Generated from protobuf field <code>.google.protobuf.Timestamp read_from = 4;</code>
  168. * @param \Google\Protobuf\Timestamp $var
  169. * @return $this
  170. */
  171. public function setReadFrom($var)
  172. {
  173. GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
  174. $this->read_from = $var;
  175. return $this;
  176. }
  177. }
  178. // Adding a class alias for backwards compatibility with the previous class name.
  179. class_alias(TopicReadSettings::class, \Ydb\Topic\StreamReadMessage_InitRequest_TopicReadSettings::class);