Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions ydb/core/tx/schemeshard/schemeshard_billing_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ TMeteringStats& operator -= (TMeteringStats& value, const TMeteringStats& other)
return value;
}

void TMeteringStatsHelper::TryFixOldFormat(TMeteringStats& value) {
// old format: assign upload to read
if (value.GetReadRows() == 0 && value.GetUploadRows() != 0) {
value.SetReadRows(value.GetUploadRows());
value.SetReadBytes(value.GetUploadBytes());
}
}

TMeteringStats TMeteringStatsHelper::ZeroValue() {
// this method the only purpose is to beautifully print zero stats instead of empty protobuf or with missing fields
TMeteringStats value;
Expand Down
1 change: 0 additions & 1 deletion ydb/core/tx/schemeshard/schemeshard_billing_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ TMeteringStats& operator += (TMeteringStats& value, const TMeteringStats& other)
TMeteringStats& operator -= (TMeteringStats& value, const TMeteringStats& other);

struct TMeteringStatsHelper {
static void TryFixOldFormat(TMeteringStats& value);
static TMeteringStats ZeroValue();
static bool IsZero(TMeteringStats& value);
};
Expand Down
13 changes: 0 additions & 13 deletions ydb/core/tx/schemeshard/schemeshard_info_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -3614,18 +3614,12 @@ struct TIndexBuildInfo: public TSimpleRefCount<TIndexBuildInfo> {
indexInfo->Billed.SetReadRows(row.template GetValueOrDefault<Schema::IndexBuild::ReadRowsBilled>(0));
indexInfo->Billed.SetReadBytes(row.template GetValueOrDefault<Schema::IndexBuild::ReadBytesBilled>(0));
indexInfo->Billed.SetCpuTimeUs(row.template GetValueOrDefault<Schema::IndexBuild::CpuTimeUsBilled>(0));
if (indexInfo->IsOldBuildIndex()) {
TMeteringStatsHelper::TryFixOldFormat(indexInfo->Billed);
}

indexInfo->Processed.SetUploadRows(row.template GetValueOrDefault<Schema::IndexBuild::UploadRowsProcessed>(0));
indexInfo->Processed.SetUploadBytes(row.template GetValueOrDefault<Schema::IndexBuild::UploadBytesProcessed>(0));
indexInfo->Processed.SetReadRows(row.template GetValueOrDefault<Schema::IndexBuild::ReadRowsProcessed>(0));
indexInfo->Processed.SetReadBytes(row.template GetValueOrDefault<Schema::IndexBuild::ReadBytesProcessed>(0));
indexInfo->Processed.SetCpuTimeUs(row.template GetValueOrDefault<Schema::IndexBuild::CpuTimeUsProcessed>(0));
if (indexInfo->IsOldBuildIndex()) {
TMeteringStatsHelper::TryFixOldFormat(indexInfo->Processed);
}

// Restore the operation details: ImplTableDescriptions and SpecializedIndexDescription.
if (row.template HaveValue<Schema::IndexBuild::CreationConfig>()) {
Expand Down Expand Up @@ -3703,20 +3697,13 @@ struct TIndexBuildInfo: public TSimpleRefCount<TIndexBuildInfo> {
shardStatus.Processed.SetReadRows(row.template GetValueOrDefault<Schema::IndexBuildShardStatus::ReadRowsProcessed>(0));
shardStatus.Processed.SetReadBytes(row.template GetValueOrDefault<Schema::IndexBuildShardStatus::ReadBytesProcessed>(0));
shardStatus.Processed.SetCpuTimeUs(row.template GetValueOrDefault<Schema::IndexBuildShardStatus::CpuTimeUsProcessed>(0));
if (IsOldBuildIndex()) {
TMeteringStatsHelper::TryFixOldFormat(shardStatus.Processed);
}
Processed += shardStatus.Processed;
}

bool IsCancellationRequested() const {
return CancelRequested;
}

bool IsOldBuildIndex() const {
return IsBuildSecondaryIndex() || IsBuildColumns();
}

TString InvalidBuildKind() {
return TStringBuilder() << "Invalid index build kind " << static_cast<int>(BuildKind)
<< " for index type " << static_cast<int>(IndexType);
Expand Down
Loading