@@ -92,7 +92,7 @@ class TTxStoreTableStats: public TTxStoreStats<TEvDataShard::TEvPeriodicTableSta
92
92
bool PersistSingleStats (const TPathId& pathId, const TStatsQueue<TEvDataShard::TEvPeriodicTableStats>::TItem& item, TTransactionContext& txc, const TActorContext& ctx) override ;
93
93
void ScheduleNextBatch (const TActorContext& ctx) override ;
94
94
95
- template <typename T>
95
+ template <typename T>
96
96
TPartitionStats PrepareStats (const TActorContext& ctx, const T& rec) const ;
97
97
};
98
98
@@ -124,10 +124,8 @@ THolder<TProposeRequest> MergeRequest(
124
124
return std::move (request);
125
125
}
126
126
127
- template <typename T>
128
- TPartitionStats TTxStoreTableStats::PrepareStats (
129
- const TActorContext& ctx, const T& rec) const {
130
-
127
+ template <typename T>
128
+ TPartitionStats TTxStoreTableStats::PrepareStats (const TActorContext& ctx, const T& rec) const {
131
129
const auto & tableStats = rec.GetTableStats ();
132
130
const auto & tabletMetrics = rec.GetTabletMetrics ();
133
131
@@ -183,7 +181,8 @@ TPartitionStats TTxStoreTableStats::PrepareStats(
183
181
}
184
182
185
183
bool TTxStoreTableStats::PersistSingleStats (const TPathId& pathId,
186
- const TStatsQueueItem<TEvDataShard::TEvPeriodicTableStats>& item, NTabletFlatExecutor::TTransactionContext& txc, const TActorContext& ctx) {
184
+ const TStatsQueueItem<TEvDataShard::TEvPeriodicTableStats>& item,
185
+ NTabletFlatExecutor::TTransactionContext& txc, const TActorContext& ctx) {
187
186
const auto & rec = item.Ev ->Get ()->Record ;
188
187
const auto datashardId = TTabletId (rec.GetDatashardId ());
189
188
@@ -208,19 +207,17 @@ bool TTxStoreTableStats::PersistSingleStats(const TPathId& pathId,
208
207
TShardIdx shardIdx = Self->TabletIdToShardIdx [datashardId];
209
208
210
209
LOG_DEBUG_S (ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
211
- " TTxStoreTableStats.PersistSingleStats: main stats from"
212
- << " datashardId(TabletID)=" << datashardId
213
- << " maps to shardIdx: " << shardIdx
214
- << " , pathId: " << pathId
215
- << " , pathId map=" << Self->PathsById [pathId]->Name
216
- << " , is column=" << isColumnTable
217
- << " , is olap=" << isOlapStore);
210
+ " TTxStoreTableStats.PersistSingleStats: main stats from"
211
+ << " datashardId(TabletID)=" << datashardId << " maps to shardIdx: " << shardIdx
212
+ << " , pathId: " << pathId << " , pathId map=" << Self->PathsById [pathId]->Name
213
+ << " , is column=" << isColumnTable << " , is olap=" << isOlapStore);
218
214
219
215
const TPartitionStats newStats = PrepareStats (ctx, rec);
220
216
221
217
LOG_INFO_S (ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
222
- " Add stats from shard with datashardId(TabletID)=" << datashardId << " , pathId " << pathId.LocalPathId
223
- << " : RowCount " << newStats.RowCount << " , DataSize " << newStats.DataSize );
218
+ " Add stats from shard with datashardId(TabletID)=" << datashardId << " , pathId " << pathId.LocalPathId
219
+ << " : RowCount " << newStats.RowCount << " , DataSize "
220
+ << newStats.DataSize );
224
221
225
222
NIceDb::TNiceDb db (txc.DB );
226
223
@@ -261,29 +258,28 @@ bool TTxStoreTableStats::PersistSingleStats(const TPathId& pathId,
261
258
updateSubdomainInfo = true ;
262
259
263
260
const auto tables = rec.GetTables ();
264
- LOG_DEBUG_S (ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
265
- " OLAP store contains " << tables.size () << " tables." );
261
+ LOG_DEBUG_S (ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, " OLAP store contains " << tables.size () << " tables." );
266
262
267
- for (const auto & table : tables) {
263
+ for (const auto & table : tables) {
268
264
const TPartitionStats newTableStats = PrepareStats (ctx, table);
269
265
270
266
const TPathId tablePathId = TPathId (TOwnerId (pathId.OwnerId ), TLocalPathId (table.GetTableLocalId ()));
271
267
272
268
if (Self->ColumnTables .contains (tablePathId)) {
273
269
LOG_DEBUG_S (ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
274
- " add stats for exists table with pathId=" << tablePathId);
270
+ " add stats for exists table with pathId=" << tablePathId);
275
271
276
272
auto columnTable = Self->ColumnTables .TakeVerified (tablePathId);
277
273
columnTable->UpdateTableStats (tablePathId, newTableStats);
278
274
} else {
279
275
LOG_WARN_S (ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
280
- " failed add stats for table with pathId=" << tablePathId);
276
+ " failed add stats for table with pathId=" << tablePathId);
281
277
}
282
278
}
283
279
284
280
} else if (isColumnTable) {
285
- LOG_INFO_S (ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, " PersistSingleStats: ColumnTable rec.GetColumnTables() size= "
286
- << rec.GetTables ().size ());
281
+ LOG_INFO_S (ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
282
+ " PersistSingleStats: ColumnTable rec.GetColumnTables() size= " << rec.GetTables ().size ());
287
283
288
284
auto columnTable = Self->ColumnTables .TakeVerified (pathId);
289
285
oldAggrStats = columnTable->GetStats ().Aggregated ;
0 commit comments