ReplicationPolicy.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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.ReplicationPolicy</code>
  10. */
  11. class ReplicationPolicy 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. * If value is non-zero then it specifies a number of read-only
  19. * replicas to create for a table. Zero value means preset
  20. * setting usage.
  21. *
  22. * Generated from protobuf field <code>uint32 replicas_count = 2;</code>
  23. */
  24. protected $replicas_count = 0;
  25. /**
  26. * If this feature in enabled then requested number of replicas
  27. * will be created in each availability zone.
  28. *
  29. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status create_per_availability_zone = 3;</code>
  30. */
  31. protected $create_per_availability_zone = 0;
  32. /**
  33. * If this feature in enabled then read-only replicas can be promoted
  34. * to leader.
  35. *
  36. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status allow_promotion = 4;</code>
  37. */
  38. protected $allow_promotion = 0;
  39. /**
  40. * Constructor.
  41. *
  42. * @param array $data {
  43. * Optional. Data for populating the Message object.
  44. *
  45. * @type string $preset_name
  46. * @type int $replicas_count
  47. * If value is non-zero then it specifies a number of read-only
  48. * replicas to create for a table. Zero value means preset
  49. * setting usage.
  50. * @type int $create_per_availability_zone
  51. * If this feature in enabled then requested number of replicas
  52. * will be created in each availability zone.
  53. * @type int $allow_promotion
  54. * If this feature in enabled then read-only replicas can be promoted
  55. * to leader.
  56. * }
  57. */
  58. public function __construct($data = NULL) {
  59. \GPBMetadata\Protos\YdbTable::initOnce();
  60. parent::__construct($data);
  61. }
  62. /**
  63. * Generated from protobuf field <code>string preset_name = 1;</code>
  64. * @return string
  65. */
  66. public function getPresetName()
  67. {
  68. return $this->preset_name;
  69. }
  70. /**
  71. * Generated from protobuf field <code>string preset_name = 1;</code>
  72. * @param string $var
  73. * @return $this
  74. */
  75. public function setPresetName($var)
  76. {
  77. GPBUtil::checkString($var, True);
  78. $this->preset_name = $var;
  79. return $this;
  80. }
  81. /**
  82. * If value is non-zero then it specifies a number of read-only
  83. * replicas to create for a table. Zero value means preset
  84. * setting usage.
  85. *
  86. * Generated from protobuf field <code>uint32 replicas_count = 2;</code>
  87. * @return int
  88. */
  89. public function getReplicasCount()
  90. {
  91. return $this->replicas_count;
  92. }
  93. /**
  94. * If value is non-zero then it specifies a number of read-only
  95. * replicas to create for a table. Zero value means preset
  96. * setting usage.
  97. *
  98. * Generated from protobuf field <code>uint32 replicas_count = 2;</code>
  99. * @param int $var
  100. * @return $this
  101. */
  102. public function setReplicasCount($var)
  103. {
  104. GPBUtil::checkUint32($var);
  105. $this->replicas_count = $var;
  106. return $this;
  107. }
  108. /**
  109. * If this feature in enabled then requested number of replicas
  110. * will be created in each availability zone.
  111. *
  112. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status create_per_availability_zone = 3;</code>
  113. * @return int
  114. */
  115. public function getCreatePerAvailabilityZone()
  116. {
  117. return $this->create_per_availability_zone;
  118. }
  119. /**
  120. * If this feature in enabled then requested number of replicas
  121. * will be created in each availability zone.
  122. *
  123. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status create_per_availability_zone = 3;</code>
  124. * @param int $var
  125. * @return $this
  126. */
  127. public function setCreatePerAvailabilityZone($var)
  128. {
  129. GPBUtil::checkEnum($var, \Ydb\FeatureFlag\Status::class);
  130. $this->create_per_availability_zone = $var;
  131. return $this;
  132. }
  133. /**
  134. * If this feature in enabled then read-only replicas can be promoted
  135. * to leader.
  136. *
  137. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status allow_promotion = 4;</code>
  138. * @return int
  139. */
  140. public function getAllowPromotion()
  141. {
  142. return $this->allow_promotion;
  143. }
  144. /**
  145. * If this feature in enabled then read-only replicas can be promoted
  146. * to leader.
  147. *
  148. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status allow_promotion = 4;</code>
  149. * @param int $var
  150. * @return $this
  151. */
  152. public function setAllowPromotion($var)
  153. {
  154. GPBUtil::checkEnum($var, \Ydb\FeatureFlag\Status::class);
  155. $this->allow_promotion = $var;
  156. return $this;
  157. }
  158. }