CreateTableRequest.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  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.CreateTableRequest</code>
  10. */
  11. class CreateTableRequest extends \Google\Protobuf\Internal\Message
  12. {
  13. /**
  14. * Session identifier
  15. *
  16. * Generated from protobuf field <code>string session_id = 1;</code>
  17. */
  18. protected $session_id = '';
  19. /**
  20. * Full path
  21. *
  22. * Generated from protobuf field <code>string path = 2;</code>
  23. */
  24. protected $path = '';
  25. /**
  26. * Columns (name, type)
  27. *
  28. * Generated from protobuf field <code>repeated .Ydb.Table.ColumnMeta columns = 3;</code>
  29. */
  30. private $columns;
  31. /**
  32. * List of columns used as primary key
  33. *
  34. * Generated from protobuf field <code>repeated string primary_key = 4;</code>
  35. */
  36. private $primary_key;
  37. /**
  38. * Table profile
  39. *
  40. * Generated from protobuf field <code>.Ydb.Table.TableProfile profile = 5;</code>
  41. */
  42. protected $profile = null;
  43. /**
  44. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 6;</code>
  45. */
  46. protected $operation_params = null;
  47. /**
  48. * List of secondary indexes
  49. *
  50. * Generated from protobuf field <code>repeated .Ydb.Table.TableIndex indexes = 7;</code>
  51. */
  52. private $indexes;
  53. /**
  54. * Table rows time to live settings
  55. *
  56. * Generated from protobuf field <code>.Ydb.Table.TtlSettings ttl_settings = 8;</code>
  57. */
  58. protected $ttl_settings = null;
  59. /**
  60. * Storage settings for table
  61. *
  62. * Generated from protobuf field <code>.Ydb.Table.StorageSettings storage_settings = 9;</code>
  63. */
  64. protected $storage_settings = null;
  65. /**
  66. * Column families
  67. *
  68. * Generated from protobuf field <code>repeated .Ydb.Table.ColumnFamily column_families = 10;</code>
  69. */
  70. private $column_families;
  71. /**
  72. * Attributes. Total size is limited to 10 KB.
  73. *
  74. * Generated from protobuf field <code>map<string, string> attributes = 11 [(.Ydb.length) = {</code>
  75. */
  76. private $attributes;
  77. /**
  78. * Predefined named set of settings for table compaction ["default", "small_table", "log_table"].
  79. *
  80. * Generated from protobuf field <code>string compaction_policy = 12;</code>
  81. */
  82. protected $compaction_policy = '';
  83. /**
  84. * Partitioning settings for table
  85. *
  86. * Generated from protobuf field <code>.Ydb.Table.PartitioningSettings partitioning_settings = 15;</code>
  87. */
  88. protected $partitioning_settings = null;
  89. /**
  90. * Bloom filter by key
  91. *
  92. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status key_bloom_filter = 16;</code>
  93. */
  94. protected $key_bloom_filter = 0;
  95. /**
  96. * Read replicas settings for table
  97. *
  98. * Generated from protobuf field <code>.Ydb.Table.ReadReplicasSettings read_replicas_settings = 17;</code>
  99. */
  100. protected $read_replicas_settings = null;
  101. protected $partitions;
  102. /**
  103. * Constructor.
  104. *
  105. * @param array $data {
  106. * Optional. Data for populating the Message object.
  107. *
  108. * @type string $session_id
  109. * Session identifier
  110. * @type string $path
  111. * Full path
  112. * @type array<\Ydb\Table\ColumnMeta>|\Google\Protobuf\Internal\RepeatedField $columns
  113. * Columns (name, type)
  114. * @type array<string>|\Google\Protobuf\Internal\RepeatedField $primary_key
  115. * List of columns used as primary key
  116. * @type \Ydb\Table\TableProfile $profile
  117. * Table profile
  118. * @type \Ydb\Operations\OperationParams $operation_params
  119. * @type array<\Ydb\Table\TableIndex>|\Google\Protobuf\Internal\RepeatedField $indexes
  120. * List of secondary indexes
  121. * @type \Ydb\Table\TtlSettings $ttl_settings
  122. * Table rows time to live settings
  123. * @type \Ydb\Table\StorageSettings $storage_settings
  124. * Storage settings for table
  125. * @type array<\Ydb\Table\ColumnFamily>|\Google\Protobuf\Internal\RepeatedField $column_families
  126. * Column families
  127. * @type array|\Google\Protobuf\Internal\MapField $attributes
  128. * Attributes. Total size is limited to 10 KB.
  129. * @type string $compaction_policy
  130. * Predefined named set of settings for table compaction ["default", "small_table", "log_table"].
  131. * @type int|string $uniform_partitions
  132. * Enable uniform partitioning using given partitions count.
  133. * The first components of primary key must have Uint32/Uint64 type.
  134. * @type \Ydb\Table\ExplicitPartitions $partition_at_keys
  135. * Explicitly specify key values which are used as borders for created partitions.
  136. * @type \Ydb\Table\PartitioningSettings $partitioning_settings
  137. * Partitioning settings for table
  138. * @type int $key_bloom_filter
  139. * Bloom filter by key
  140. * @type \Ydb\Table\ReadReplicasSettings $read_replicas_settings
  141. * Read replicas settings for table
  142. * }
  143. */
  144. public function __construct($data = NULL) {
  145. \GPBMetadata\Protos\YdbTable::initOnce();
  146. parent::__construct($data);
  147. }
  148. /**
  149. * Session identifier
  150. *
  151. * Generated from protobuf field <code>string session_id = 1;</code>
  152. * @return string
  153. */
  154. public function getSessionId()
  155. {
  156. return $this->session_id;
  157. }
  158. /**
  159. * Session identifier
  160. *
  161. * Generated from protobuf field <code>string session_id = 1;</code>
  162. * @param string $var
  163. * @return $this
  164. */
  165. public function setSessionId($var)
  166. {
  167. GPBUtil::checkString($var, True);
  168. $this->session_id = $var;
  169. return $this;
  170. }
  171. /**
  172. * Full path
  173. *
  174. * Generated from protobuf field <code>string path = 2;</code>
  175. * @return string
  176. */
  177. public function getPath()
  178. {
  179. return $this->path;
  180. }
  181. /**
  182. * Full path
  183. *
  184. * Generated from protobuf field <code>string path = 2;</code>
  185. * @param string $var
  186. * @return $this
  187. */
  188. public function setPath($var)
  189. {
  190. GPBUtil::checkString($var, True);
  191. $this->path = $var;
  192. return $this;
  193. }
  194. /**
  195. * Columns (name, type)
  196. *
  197. * Generated from protobuf field <code>repeated .Ydb.Table.ColumnMeta columns = 3;</code>
  198. * @return \Google\Protobuf\Internal\RepeatedField
  199. */
  200. public function getColumns()
  201. {
  202. return $this->columns;
  203. }
  204. /**
  205. * Columns (name, type)
  206. *
  207. * Generated from protobuf field <code>repeated .Ydb.Table.ColumnMeta columns = 3;</code>
  208. * @param array<\Ydb\Table\ColumnMeta>|\Google\Protobuf\Internal\RepeatedField $var
  209. * @return $this
  210. */
  211. public function setColumns($var)
  212. {
  213. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Table\ColumnMeta::class);
  214. $this->columns = $arr;
  215. return $this;
  216. }
  217. /**
  218. * List of columns used as primary key
  219. *
  220. * Generated from protobuf field <code>repeated string primary_key = 4;</code>
  221. * @return \Google\Protobuf\Internal\RepeatedField
  222. */
  223. public function getPrimaryKey()
  224. {
  225. return $this->primary_key;
  226. }
  227. /**
  228. * List of columns used as primary key
  229. *
  230. * Generated from protobuf field <code>repeated string primary_key = 4;</code>
  231. * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
  232. * @return $this
  233. */
  234. public function setPrimaryKey($var)
  235. {
  236. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
  237. $this->primary_key = $arr;
  238. return $this;
  239. }
  240. /**
  241. * Table profile
  242. *
  243. * Generated from protobuf field <code>.Ydb.Table.TableProfile profile = 5;</code>
  244. * @return \Ydb\Table\TableProfile|null
  245. */
  246. public function getProfile()
  247. {
  248. return $this->profile;
  249. }
  250. public function hasProfile()
  251. {
  252. return isset($this->profile);
  253. }
  254. public function clearProfile()
  255. {
  256. unset($this->profile);
  257. }
  258. /**
  259. * Table profile
  260. *
  261. * Generated from protobuf field <code>.Ydb.Table.TableProfile profile = 5;</code>
  262. * @param \Ydb\Table\TableProfile $var
  263. * @return $this
  264. */
  265. public function setProfile($var)
  266. {
  267. GPBUtil::checkMessage($var, \Ydb\Table\TableProfile::class);
  268. $this->profile = $var;
  269. return $this;
  270. }
  271. /**
  272. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 6;</code>
  273. * @return \Ydb\Operations\OperationParams|null
  274. */
  275. public function getOperationParams()
  276. {
  277. return $this->operation_params;
  278. }
  279. public function hasOperationParams()
  280. {
  281. return isset($this->operation_params);
  282. }
  283. public function clearOperationParams()
  284. {
  285. unset($this->operation_params);
  286. }
  287. /**
  288. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 6;</code>
  289. * @param \Ydb\Operations\OperationParams $var
  290. * @return $this
  291. */
  292. public function setOperationParams($var)
  293. {
  294. GPBUtil::checkMessage($var, \Ydb\Operations\OperationParams::class);
  295. $this->operation_params = $var;
  296. return $this;
  297. }
  298. /**
  299. * List of secondary indexes
  300. *
  301. * Generated from protobuf field <code>repeated .Ydb.Table.TableIndex indexes = 7;</code>
  302. * @return \Google\Protobuf\Internal\RepeatedField
  303. */
  304. public function getIndexes()
  305. {
  306. return $this->indexes;
  307. }
  308. /**
  309. * List of secondary indexes
  310. *
  311. * Generated from protobuf field <code>repeated .Ydb.Table.TableIndex indexes = 7;</code>
  312. * @param array<\Ydb\Table\TableIndex>|\Google\Protobuf\Internal\RepeatedField $var
  313. * @return $this
  314. */
  315. public function setIndexes($var)
  316. {
  317. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Table\TableIndex::class);
  318. $this->indexes = $arr;
  319. return $this;
  320. }
  321. /**
  322. * Table rows time to live settings
  323. *
  324. * Generated from protobuf field <code>.Ydb.Table.TtlSettings ttl_settings = 8;</code>
  325. * @return \Ydb\Table\TtlSettings|null
  326. */
  327. public function getTtlSettings()
  328. {
  329. return $this->ttl_settings;
  330. }
  331. public function hasTtlSettings()
  332. {
  333. return isset($this->ttl_settings);
  334. }
  335. public function clearTtlSettings()
  336. {
  337. unset($this->ttl_settings);
  338. }
  339. /**
  340. * Table rows time to live settings
  341. *
  342. * Generated from protobuf field <code>.Ydb.Table.TtlSettings ttl_settings = 8;</code>
  343. * @param \Ydb\Table\TtlSettings $var
  344. * @return $this
  345. */
  346. public function setTtlSettings($var)
  347. {
  348. GPBUtil::checkMessage($var, \Ydb\Table\TtlSettings::class);
  349. $this->ttl_settings = $var;
  350. return $this;
  351. }
  352. /**
  353. * Storage settings for table
  354. *
  355. * Generated from protobuf field <code>.Ydb.Table.StorageSettings storage_settings = 9;</code>
  356. * @return \Ydb\Table\StorageSettings|null
  357. */
  358. public function getStorageSettings()
  359. {
  360. return $this->storage_settings;
  361. }
  362. public function hasStorageSettings()
  363. {
  364. return isset($this->storage_settings);
  365. }
  366. public function clearStorageSettings()
  367. {
  368. unset($this->storage_settings);
  369. }
  370. /**
  371. * Storage settings for table
  372. *
  373. * Generated from protobuf field <code>.Ydb.Table.StorageSettings storage_settings = 9;</code>
  374. * @param \Ydb\Table\StorageSettings $var
  375. * @return $this
  376. */
  377. public function setStorageSettings($var)
  378. {
  379. GPBUtil::checkMessage($var, \Ydb\Table\StorageSettings::class);
  380. $this->storage_settings = $var;
  381. return $this;
  382. }
  383. /**
  384. * Column families
  385. *
  386. * Generated from protobuf field <code>repeated .Ydb.Table.ColumnFamily column_families = 10;</code>
  387. * @return \Google\Protobuf\Internal\RepeatedField
  388. */
  389. public function getColumnFamilies()
  390. {
  391. return $this->column_families;
  392. }
  393. /**
  394. * Column families
  395. *
  396. * Generated from protobuf field <code>repeated .Ydb.Table.ColumnFamily column_families = 10;</code>
  397. * @param array<\Ydb\Table\ColumnFamily>|\Google\Protobuf\Internal\RepeatedField $var
  398. * @return $this
  399. */
  400. public function setColumnFamilies($var)
  401. {
  402. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Table\ColumnFamily::class);
  403. $this->column_families = $arr;
  404. return $this;
  405. }
  406. /**
  407. * Attributes. Total size is limited to 10 KB.
  408. *
  409. * Generated from protobuf field <code>map<string, string> attributes = 11 [(.Ydb.length) = {</code>
  410. * @return \Google\Protobuf\Internal\MapField
  411. */
  412. public function getAttributes()
  413. {
  414. return $this->attributes;
  415. }
  416. /**
  417. * Attributes. Total size is limited to 10 KB.
  418. *
  419. * Generated from protobuf field <code>map<string, string> attributes = 11 [(.Ydb.length) = {</code>
  420. * @param array|\Google\Protobuf\Internal\MapField $var
  421. * @return $this
  422. */
  423. public function setAttributes($var)
  424. {
  425. $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
  426. $this->attributes = $arr;
  427. return $this;
  428. }
  429. /**
  430. * Predefined named set of settings for table compaction ["default", "small_table", "log_table"].
  431. *
  432. * Generated from protobuf field <code>string compaction_policy = 12;</code>
  433. * @return string
  434. */
  435. public function getCompactionPolicy()
  436. {
  437. return $this->compaction_policy;
  438. }
  439. /**
  440. * Predefined named set of settings for table compaction ["default", "small_table", "log_table"].
  441. *
  442. * Generated from protobuf field <code>string compaction_policy = 12;</code>
  443. * @param string $var
  444. * @return $this
  445. */
  446. public function setCompactionPolicy($var)
  447. {
  448. GPBUtil::checkString($var, True);
  449. $this->compaction_policy = $var;
  450. return $this;
  451. }
  452. /**
  453. * Enable uniform partitioning using given partitions count.
  454. * The first components of primary key must have Uint32/Uint64 type.
  455. *
  456. * Generated from protobuf field <code>uint64 uniform_partitions = 13;</code>
  457. * @return int|string
  458. */
  459. public function getUniformPartitions()
  460. {
  461. return $this->readOneof(13);
  462. }
  463. public function hasUniformPartitions()
  464. {
  465. return $this->hasOneof(13);
  466. }
  467. /**
  468. * Enable uniform partitioning using given partitions count.
  469. * The first components of primary key must have Uint32/Uint64 type.
  470. *
  471. * Generated from protobuf field <code>uint64 uniform_partitions = 13;</code>
  472. * @param int|string $var
  473. * @return $this
  474. */
  475. public function setUniformPartitions($var)
  476. {
  477. GPBUtil::checkUint64($var);
  478. $this->writeOneof(13, $var);
  479. return $this;
  480. }
  481. /**
  482. * Explicitly specify key values which are used as borders for created partitions.
  483. *
  484. * Generated from protobuf field <code>.Ydb.Table.ExplicitPartitions partition_at_keys = 14;</code>
  485. * @return \Ydb\Table\ExplicitPartitions|null
  486. */
  487. public function getPartitionAtKeys()
  488. {
  489. return $this->readOneof(14);
  490. }
  491. public function hasPartitionAtKeys()
  492. {
  493. return $this->hasOneof(14);
  494. }
  495. /**
  496. * Explicitly specify key values which are used as borders for created partitions.
  497. *
  498. * Generated from protobuf field <code>.Ydb.Table.ExplicitPartitions partition_at_keys = 14;</code>
  499. * @param \Ydb\Table\ExplicitPartitions $var
  500. * @return $this
  501. */
  502. public function setPartitionAtKeys($var)
  503. {
  504. GPBUtil::checkMessage($var, \Ydb\Table\ExplicitPartitions::class);
  505. $this->writeOneof(14, $var);
  506. return $this;
  507. }
  508. /**
  509. * Partitioning settings for table
  510. *
  511. * Generated from protobuf field <code>.Ydb.Table.PartitioningSettings partitioning_settings = 15;</code>
  512. * @return \Ydb\Table\PartitioningSettings|null
  513. */
  514. public function getPartitioningSettings()
  515. {
  516. return $this->partitioning_settings;
  517. }
  518. public function hasPartitioningSettings()
  519. {
  520. return isset($this->partitioning_settings);
  521. }
  522. public function clearPartitioningSettings()
  523. {
  524. unset($this->partitioning_settings);
  525. }
  526. /**
  527. * Partitioning settings for table
  528. *
  529. * Generated from protobuf field <code>.Ydb.Table.PartitioningSettings partitioning_settings = 15;</code>
  530. * @param \Ydb\Table\PartitioningSettings $var
  531. * @return $this
  532. */
  533. public function setPartitioningSettings($var)
  534. {
  535. GPBUtil::checkMessage($var, \Ydb\Table\PartitioningSettings::class);
  536. $this->partitioning_settings = $var;
  537. return $this;
  538. }
  539. /**
  540. * Bloom filter by key
  541. *
  542. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status key_bloom_filter = 16;</code>
  543. * @return int
  544. */
  545. public function getKeyBloomFilter()
  546. {
  547. return $this->key_bloom_filter;
  548. }
  549. /**
  550. * Bloom filter by key
  551. *
  552. * Generated from protobuf field <code>.Ydb.FeatureFlag.Status key_bloom_filter = 16;</code>
  553. * @param int $var
  554. * @return $this
  555. */
  556. public function setKeyBloomFilter($var)
  557. {
  558. GPBUtil::checkEnum($var, \Ydb\FeatureFlag\Status::class);
  559. $this->key_bloom_filter = $var;
  560. return $this;
  561. }
  562. /**
  563. * Read replicas settings for table
  564. *
  565. * Generated from protobuf field <code>.Ydb.Table.ReadReplicasSettings read_replicas_settings = 17;</code>
  566. * @return \Ydb\Table\ReadReplicasSettings|null
  567. */
  568. public function getReadReplicasSettings()
  569. {
  570. return $this->read_replicas_settings;
  571. }
  572. public function hasReadReplicasSettings()
  573. {
  574. return isset($this->read_replicas_settings);
  575. }
  576. public function clearReadReplicasSettings()
  577. {
  578. unset($this->read_replicas_settings);
  579. }
  580. /**
  581. * Read replicas settings for table
  582. *
  583. * Generated from protobuf field <code>.Ydb.Table.ReadReplicasSettings read_replicas_settings = 17;</code>
  584. * @param \Ydb\Table\ReadReplicasSettings $var
  585. * @return $this
  586. */
  587. public function setReadReplicasSettings($var)
  588. {
  589. GPBUtil::checkMessage($var, \Ydb\Table\ReadReplicasSettings::class);
  590. $this->read_replicas_settings = $var;
  591. return $this;
  592. }
  593. /**
  594. * @return string
  595. */
  596. public function getPartitions()
  597. {
  598. return $this->whichOneof("partitions");
  599. }
  600. }