summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilnaz <[email protected]>2023-01-18 18:44:26 +0300
committerilnaz <[email protected]>2023-01-18 18:44:26 +0300
commit6de28661c7d56de0dc4169c2a2dc149bd3c66595 (patch)
tree01155273b094685549f64166d70b0e05a3eebaf3
parentd94ca6c42095c6280499d1160dd7b6df9a08fd93 (diff)
(refactoring) Aux ctor for TSnapshotKey
-rw-r--r--ydb/core/tx/datashard/alter_cdc_stream_unit.cpp2
-rw-r--r--ydb/core/tx/datashard/check_scheme_tx_unit.cpp2
-rw-r--r--ydb/core/tx/datashard/create_cdc_stream_unit.cpp2
-rw-r--r--ydb/core/tx/datashard/datashard__build_index.cpp2
-rw-r--r--ydb/core/tx/datashard/drop_cdc_stream_unit.cpp2
-rw-r--r--ydb/core/tx/datashard/finalize_build_index_unit.cpp2
-rw-r--r--ydb/core/tx/datashard/initiate_build_index_unit.cpp2
-rw-r--r--ydb/core/tx/datashard/snapshot_key.h4
8 files changed, 11 insertions, 7 deletions
diff --git a/ydb/core/tx/datashard/alter_cdc_stream_unit.cpp b/ydb/core/tx/datashard/alter_cdc_stream_unit.cpp
index de503b1b54a..595405245e2 100644
--- a/ydb/core/tx/datashard/alter_cdc_stream_unit.cpp
+++ b/ydb/core/tx/datashard/alter_cdc_stream_unit.cpp
@@ -48,7 +48,7 @@ public:
const auto& snapshot = params.GetDropSnapshot();
Y_VERIFY(snapshot.GetStep() != 0);
- const TSnapshotKey key(pathId.OwnerId, pathId.LocalPathId, snapshot.GetStep(), snapshot.GetTxId());
+ const TSnapshotKey key(pathId, snapshot.GetStep(), snapshot.GetTxId());
DataShard.GetSnapshotManager().RemoveSnapshot(txc.DB, key);
} else {
Y_VERIFY_DEBUG(false, "Absent snapshot");
diff --git a/ydb/core/tx/datashard/check_scheme_tx_unit.cpp b/ydb/core/tx/datashard/check_scheme_tx_unit.cpp
index 2182381c0ba..8305b5970d1 100644
--- a/ydb/core/tx/datashard/check_scheme_tx_unit.cpp
+++ b/ydb/core/tx/datashard/check_scheme_tx_unit.cpp
@@ -634,7 +634,7 @@ bool TCheckSchemeTxUnit::CheckFinalizeBuildIndex(TActiveTransaction *activeTx) {
}
const auto pathId = GetPathId(finalize);
- const auto snapshotKey = TSnapshotKey(pathId.OwnerId, pathId.LocalPathId, finalize.GetSnapshotStep(), finalize.GetSnapshotTxId());
+ const auto snapshotKey = TSnapshotKey(pathId, finalize.GetSnapshotStep(), finalize.GetSnapshotTxId());
if (DataShard.GetSnapshotManager().FindAvailable(snapshotKey) == nullptr) {
LOG_DEBUG_S(TActivationContext::AsActorContext(), NKikimrServices::TX_DATASHARD,
diff --git a/ydb/core/tx/datashard/create_cdc_stream_unit.cpp b/ydb/core/tx/datashard/create_cdc_stream_unit.cpp
index b27e674334f..905085916e4 100644
--- a/ydb/core/tx/datashard/create_cdc_stream_unit.cpp
+++ b/ydb/core/tx/datashard/create_cdc_stream_unit.cpp
@@ -52,7 +52,7 @@ public:
Y_VERIFY(tx->GetStep() != 0);
DataShard.GetSnapshotManager().AddSnapshot(txc.DB,
- TSnapshotKey(pathId.OwnerId, pathId.LocalPathId, tx->GetStep(), tx->GetTxId()),
+ TSnapshotKey(pathId, tx->GetStep(), tx->GetTxId()),
params.GetSnapshotName(), TSnapshot::FlagScheme, TDuration::Zero());
}
diff --git a/ydb/core/tx/datashard/datashard__build_index.cpp b/ydb/core/tx/datashard/datashard__build_index.cpp
index b2fc2cf6118..7ea6ebfadea 100644
--- a/ydb/core/tx/datashard/datashard__build_index.cpp
+++ b/ydb/core/tx/datashard/datashard__build_index.cpp
@@ -626,7 +626,7 @@ void TDataShard::Handle(TEvDataShard::TEvBuildIndexCreateRequest::TPtr& ev, cons
return;
}
- TSnapshotKey snapshotKey = TSnapshotKey(tableId.PathId.OwnerId, tableId.PathId.LocalPathId, record.GetSnapshotStep(), record.GetSnapshotTxId());
+ const TSnapshotKey snapshotKey(tableId.PathId, record.GetSnapshotStep(), record.GetSnapshotTxId());
const TSnapshot* snapshot = SnapshotManager.FindAvailable(snapshotKey);
if (!snapshot) {
badRequest(TStringBuilder()
diff --git a/ydb/core/tx/datashard/drop_cdc_stream_unit.cpp b/ydb/core/tx/datashard/drop_cdc_stream_unit.cpp
index 2788930a5fe..e7a2c14f510 100644
--- a/ydb/core/tx/datashard/drop_cdc_stream_unit.cpp
+++ b/ydb/core/tx/datashard/drop_cdc_stream_unit.cpp
@@ -50,7 +50,7 @@ public:
const auto& snapshot = params.GetDropSnapshot();
Y_VERIFY(snapshot.GetStep() != 0);
- const TSnapshotKey key(pathId.OwnerId, pathId.LocalPathId, snapshot.GetStep(), snapshot.GetTxId());
+ const TSnapshotKey key(pathId, snapshot.GetStep(), snapshot.GetTxId());
DataShard.GetSnapshotManager().RemoveSnapshot(txc.DB, key);
}
diff --git a/ydb/core/tx/datashard/finalize_build_index_unit.cpp b/ydb/core/tx/datashard/finalize_build_index_unit.cpp
index aa48ad5bc70..6815b4a2667 100644
--- a/ydb/core/tx/datashard/finalize_build_index_unit.cpp
+++ b/ydb/core/tx/datashard/finalize_build_index_unit.cpp
@@ -71,7 +71,7 @@ public:
DataShard.GetBuildIndexManager().Drop(params.GetBuildIndexId());
}
- const TSnapshotKey key(pathId.OwnerId, pathId.LocalPathId, step, txId);
+ const TSnapshotKey key(pathId, step, txId);
DataShard.GetSnapshotManager().RemoveSnapshot(txc.DB, key);
BuildResult(op, NKikimrTxDataShard::TEvProposeTransactionResult::COMPLETE);
diff --git a/ydb/core/tx/datashard/initiate_build_index_unit.cpp b/ydb/core/tx/datashard/initiate_build_index_unit.cpp
index 06312591cc6..d0518cb70f8 100644
--- a/ydb/core/tx/datashard/initiate_build_index_unit.cpp
+++ b/ydb/core/tx/datashard/initiate_build_index_unit.cpp
@@ -63,7 +63,7 @@ public:
ui64 txId = tx->GetTxId();
Y_VERIFY(step != 0);
- const TSnapshotKey key(pathId.OwnerId, pathId.LocalPathId, step, txId);
+ const TSnapshotKey key(pathId, step, txId);
const ui64 flags = TSnapshot::FlagScheme;
DataShard.GetSnapshotManager().AddSnapshot(
diff --git a/ydb/core/tx/datashard/snapshot_key.h b/ydb/core/tx/datashard/snapshot_key.h
index 63c1ea44d77..3efaf46fd51 100644
--- a/ydb/core/tx/datashard/snapshot_key.h
+++ b/ydb/core/tx/datashard/snapshot_key.h
@@ -70,6 +70,10 @@ struct TDataSnapshotKey
, TxId(txId)
{ }
+ TDataSnapshotKey(const TPathId& pathId, ui64 step, ui64 txId)
+ : TDataSnapshotKey(pathId.OwnerId, pathId.LocalPathId, step, txId)
+ { }
+
auto ToTuple() const {
return std::tuple_cat(TSnapshotTableKey::ToTuple(), std::make_tuple(Step, TxId));
}