diff --git a/ydb/apps/ydb/CHANGELOG.md b/ydb/apps/ydb/CHANGELOG.md index 4ce980e871bd..266174623a64 100644 --- a/ydb/apps/ydb/CHANGELOG.md +++ b/ydb/apps/ydb/CHANGELOG.md @@ -1,3 +1,5 @@ +* Added the `--include-index-data` option to the `ydb export s3` command, enabling index data export. +* Added the `--index-population-mode` option to the `ydb import s3` command, allowing selection of the index population mode (e.g. build or import). ## 2.28.0 ## @@ -12,8 +14,6 @@ * The `ydb workload vector` now supports the `import files` subcommand to populate the table from CSV or parquet files. * The `ydb workload vector` now supports the `import generate` subcommand to populate the table with random data. * Named expression-containing view restoration and restoration of views that access secondary indexes have been fixed. -* Added the `--materialize-indexes` option to the `ydb export s3` command, enabling index materialization during export. -* Added the `--index-filling-mode` option to the `ydb import s3` command, allowing selection of the index filling mode (e.g. build or import a materialized index). * Added new options for shared consumers only to the `ydb topic consumer add` command to configure DLQ and max attempts policy ## 2.27.0 ## diff --git a/ydb/core/tx/schemeshard/schemeshard__init.cpp b/ydb/core/tx/schemeshard/schemeshard__init.cpp index 8885156b1cdf..f845df82b10a 100644 --- a/ydb/core/tx/schemeshard/schemeshard__init.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__init.cpp @@ -4458,7 +4458,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase { exportInfo->EndTime = TInstant::Seconds(rowset.GetValueOrDefault()); exportInfo->EnableChecksums = rowset.GetValueOrDefault(false); exportInfo->EnablePermissions = rowset.GetValueOrDefault(false); - exportInfo->MaterializeIndexes = rowset.GetValueOrDefault(false); + exportInfo->IncludeIndexData = rowset.GetValueOrDefault(false); if (rowset.HaveValue()) { exportInfo->ExportMetadata = rowset.GetValue(); diff --git a/ydb/core/tx/schemeshard/schemeshard_export.cpp b/ydb/core/tx/schemeshard/schemeshard_export.cpp index cd7695b501e4..2f9731956efa 100644 --- a/ydb/core/tx/schemeshard/schemeshard_export.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_export.cpp @@ -157,7 +157,7 @@ void TSchemeShard::PersistCreateExport(NIceDb::TNiceDb& db, const TExportInfo& e NIceDb::TUpdate(exportInfo.Items.size()), NIceDb::TUpdate(exportInfo.EnableChecksums), NIceDb::TUpdate(exportInfo.EnablePermissions), - NIceDb::TUpdate(exportInfo.MaterializeIndexes), + NIceDb::TUpdate(exportInfo.IncludeIndexData), NIceDb::TUpdate(exportInfo.PeerName), NIceDb::TUpdate(exportInfo.SanitizedToken) ); diff --git a/ydb/core/tx/schemeshard/schemeshard_export__create.cpp b/ydb/core/tx/schemeshard/schemeshard_export__create.cpp index 0c816486a047..6c61b7e02ac9 100644 --- a/ydb/core/tx/schemeshard/schemeshard_export__create.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_export__create.cpp @@ -37,8 +37,8 @@ bool IsPathTypeTransferrable(const NKikimr::NSchemeShard::TExportInfo::TItem& it } template -concept HasMaterializeIndexes = requires(const T& t) { - { t.materialize_indexes() } -> std::same_as; +concept HasIncludeIndexData = requires(const T& t) { + { t.include_index_data() } -> std::same_as; }; } @@ -123,8 +123,8 @@ struct TSchemeShard::TExport::TTxCreate: public TSchemeShard::TXxport::TTxBase { auto processExportSettings = [&](const TSettings& settings, TExportInfo::EKind kind, bool enableFeatureFlags) -> bool { exportInfo = new TExportInfo(id, uid, kind, settings, domainPath.Base()->PathId, request.GetPeerName()); - if constexpr (HasMaterializeIndexes) { - exportInfo->MaterializeIndexes = settings.materialize_indexes(); + if constexpr (HasIncludeIndexData) { + exportInfo->IncludeIndexData = settings.include_index_data(); } if (enableFeatureFlags) { exportInfo->EnableChecksums = AppData()->FeatureFlags.GetEnableChecksumsExport(); @@ -154,7 +154,7 @@ struct TSchemeShard::TExport::TTxCreate: public TSchemeShard::TXxport::TTxBase { if (!settings.scheme()) { settings.set_scheme(Ydb::Export::ExportToS3Settings::HTTPS); } - if (settings.materialize_indexes() && !AppData()->FeatureFlags.GetEnableIndexMaterialization()) { + if (settings.include_index_data() && !AppData()->FeatureFlags.GetEnableIndexMaterialization()) { return Reply( std::move(response), Ydb::StatusIds::PRECONDITION_FAILED, @@ -271,7 +271,7 @@ struct TSchemeShard::TExport::TTxCreate: public TSchemeShard::TXxport::TTxBase { exportInfo.Items.emplace_back(item.source_path(), path.Base()->PathId, path->PathType); exportInfo.PendingItems.push_back(exportInfo.Items.size() - 1); - if (exportInfo.MaterializeIndexes && path.Base()->IsTable()) { + if (exportInfo.IncludeIndexData && path.Base()->IsTable()) { for (const auto& [childName, childPathId] : path.Base()->GetChildren()) { TVector childParts; childParts.push_back(childName); diff --git a/ydb/core/tx/schemeshard/schemeshard_export_flow_proposals.cpp b/ydb/core/tx/schemeshard/schemeshard_export_flow_proposals.cpp index df720a8ed545..6ed12a40b20d 100644 --- a/ydb/core/tx/schemeshard/schemeshard_export_flow_proposals.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_export_flow_proposals.cpp @@ -61,7 +61,7 @@ THolder CopyTablesPropose( auto& desc = *copyTables.Add(); desc.SetSrcPath(item.SourcePathName); desc.SetDstPath(ExportItemPathName(ss, exportInfo, itemIdx)); - desc.SetOmitIndexes(!exportInfo.MaterializeIndexes); + desc.SetOmitIndexes(!exportInfo.IncludeIndexData); desc.SetOmitFollowers(true); desc.SetIsBackup(true); } diff --git a/ydb/core/tx/schemeshard/schemeshard_import.cpp b/ydb/core/tx/schemeshard/schemeshard_import.cpp index 30bb99e7070f..81b9bdda8455 100644 --- a/ydb/core/tx/schemeshard/schemeshard_import.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_import.cpp @@ -454,12 +454,12 @@ bool NeedToBuildIndexes(const TImportInfo& importInfo, ui32 itemIdx) { Y_ABORT_UNLESS(itemIdx < importInfo.Items.size()); auto& item = importInfo.Items.at(itemIdx); - switch (importInfo.GetS3Settings().index_filling_mode()) { - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_BUILD: + switch (importInfo.GetS3Settings().index_population_mode()) { + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_BUILD: return true; - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_AUTO: + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_AUTO: return item.ChildItems.empty(); - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_IMPORT: + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_IMPORT: return false; default: return true; diff --git a/ydb/core/tx/schemeshard/schemeshard_import__create.cpp b/ydb/core/tx/schemeshard/schemeshard_import__create.cpp index f554424d98b9..328f4a508e01 100644 --- a/ydb/core/tx/schemeshard/schemeshard_import__create.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_import__create.cpp @@ -193,9 +193,9 @@ struct TSchemeShard::TImport::TTxCreate: public TSchemeShard::TXxport::TTxBase { } if (!AppData()->FeatureFlags.GetEnableIndexMaterialization()) { - switch (settings.index_filling_mode()) { - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_IMPORT: - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_AUTO: + switch (settings.index_population_mode()) { + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_IMPORT: + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_AUTO: return Reply( std::move(response), Ydb::StatusIds::PRECONDITION_FAILED, diff --git a/ydb/core/tx/schemeshard/schemeshard_import_getters.cpp b/ydb/core/tx/schemeshard/schemeshard_import_getters.cpp index cef2a01fc38e..f2a60cda5f34 100644 --- a/ydb/core/tx/schemeshard/schemeshard_import_getters.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_import_getters.cpp @@ -409,7 +409,7 @@ class TSchemeGetter: public TGetterFromS3 { << ": self# " << SelfId() << ", result# " << result); - const bool canSkip = IndexFillingMode != Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_IMPORT; + const bool canSkip = IndexPopulationMode != Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_IMPORT; if (canSkip && NoObjectFound(result.GetError().GetErrorType())) { Y_ABORT_UNLESS(ItemIdx < ImportInfo->Items.size()); auto& item = ImportInfo->Items.at(ItemIdx); @@ -798,10 +798,10 @@ class TSchemeGetter: public TGetterFromS3 { Download(PermissionsKey); } - static bool NeedToCheckMaterializedIndexes(Ydb::Import::ImportFromS3Settings::IndexFillingMode mode) { + static bool NeedToCheckMaterializedIndexes(Ydb::Import::ImportFromS3Settings::IndexPopulationMode mode) { switch (mode) { - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_IMPORT: - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_AUTO: + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_IMPORT: + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_AUTO: return true; default: return false; @@ -915,7 +915,7 @@ class TSchemeGetter: public TGetterFromS3 { void StartCheckingMaterializedIndexes() { ResetRetries(); - if (NeedToCheckMaterializedIndexes(IndexFillingMode)) { + if (NeedToCheckMaterializedIndexes(IndexPopulationMode)) { CheckMaterializedIndexes(); } else { StartDownloadingChangefeeds(); @@ -936,7 +936,7 @@ class TSchemeGetter: public TGetterFromS3 { , MetadataKey(MetadataKeyFromSettings(*ImportInfo, itemIdx)) , SchemeKey(SchemeKeyFromSettings(*ImportInfo, itemIdx, "scheme.pb")) , PermissionsKey(PermissionsKeyFromSettings(*ImportInfo, itemIdx)) - , IndexFillingMode(ImportInfo->GetS3Settings().index_filling_mode()) + , IndexPopulationMode(ImportInfo->GetS3Settings().index_population_mode()) , NeedDownloadPermissions(!ImportInfo->GetNoAcl()) , NeedValidateChecksums(!ImportInfo->GetSkipChecksumValidation()) { @@ -1023,7 +1023,7 @@ class TSchemeGetter: public TGetterFromS3 { TVector IndexImplTablePrefixes; ui64 IndexCheckedMaterializedIndexImplTable = 0; - Ydb::Import::ImportFromS3Settings::IndexFillingMode IndexFillingMode; + Ydb::Import::ImportFromS3Settings::IndexPopulationMode IndexPopulationMode; bool NeedDownloadPermissions = true; bool NeedValidateChecksums = true; diff --git a/ydb/core/tx/schemeshard/schemeshard_info_types.h b/ydb/core/tx/schemeshard/schemeshard_info_types.h index 05d1fe76ed36..8e00dac62196 100644 --- a/ydb/core/tx/schemeshard/schemeshard_info_types.h +++ b/ydb/core/tx/schemeshard/schemeshard_info_types.h @@ -3029,7 +3029,7 @@ struct TExportInfo: public TSimpleRefCount { bool EnableChecksums = false; bool EnablePermissions = false; - bool MaterializeIndexes = false; + bool IncludeIndexData = false; NKikimrSchemeOp::TExportMetadata ExportMetadata; TActorId ExportMetadataUploader; diff --git a/ydb/core/tx/schemeshard/schemeshard_schema.h b/ydb/core/tx/schemeshard/schemeshard_schema.h index 273cce592906..564abce7ce58 100644 --- a/ydb/core/tx/schemeshard/schemeshard_schema.h +++ b/ydb/core/tx/schemeshard/schemeshard_schema.h @@ -1247,7 +1247,7 @@ struct Schema : NIceDb::Schema { struct EnableChecksums : Column<17, NScheme::NTypeIds::Bool> {}; struct EnablePermissions : Column<18, NScheme::NTypeIds::Bool> {}; - struct MaterializeIndexes : Column<21, NScheme::NTypeIds::Bool> {}; + struct IncludeIndexData : Column<21, NScheme::NTypeIds::Bool> {}; struct ExportMetadata : Column<19, NScheme::NTypeIds::String> { using Type = NKikimrSchemeOp::TExportMetadata; }; @@ -1273,7 +1273,7 @@ struct Schema : NIceDb::Schema { EnablePermissions, ExportMetadata, SanitizedToken, - MaterializeIndexes + IncludeIndexData >; }; diff --git a/ydb/core/tx/schemeshard/ut_export/ut_export.cpp b/ydb/core/tx/schemeshard/ut_export/ut_export.cpp index 29605f1c1d2c..9c97b8b0c500 100644 --- a/ydb/core/tx/schemeshard/ut_export/ut_export.cpp +++ b/ydb/core/tx/schemeshard/ut_export/ut_export.cpp @@ -3114,7 +3114,7 @@ attributes { ExportToS3Settings { endpoint: "localhost:%d" scheme: HTTP - materialize_indexes: true + include_index_data: true items { source_path: "/MyRoot/Table" destination_prefix: "" diff --git a/ydb/core/tx/schemeshard/ut_export_reboots_s3/ut_export_reboots_s3.cpp b/ydb/core/tx/schemeshard/ut_export_reboots_s3/ut_export_reboots_s3.cpp index fbba958141c1..d551eb67574b 100644 --- a/ydb/core/tx/schemeshard/ut_export_reboots_s3/ut_export_reboots_s3.cpp +++ b/ydb/core/tx/schemeshard/ut_export_reboots_s3/ut_export_reboots_s3.cpp @@ -757,7 +757,7 @@ Y_UNIT_TEST_SUITE(TExportToS3WithRebootsTests) { ExportToS3Settings { endpoint: "localhost:%d" scheme: HTTP - materialize_indexes: true + include_index_data: true items { source_path: "/MyRoot/Table" destination_prefix: "" diff --git a/ydb/core/tx/schemeshard/ut_restore/ut_restore.cpp b/ydb/core/tx/schemeshard/ut_restore/ut_restore.cpp index 46623503e039..8ebd1e9b5b74 100644 --- a/ydb/core/tx/schemeshard/ut_restore/ut_restore.cpp +++ b/ydb/core/tx/schemeshard/ut_restore/ut_restore.cpp @@ -6315,7 +6315,7 @@ Y_UNIT_TEST_SUITE(TImportTests) { UNIT_ASSERT_EQUAL(issues.begin()->message(), "Unsupported scheme object type"); } - void MaterializedIndex(Ydb::Import::ImportFromS3Settings::IndexFillingMode mode) { + void MaterializedIndex(Ydb::Import::ImportFromS3Settings::IndexPopulationMode mode) { TTestBasicRuntime runtime; TTestEnv env(runtime, TTestEnvOptions().EnableIndexMaterialization(true)); @@ -6353,13 +6353,13 @@ Y_UNIT_TEST_SUITE(TImportTests) { ImportFromS3Settings { endpoint: "localhost:%%d" scheme: HTTP - index_filling_mode: %s + index_population_mode: %s items { source_prefix: "a" destination_path: "/MyRoot/Table" } } - )", Ydb::Import::ImportFromS3Settings::IndexFillingMode_Name(mode).c_str())); + )", Ydb::Import::ImportFromS3Settings::IndexPopulationMode_Name(mode).c_str())); TestDescribeResult(DescribePath(runtime, "/MyRoot/Table"), { NLs::PathExist, @@ -6368,18 +6368,18 @@ Y_UNIT_TEST_SUITE(TImportTests) { } Y_UNIT_TEST(MaterializedIndexBuild) { - MaterializedIndex(Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_BUILD); + MaterializedIndex(Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_BUILD); } Y_UNIT_TEST(MaterializedIndexImport) { - MaterializedIndex(Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_IMPORT); + MaterializedIndex(Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_IMPORT); } Y_UNIT_TEST(MaterializedIndexAuto) { - MaterializedIndex(Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_AUTO); + MaterializedIndex(Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_AUTO); } - void MaterializedIndexAbsent(Ydb::Import::ImportFromS3Settings::IndexFillingMode mode, bool shouldFail) { + void MaterializedIndexAbsent(Ydb::Import::ImportFromS3Settings::IndexPopulationMode mode, bool shouldFail) { TTestBasicRuntime runtime; TTestEnv env(runtime, TTestEnvOptions().EnableIndexMaterialization(true)); @@ -6405,13 +6405,13 @@ Y_UNIT_TEST_SUITE(TImportTests) { ImportFromS3Settings { endpoint: "localhost:%%d" scheme: HTTP - index_filling_mode: %s + index_population_mode: %s items { source_prefix: "a" destination_path: "/MyRoot/Table" } } - )", Ydb::Import::ImportFromS3Settings::IndexFillingMode_Name(mode).c_str()), expectedStatus); + )", Ydb::Import::ImportFromS3Settings::IndexPopulationMode_Name(mode).c_str()), expectedStatus); if (shouldFail) { return; @@ -6424,15 +6424,15 @@ Y_UNIT_TEST_SUITE(TImportTests) { } Y_UNIT_TEST(MaterializedIndexAbsentBuild) { - MaterializedIndexAbsent(Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_BUILD, false); + MaterializedIndexAbsent(Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_BUILD, false); } Y_UNIT_TEST(MaterializedIndexAbsentImport) { - MaterializedIndexAbsent(Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_IMPORT, true); + MaterializedIndexAbsent(Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_IMPORT, true); } Y_UNIT_TEST(MaterializedIndexAbsentAuto) { - MaterializedIndexAbsent(Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_AUTO, false); + MaterializedIndexAbsent(Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_AUTO, false); } } @@ -7089,7 +7089,7 @@ Y_UNIT_TEST_SUITE(TImportWithRebootsTests) { ImportFromS3Settings { endpoint: "localhost:%d" scheme: HTTP - index_filling_mode: INDEX_FILLING_MODE_IMPORT + index_population_mode: INDEX_POPULATION_MODE_IMPORT items { source_prefix: "a" destination_path: "/MyRoot/Table" diff --git a/ydb/public/api/protos/ydb_export.proto b/ydb/public/api/protos/ydb_export.proto index cca9c5ca6e6f..6401207b464b 100644 --- a/ydb/public/api/protos/ydb_export.proto +++ b/ydb/public/api/protos/ydb_export.proto @@ -145,11 +145,11 @@ message ExportToS3Settings { // the resulting data will not be encrypted. EncryptionSettings encryption_settings = 15; - // Materialization of index table data. + // Include index data or not. // By default, only index metadata is uploaded and indexes are built during import — it saves space // and reduces export time, but it can potentially increase the import time. - // Indexes can be materialized, then their data will be uploaded during export and downloaded during import. - bool materialize_indexes = 16; + // Index data can be uploaded and downloaded back during import. + bool include_index_data = 16; // Patterns (PCRE) for paths excluded from export operation. // - Patterns are matched against the object path relative to the export's source_path. diff --git a/ydb/public/api/protos/ydb_import.proto b/ydb/public/api/protos/ydb_import.proto index bf3c13219ee6..9a2d607d5b6e 100644 --- a/ydb/public/api/protos/ydb_import.proto +++ b/ydb/public/api/protos/ydb_import.proto @@ -62,15 +62,15 @@ message ImportFromS3Settings { string destination_path = 2; } - enum IndexFillingMode { + enum IndexPopulationMode { // If unspecified, use default - Build - INDEX_FILLING_MODE_UNSPECIFIED = 0; + INDEX_POPULATION_MODE_UNSPECIFIED = 0; // Build index - INDEX_FILLING_MODE_BUILD = 1; + INDEX_POPULATION_MODE_BUILD = 1; // Import materialized index - INDEX_FILLING_MODE_IMPORT = 2; + INDEX_POPULATION_MODE_IMPORT = 2; // Try to import materialized index, build otherwise - INDEX_FILLING_MODE_AUTO = 3; + INDEX_POPULATION_MODE_AUTO = 3; } string endpoint = 1 [(required) = true]; @@ -112,9 +112,9 @@ message ImportFromS3Settings { // the resulting data is considered not encrypted. Ydb.Export.EncryptionSettings encryption_settings = 15; - // Index filling mode. + // Index population mode. // If not specified, indexes will be built. - IndexFillingMode index_filling_mode = 16; + IndexPopulationMode index_population_mode = 16; // Patterns (PCRE) for paths excluded from import operation. // - Patterns are matched against the database object names stored in the backup listing. diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp index c22847284d1b..625f1aa4057f 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp @@ -318,14 +318,14 @@ void TCommandExportToS3::Config(TConfig& config) { { TStringBuilder help; - help << "Materialize index table data or not"; + help << "Include index data or not"; if (config.HelpCommandVerbosiltyLevel >= 2) { help << Endl << " By default, only index metadata is uploaded and indexes are built during import — it" << Endl << " saves space and reduces export time, but it can potentially increase the import time." - << Endl << " Indexes can be materialized, then their data will be uploaded during export and downloaded during import."; + << Endl << " Index data can be uploaded and downloaded back during import."; } - config.Opts->AddLongOption("materialize-indexes", help) - .RequiredArgument("BOOL").StoreResult(&MaterializeIndexes).DefaultValue("false"); + config.Opts->AddLongOption("include-index-data", help) + .RequiredArgument("BOOL").StoreResult(&IncludeIndexData).DefaultValue("false"); } { @@ -421,7 +421,7 @@ int TCommandExportToS3::Run(TConfig& config) { settings.AccessKey(AwsAccessKey); settings.SecretKey(AwsSecretKey); settings.UseVirtualAddressing(UseVirtualAddressing); - settings.MaterializeIndexes(MaterializeIndexes); + settings.IncludeIndexData(IncludeIndexData); for (const auto& item : Items) { settings.AppendItem({item.Source, item.Destination}); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_export.h b/ydb/public/lib/ydb_cli/commands/ydb_service_export.h index c0901622b9dc..b2e699ca1f67 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_export.h +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_export.h @@ -74,7 +74,7 @@ class TCommandExportToS3 : public TYdbOperationCommand, ui32 NumberOfRetries = 10; TString Compression; bool UseVirtualAddressing = true; - bool MaterializeIndexes = false; + bool IncludeIndexData = false; TString CommonSourcePath; TString CommonDestinationPrefix; diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp index e770a1d8216a..b63241f5ccc0 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp @@ -103,10 +103,10 @@ void TCommandImportFromS3::Config(TConfig& config) { { TStringBuilder help; - help << "Index filling mode. Supported values: "; + help << "Index population mode. Supported values: "; bool first = true; - for (auto mode : GetEnumAllValues()) { - if (mode == NImport::EIndexFillingMode::Unknown) { + for (auto mode : GetEnumAllValues()) { + if (mode == NImport::EIndexPopulationMode::Unknown) { continue; } @@ -117,16 +117,16 @@ void TCommandImportFromS3::Config(TConfig& config) { if (config.HelpCommandVerbosiltyLevel >= 2) { help << Endl; switch (mode) { - case NImport::EIndexFillingMode::Build: + case NImport::EIndexPopulationMode::Build: help << " - " << colors.BoldColor() << mode << colors.OldColor() << ": build index"; break; - case NImport::EIndexFillingMode::Import: - help << " - " << colors.BoldColor() << mode << colors.OldColor() << ": import materialized index"; + case NImport::EIndexPopulationMode::Import: + help << " - " << colors.BoldColor() << mode << colors.OldColor() << ": import index data"; break; - case NImport::EIndexFillingMode::Auto: - help << " - " << colors.BoldColor() << mode << colors.OldColor() << ": try to import materialized index, build otherwise"; + case NImport::EIndexPopulationMode::Auto: + help << " - " << colors.BoldColor() << mode << colors.OldColor() << ": try to import index data, build otherwise"; break; - case NImport::EIndexFillingMode::Unknown: + case NImport::EIndexPopulationMode::Unknown: break; } } else { @@ -135,8 +135,8 @@ void TCommandImportFromS3::Config(TConfig& config) { first = false; } - config.Opts->AddLongOption("index-filling-mode", help) - .RequiredArgument("STRING").StoreResult(&IndexFillingMode).DefaultValue(IndexFillingMode); + config.Opts->AddLongOption("index-population-mode", help) + .RequiredArgument("STRING").StoreResult(&IndexPopulationMode).DefaultValue(IndexPopulationMode); } config.Opts->AddLongOption("use-virtual-addressing", TStringBuilder() @@ -336,7 +336,7 @@ TSettings TCommandImportFromS3::MakeSettings() { } settings.NumberOfRetries(NumberOfRetries); - settings.IndexFillingMode(IndexFillingMode); + settings.IndexPopulationMode(IndexPopulationMode); settings.NoACL(NoACL); settings.SkipChecksumValidation(SkipChecksumValidation); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_import.h b/ydb/public/lib/ydb_cli/commands/ydb_service_import.h index d9b6f1226175..951d10d16b71 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_import.h +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_import.h @@ -49,7 +49,7 @@ class TCommandImportFromS3 : public TYdbOperationCommand, TVector IncludePaths; TString Description; ui32 NumberOfRetries = 10; - NImport::EIndexFillingMode IndexFillingMode = NImport::EIndexFillingMode::Build; + NImport::EIndexPopulationMode IndexPopulationMode = NImport::EIndexPopulationMode::Build; bool UseVirtualAddressing = true; bool NoACL = false; bool SkipChecksumValidation = false; diff --git a/ydb/public/lib/ydb_cli/common/print_operation.cpp b/ydb/public/lib/ydb_cli/common/print_operation.cpp index 139e4dc4c3b8..206cb572415b 100644 --- a/ydb/public/lib/ydb_cli/common/print_operation.cpp +++ b/ydb/public/lib/ydb_cli/common/print_operation.cpp @@ -179,7 +179,7 @@ namespace { TStringBuilder freeText; if constexpr (std::is_same_v) { - freeText << "Materialize indexes: " << (settings.MaterializeIndexes_ ? "true" : "false") << Endl; + freeText << "Include index data: " << (settings.IncludeIndexData_ ? "true" : "false") << Endl; freeText << "StorageClass: " << settings.StorageClass_ << Endl; if (settings.Compression_) { freeText << "Compression: " << *settings.Compression_ << Endl; @@ -187,7 +187,7 @@ namespace { } if constexpr (std::is_same_v) { - freeText << "Index filling mode: " << settings.IndexFillingMode_ << Endl; + freeText << "Index population mode: " << settings.IndexPopulationMode_ << Endl; if (settings.NoACL_) { freeText << "NoACL: " << *settings.NoACL_ << Endl; diff --git a/ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/export/export.h b/ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/export/export.h index e0e6742170be..95b6d2d9bcde 100644 --- a/ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/export/export.h +++ b/ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/export/export.h @@ -101,7 +101,7 @@ struct TExportToS3Settings : public TOperationRequestSettings::max(), }; -enum class EIndexFillingMode { +enum class EIndexPopulationMode { Build = 0, Import = 1, Auto = 2, @@ -71,7 +71,7 @@ struct TImportFromS3Settings : public TOperationRequestSettings TExportClient::ExportToS3(const TExportToS3Settings } request.mutable_settings()->set_disable_virtual_addressing(!settings.UseVirtualAddressing_); - request.mutable_settings()->set_materialize_indexes(settings.MaterializeIndexes_); + request.mutable_settings()->set_include_index_data(settings.IncludeIndexData_); if (settings.EncryptionAlgorithm_.empty() != settings.SymmetricKey_.empty()) { throw TContractViolation("Encryption algorithm and symmetric key must be set together"); diff --git a/ydb/public/sdk/cpp/src/client/import/import.cpp b/ydb/public/sdk/cpp/src/client/import/import.cpp index 1c19ae1950ce..68b4e3ec8d7d 100644 --- a/ydb/public/sdk/cpp/src/client/import/import.cpp +++ b/ydb/public/sdk/cpp/src/client/import/import.cpp @@ -77,7 +77,7 @@ TImportFromS3Response::TImportFromS3Response(TStatus&& status, Ydb::Operations:: Metadata_.Settings.Description(metadata.settings().description()); Metadata_.Settings.NumberOfRetries(metadata.settings().number_of_retries()); - Metadata_.Settings.IndexFillingMode(TProtoAccessor::FromProto(metadata.settings().index_filling_mode())); + Metadata_.Settings.IndexPopulationMode(TProtoAccessor::FromProto(metadata.settings().index_population_mode())); // progress Metadata_.Progress = TProtoAccessor::FromProto(metadata.progress()); @@ -316,7 +316,7 @@ TAsyncImportFromS3Response TImportClient::ImportFromS3(const TImportFromS3Settin settingsProto.set_destination_path(settings.DestinationPath_.value()); } - settingsProto.set_index_filling_mode(TProtoAccessor::GetProto(settings.IndexFillingMode_)); + settingsProto.set_index_population_mode(TProtoAccessor::GetProto(settings.IndexPopulationMode_)); for (const std::string& excludeRegexp : settings.ExcludeRegexp_) { settingsProto.add_exclude_regexps(excludeRegexp); diff --git a/ydb/public/sdk/cpp/src/client/proto/accessor.cpp b/ydb/public/sdk/cpp/src/client/proto/accessor.cpp index 09bf8d41abe2..d186566ad297 100644 --- a/ydb/public/sdk/cpp/src/client/proto/accessor.cpp +++ b/ydb/public/sdk/cpp/src/client/proto/accessor.cpp @@ -137,30 +137,30 @@ NImport::EImportProgress TProtoAccessor::FromProto(Ydb::Import::ImportProgress:: } } -Ydb::Import::ImportFromS3Settings::IndexFillingMode TProtoAccessor::GetProto(NImport::EIndexFillingMode value) { +Ydb::Import::ImportFromS3Settings::IndexPopulationMode TProtoAccessor::GetProto(NImport::EIndexPopulationMode value) { switch (value) { - case NImport::EIndexFillingMode::Build: - return Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_BUILD; - case NImport::EIndexFillingMode::Import: - return Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_IMPORT; - case NImport::EIndexFillingMode::Auto: - return Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_AUTO; + case NImport::EIndexPopulationMode::Build: + return Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_BUILD; + case NImport::EIndexPopulationMode::Import: + return Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_IMPORT; + case NImport::EIndexPopulationMode::Auto: + return Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_AUTO; default: - return Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_UNSPECIFIED; + return Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_UNSPECIFIED; } } -NImport::EIndexFillingMode TProtoAccessor::FromProto(Ydb::Import::ImportFromS3Settings::IndexFillingMode value) { +NImport::EIndexPopulationMode TProtoAccessor::FromProto(Ydb::Import::ImportFromS3Settings::IndexPopulationMode value) { switch (value) { - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_UNSPECIFIED: - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_BUILD: - return NImport::EIndexFillingMode::Build; - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_IMPORT: - return NImport::EIndexFillingMode::Import; - case Ydb::Import::ImportFromS3Settings::INDEX_FILLING_MODE_AUTO: - return NImport::EIndexFillingMode::Auto; + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_UNSPECIFIED: + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_BUILD: + return NImport::EIndexPopulationMode::Build; + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_IMPORT: + return NImport::EIndexPopulationMode::Import; + case Ydb::Import::ImportFromS3Settings::INDEX_POPULATION_MODE_AUTO: + return NImport::EIndexPopulationMode::Auto; default: - return NImport::EIndexFillingMode::Unknown; + return NImport::EIndexPopulationMode::Unknown; } } diff --git a/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema b/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema index 1216de876eff..8c916d54b593 100644 --- a/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema +++ b/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema @@ -3271,7 +3271,7 @@ }, { "ColumnId": 21, - "ColumnName": "MaterializeIndexes", + "ColumnName": "IncludeIndexData", "ColumnType": "Bool" } ],