@@ -433,16 +433,33 @@ message ColumnMeta {
433433 }
434434}
435435
436+ message EvictionToExternalStorageSettings {
437+ // Path to external data source
438+ string storage_name = 1 ;
439+ }
440+
441+ message EvictionToFamilySettings {
442+ // Name of column family
443+ string family_name = 1 ;
444+ }
445+
446+ message TtlTier {
447+ uint32 evict_after_seconds = 1 ;
448+
449+ oneof action {
450+ google.protobuf.Empty delete = 2 ;
451+ EvictionToExternalStorageSettings evict_to_external_storage = 3 ;
452+ }
453+ }
454+
436455message DateTypeColumnModeSettings {
437- // The row will be considered as expired at the moment of time, when the value
456+ // The row will be assigned a tier at the moment of time, when the value
438457 // stored in <column_name> is less than or equal to the current time (in epoch
439- // time format), and <expire_after_seconds > has passed since that moment;
440- // i.e. the expiration threshold is the value of <column_name> plus <expire_after_seconds >.
458+ // time format), and <tier.evict_after_seconds > has passed since that moment;
459+ // i.e. the eviction threshold is the value of <column_name> plus <tier.evict_after_seconds >.
441460
442461 // The column type must be a date type
443462 string column_name = 1 ;
444-
445- uint32 expire_after_seconds = 2 ;
446463}
447464
448465message ValueSinceUnixEpochModeSettings {
@@ -465,16 +482,27 @@ message ValueSinceUnixEpochModeSettings {
465482
466483 // Interpretation of the value stored in <column_name>
467484 Unit column_unit = 2 ;
485+ }
468486
469- // This option is always interpreted as seconds regardless of the
470- // <column_unit> value.
487+ message DeprecatedDateTypeColumnModeSettings {
488+ // Deprecated TTL mode for internal use only
489+ string column_name = 1 ;
490+ uint32 expire_after_seconds = 2 ;
491+ }
492+
493+ message DeprecatedValueSinceUnixEpochModeSettings {
494+ // Deprecated TTL mode for internal use only
495+ string column_name = 1 ;
496+ ValueSinceUnixEpochModeSettings.Unit column_unit = 2 ;
471497 uint32 expire_after_seconds = 3 ;
472498}
473499
474500message TtlSettings {
475501 oneof mode {
476- DateTypeColumnModeSettings date_type_column = 1 ;
477- ValueSinceUnixEpochModeSettings value_since_unix_epoch = 2 ;
502+ DeprecatedDateTypeColumnModeSettings deprecated_date_type_column = 1 [deprecated = true ];
503+ DeprecatedValueSinceUnixEpochModeSettings deprecated_value_since_unix_epoch = 2 [deprecated = true ];
504+ DateTypeColumnModeSettings date_type_column = 4 ;
505+ ValueSinceUnixEpochModeSettings value_since_unix_epoch = 5 ;
478506 }
479507
480508 // There is no guarantee that expired row will be deleted immediately upon
@@ -490,6 +518,8 @@ message TtlSettings {
490518 // How often to run BRO on the same partition.
491519 // BRO will not be started more often, but may be started less often.
492520 uint32 run_interval_seconds = 3 ;
521+
522+ repeated TtlTier tiers = 6 ;
493523}
494524
495525message StorageSettings {
@@ -624,8 +654,7 @@ message CreateTableRequest {
624654 Ydb.FeatureFlag.Status key_bloom_filter = 16 ;
625655 // Read replicas settings for table
626656 ReadReplicasSettings read_replicas_settings = 17 ;
627- // Tiering rules name. It specifies how data migrates from one tier (logical storage) to another.
628- string tiering = 18 ;
657+ reserved 18 ; // tiering
629658 // Is temporary table
630659 bool temporary = 19 ;
631660 // Is table column or row oriented
@@ -704,11 +733,7 @@ message AlterTableRequest {
704733 repeated string drop_changefeeds = 20 ;
705734 // Rename existed index
706735 repeated RenameIndexItem rename_indexes = 21 ;
707- // Setup or remove tiering
708- oneof tiering_action {
709- string set_tiering = 22 ;
710- google.protobuf.Empty drop_tiering = 23 ;
711- }
736+ reserved 22 , 23 ; // tiering_action
712737}
713738
714739message AlterTableResponse {
0 commit comments