PartitioningPolicy.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_table.proto
  4. namespace Ydb\Table;
  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.Table.PartitioningPolicy</code>
  10. */
  11. class PartitioningPolicy extends \Google\Protobuf\Internal\Message
  12. {
  13. /**
  14. * Generated from protobuf field <code>string preset_name = 1;</code>
  15. */
  16. protected $preset_name = '';
  17. /**
  18. * Generated from protobuf field <code>.Ydb.Table.PartitioningPolicy.AutoPartitioningPolicy auto_partitioning = 2;</code>
  19. */
  20. protected $auto_partitioning = 0;
  21. protected $partitions;
  22. /**
  23. * Constructor.
  24. *
  25. * @param array $data {
  26. * Optional. Data for populating the Message object.
  27. *
  28. * @type string $preset_name
  29. * @type int $auto_partitioning
  30. * @type int|string $uniform_partitions
  31. * Allows to enable uniform sharding using given shards number.
  32. * The first components of primary key must have Uint32/Uint64 type.
  33. * @type \Ydb\Table\ExplicitPartitions $explicit_partitions
  34. * Explicitly specify key values which are used as borders for
  35. * created partitions.
  36. * }
  37. */
  38. public function __construct($data = NULL) {
  39. \GPBMetadata\Protos\YdbTable::initOnce();
  40. parent::__construct($data);
  41. }
  42. /**
  43. * Generated from protobuf field <code>string preset_name = 1;</code>
  44. * @return string
  45. */
  46. public function getPresetName()
  47. {
  48. return $this->preset_name;
  49. }
  50. /**
  51. * Generated from protobuf field <code>string preset_name = 1;</code>
  52. * @param string $var
  53. * @return $this
  54. */
  55. public function setPresetName($var)
  56. {
  57. GPBUtil::checkString($var, True);
  58. $this->preset_name = $var;
  59. return $this;
  60. }
  61. /**
  62. * Generated from protobuf field <code>.Ydb.Table.PartitioningPolicy.AutoPartitioningPolicy auto_partitioning = 2;</code>
  63. * @return int
  64. */
  65. public function getAutoPartitioning()
  66. {
  67. return $this->auto_partitioning;
  68. }
  69. /**
  70. * Generated from protobuf field <code>.Ydb.Table.PartitioningPolicy.AutoPartitioningPolicy auto_partitioning = 2;</code>
  71. * @param int $var
  72. * @return $this
  73. */
  74. public function setAutoPartitioning($var)
  75. {
  76. GPBUtil::checkEnum($var, \Ydb\Table\PartitioningPolicy\AutoPartitioningPolicy::class);
  77. $this->auto_partitioning = $var;
  78. return $this;
  79. }
  80. /**
  81. * Allows to enable uniform sharding using given shards number.
  82. * The first components of primary key must have Uint32/Uint64 type.
  83. *
  84. * Generated from protobuf field <code>uint64 uniform_partitions = 3;</code>
  85. * @return int|string
  86. */
  87. public function getUniformPartitions()
  88. {
  89. return $this->readOneof(3);
  90. }
  91. public function hasUniformPartitions()
  92. {
  93. return $this->hasOneof(3);
  94. }
  95. /**
  96. * Allows to enable uniform sharding using given shards number.
  97. * The first components of primary key must have Uint32/Uint64 type.
  98. *
  99. * Generated from protobuf field <code>uint64 uniform_partitions = 3;</code>
  100. * @param int|string $var
  101. * @return $this
  102. */
  103. public function setUniformPartitions($var)
  104. {
  105. GPBUtil::checkUint64($var);
  106. $this->writeOneof(3, $var);
  107. return $this;
  108. }
  109. /**
  110. * Explicitly specify key values which are used as borders for
  111. * created partitions.
  112. *
  113. * Generated from protobuf field <code>.Ydb.Table.ExplicitPartitions explicit_partitions = 4;</code>
  114. * @return \Ydb\Table\ExplicitPartitions|null
  115. */
  116. public function getExplicitPartitions()
  117. {
  118. return $this->readOneof(4);
  119. }
  120. public function hasExplicitPartitions()
  121. {
  122. return $this->hasOneof(4);
  123. }
  124. /**
  125. * Explicitly specify key values which are used as borders for
  126. * created partitions.
  127. *
  128. * Generated from protobuf field <code>.Ydb.Table.ExplicitPartitions explicit_partitions = 4;</code>
  129. * @param \Ydb\Table\ExplicitPartitions $var
  130. * @return $this
  131. */
  132. public function setExplicitPartitions($var)
  133. {
  134. GPBUtil::checkMessage($var, \Ydb\Table\ExplicitPartitions::class);
  135. $this->writeOneof(4, $var);
  136. return $this;
  137. }
  138. /**
  139. * @return string
  140. */
  141. public function getPartitions()
  142. {
  143. return $this->whichOneof("partitions");
  144. }
  145. }