Skip to content

Commit 27a59e5

Browse files
committed
rearrange for lesser diff
1 parent 62be14c commit 27a59e5

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

ydb/core/tx/schemeshard/schemeshard__operation_alter_cdc_stream.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
namespace NKikimr::NSchemeShard {
1212

13+
namespace NCdc {
14+
1315
namespace {
1416

1517
class TPropose: public TSubOperationState {
@@ -473,8 +475,6 @@ class TAlterCdcStreamAtTable: public TSubOperation {
473475

474476
} // anonymous
475477

476-
namespace NCdc {
477-
478478
std::variant<TStreamPaths, ISubOperation::TPtr> DoAlterStreamPathChecks(
479479
const TOperationId& opId,
480480
const TPath& workingDirPath,
@@ -552,6 +552,8 @@ void DoAlterStream(
552552

553553
} // namespace NCdc
554554

555+
using namespace NCdc;
556+
555557
ISubOperation::TPtr CreateAlterCdcStreamImpl(TOperationId id, const TTxTransaction& tx) {
556558
return MakeSubOperation<TAlterCdcStream>(id, tx);
557559
}
@@ -581,12 +583,12 @@ TVector<ISubOperation::TPtr> CreateAlterCdcStream(TOperationId opId, const TTxTr
581583

582584
const auto workingDirPath = TPath::Resolve(tx.GetWorkingDir(), context.SS);
583585

584-
const auto checksResult = NCdc::DoAlterStreamPathChecks(opId, workingDirPath, tableName, streamName);
586+
const auto checksResult = DoAlterStreamPathChecks(opId, workingDirPath, tableName, streamName);
585587
if (std::holds_alternative<ISubOperation::TPtr>(checksResult)) {
586588
return {std::get<ISubOperation::TPtr>(checksResult)};
587589
}
588590

589-
const auto [tablePath, streamPath] = std::get<NCdc::TStreamPaths>(checksResult);
591+
const auto [tablePath, streamPath] = std::get<TStreamPaths>(checksResult);
590592

591593
TString errStr;
592594
if (!context.SS->CheckApplyIf(tx, errStr)) {
@@ -599,7 +601,7 @@ TVector<ISubOperation::TPtr> CreateAlterCdcStream(TOperationId opId, const TTxTr
599601

600602
TVector<ISubOperation::TPtr> result;
601603

602-
NCdc::DoAlterStream(op, opId, workingDirPath, tablePath, result);
604+
DoAlterStream(op, opId, workingDirPath, tablePath, result);
603605

604606
if (op.HasGetReady()) {
605607
auto outTx = TransactionTemplate(workingDirPath.PathString(), NKikimrSchemeOp::EOperationType::ESchemeOpDropLock);

ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,12 +842,12 @@ TVector<ISubOperation::TPtr> CreateNewCdcStream(TOperationId opId, const TTxTran
842842

843843
const auto workingDirPath = TPath::Resolve(tx.GetWorkingDir(), context.SS);
844844

845-
const auto checksResult = NCdc::DoNewStreamPathChecks(opId, workingDirPath, tableName, streamName, acceptExisted);
845+
const auto checksResult = DoNewStreamPathChecks(opId, workingDirPath, tableName, streamName, acceptExisted);
846846
if (std::holds_alternative<ISubOperation::TPtr>(checksResult)) {
847847
return {std::get<ISubOperation::TPtr>(checksResult)};
848848
}
849849

850-
const auto [tablePath, streamPath] = std::get<NCdc::TStreamPaths>(checksResult);
850+
const auto [tablePath, streamPath] = std::get<TStreamPaths>(checksResult);
851851

852852
switch (streamDesc.GetMode()) {
853853
case NKikimrSchemeOp::ECdcStreamModeKeysOnly:
@@ -926,8 +926,8 @@ TVector<ISubOperation::TPtr> CreateNewCdcStream(TOperationId opId, const TTxTran
926926
DoCreateLock(opId, workingDirPath, tablePath, result);
927927
}
928928

929-
NCdc::DoCreateStream(op, opId, workingDirPath, tablePath, acceptExisted, initialScan, result);
930-
NCdc::DoCreatePqPart(opId, streamPath, streamName, table, op, boundaries, acceptExisted, result);
929+
DoCreateStream(op, opId, workingDirPath, tablePath, acceptExisted, initialScan, result);
930+
DoCreatePqPart(opId, streamPath, streamName, table, op, boundaries, acceptExisted, result);
931931

932932
return result;
933933
}

ydb/core/tx/schemeshard/schemeshard__operation_drop_cdc_stream.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
namespace NKikimr::NSchemeShard {
1212

13+
namespace NCdc {
14+
1315
namespace {
1416

1517
class TPropose: public TSubOperationState {
@@ -435,8 +437,6 @@ class TDropCdcStreamAtTable: public TSubOperation {
435437

436438
} // anonymous
437439

438-
namespace NCdc {
439-
440440
std::variant<TStreamPaths, ISubOperation::TPtr> DoDropStreamPathChecks(
441441
const TOperationId& opId,
442442
const TPath& workingDirPath,
@@ -560,6 +560,8 @@ void DoDropStream(
560560

561561
} // namespace NCdc
562562

563+
using namespace NCdc;
564+
563565
ISubOperation::TPtr CreateDropCdcStreamImpl(TOperationId id, const TTxTransaction& tx) {
564566
return MakeSubOperation<TDropCdcStream>(id, tx);
565567
}
@@ -589,12 +591,12 @@ TVector<ISubOperation::TPtr> CreateDropCdcStream(TOperationId opId, const TTxTra
589591

590592
const auto workingDirPath = TPath::Resolve(tx.GetWorkingDir(), context.SS);
591593

592-
const auto checksResult = NCdc::DoDropStreamPathChecks(opId, workingDirPath, tableName, streamName);
594+
const auto checksResult = DoDropStreamPathChecks(opId, workingDirPath, tableName, streamName);
593595
if (std::holds_alternative<ISubOperation::TPtr>(checksResult)) {
594596
return {std::get<ISubOperation::TPtr>(checksResult)};
595597
}
596598

597-
const auto [tablePath, streamPath] = std::get<NCdc::TStreamPaths>(checksResult);
599+
const auto [tablePath, streamPath] = std::get<TStreamPaths>(checksResult);
598600

599601
TString errStr;
600602
if (!context.SS->CheckApplyIf(tx, errStr)) {
@@ -607,13 +609,13 @@ TVector<ISubOperation::TPtr> CreateDropCdcStream(TOperationId opId, const TTxTra
607609
const auto lockTxId = stream->State == TCdcStreamInfo::EState::ECdcStreamStateScan
608610
? streamPath.Base()->CreateTxId
609611
: InvalidTxId;
610-
if (const auto reject = NCdc::DoDropStreamChecks(opId, tablePath, lockTxId, context); reject) {
612+
if (const auto reject = DoDropStreamChecks(opId, tablePath, lockTxId, context); reject) {
611613
return {reject};
612614
}
613615

614616
TVector<ISubOperation::TPtr> result;
615617

616-
NCdc::DoDropStream(op, opId, workingDirPath, tablePath, streamPath, lockTxId, context, result);
618+
DoDropStream(op, opId, workingDirPath, tablePath, streamPath, lockTxId, context, result);
617619

618620
return result;
619621
}

0 commit comments

Comments
 (0)