@@ -54,11 +54,7 @@ bool TTablesManager::InitFromDB(NIceDb::TNiceDb& db) {
54
54
}
55
55
56
56
while (!rowset.EndOfSet ()) {
57
- TTableInfo table;
58
- if (!table.InitFromDB (rowset)) {
59
- timer.AddLoadingFail ();
60
- return false ;
61
- }
57
+ TTableInfo table = table.InitFromDB (rowset);
62
58
if (table.IsDropped ()) {
63
59
AFL_VERIFY (PathsToDrop[table.GetDropVersionVerified ()].emplace (table.GetPathId ()).second );
64
60
}
@@ -114,21 +110,21 @@ bool TTablesManager::InitFromDB(NIceDb::TNiceDb& db) {
114
110
115
111
while (!rowset.EndOfSet ()) {
116
112
const auto pathId = TInternalPathId::FromRawValue (rowset.GetValue <Schema::TableVersionInfo::PathId>());
117
- Y_ABORT_UNLESS (Tables.contains (pathId));
113
+ const auto table = Tables.FindPtr (pathId);
114
+ AFL_VERIFY (table);
118
115
NOlap::TSnapshot version (
119
116
rowset.GetValue <Schema::TableVersionInfo::SinceStep>(), rowset.GetValue <Schema::TableVersionInfo::SinceTxId>());
120
117
121
- auto & table = Tables[pathId];
122
118
NKikimrTxColumnShard::TTableVersionInfo versionInfo;
123
- Y_ABORT_UNLESS (versionInfo.ParseFromString (rowset.GetValue <Schema::TableVersionInfo::InfoProto>()));
119
+ AFL_VERIFY (versionInfo.ParseFromString (rowset.GetValue <Schema::TableVersionInfo::InfoProto>()));
124
120
AFL_DEBUG (NKikimrServices::TX_COLUMNSHARD)(" event" , " load_table_version" )(" path_id" , pathId)(" snapshot" , version);
125
121
AFL_VERIFY (preset);
126
122
AFL_VERIFY (preset->Id == versionInfo.GetSchemaPresetId ())(" preset" , preset->Id )(" table" , versionInfo.GetSchemaPresetId ());
127
123
128
124
if (versionInfo.HasTtlSettings ()) {
129
125
Ttl.AddVersionFromProto (pathId, version, versionInfo.GetTtlSettings ());
130
126
}
131
- table. AddVersion (version);
127
+ table-> AddVersion (version);
132
128
if (!rowset.Next ()) {
133
129
timer.AddLoadingFail ();
134
130
return false ;
@@ -223,9 +219,9 @@ ui64 TTablesManager::GetMemoryUsage() const {
223
219
}
224
220
225
221
void TTablesManager::DropTable (const TInternalPathId pathId, const NOlap::TSnapshot& version, NIceDb::TNiceDb& db) {
226
- AFL_VERIFY ( Tables.contains (pathId) );
227
- auto & table = Tables[pathId] ;
228
- table. SetDropVersion (version);
222
+ auto * table = Tables.FindPtr (pathId);
223
+ AFL_VERIFY ( table) ;
224
+ table-> SetDropVersion (version);
229
225
AFL_VERIFY (PathsToDrop[version].emplace (pathId).second );
230
226
Schema::SaveTableDropVersion (db, pathId, version.GetPlanStep (), version.GetTxId ());
231
227
}
0 commit comments