Skip to content

Commit 19335ff

Browse files
committed
cleanup
1 parent 121c415 commit 19335ff

12 files changed

+52
-37
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#pragma once
2+
3+
namespace NKikimr::NSchemeShard::NBackup {
4+
5+
constexpr static char const* CB_CDC_STREAM_NAME = "continuousBackupImpl";
6+
7+
} // namespace NKikimr::NSchemeShard::NBackup
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
LIBRARY()
2+
3+
SRCS(
4+
constants.h
5+
)
6+
7+
END()

ydb/core/tx/schemeshard/schemeshard__operation_alter_cdc_stream.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ class TAlterCdcStreamAtTable: public TSubOperation {
473473

474474
} // anonymous
475475

476+
namespace NCdc {
477+
476478
void DoAlterStream(
477479
const NKikimrSchemeOp::TAlterCdcStream& op,
478480
const TOperationId& opId,
@@ -503,6 +505,8 @@ void DoAlterStream(
503505
}
504506
}
505507

508+
} // namespace NCdc
509+
506510
ISubOperation::TPtr CreateAlterCdcStreamImpl(TOperationId id, const TTxTransaction& tx) {
507511
return MakeSubOperation<TAlterCdcStream>(id, tx);
508512
}
@@ -579,7 +583,7 @@ TVector<ISubOperation::TPtr> CreateAlterCdcStream(TOperationId opId, const TTxTr
579583

580584
TVector<ISubOperation::TPtr> result;
581585

582-
DoAlterStream(op, opId, workingDirPath, tablePath, result);
586+
NCdc::DoAlterStream(op, opId, workingDirPath, tablePath, result);
583587

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

ydb/core/tx/schemeshard/schemeshard__operation_alter_cdc_stream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <ydb/core/engine/mkql_proto.h>
88
#include <ydb/core/scheme/scheme_types_proto.h>
99

10-
namespace NKikimr::NSchemeShard {
10+
namespace NKikimr::NSchemeShard::NCdc {
1111

1212
void DoAlterStream(
1313
const NKikimrSchemeOp::TAlterCdcStream& op,
@@ -16,4 +16,4 @@ void DoAlterStream(
1616
const TPath& tablePath,
1717
TVector<ISubOperation::TPtr>& result);
1818

19-
} // namespace NKikimr::NSchemesShard
19+
} // namespace NKikimr::NSchemesShard::NCdc

ydb/core/tx/schemeshard/schemeshard__operation_alter_continuous_backup.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44

55
#include "schemeshard__operation_alter_cdc_stream.h"
66

7+
#include <ydb/core/tx/schemeshard/backup/constants.h>
8+
79
#include <ydb/core/engine/mkql_proto.h>
810
#include <ydb/core/scheme/scheme_types_proto.h>
911

10-
namespace {
11-
12-
constexpr static char const* cbCdcStreamName = "continuousBackupImpl";
13-
14-
}
15-
1612
namespace NKikimr::NSchemeShard {
1713

1814
TVector<ISubOperation::TPtr> CreateAlterContinuousBackup(TOperationId opId, const TTxTransaction& tx, TOperationContext& context) {
@@ -25,12 +21,12 @@ TVector<ISubOperation::TPtr> CreateAlterContinuousBackup(TOperationId opId, cons
2521

2622
NKikimrSchemeOp::TAlterCdcStream alterCdcStreamOp;
2723
alterCdcStreamOp.SetTableName(tableName);
28-
alterCdcStreamOp.SetStreamName(cbCdcStreamName);
24+
alterCdcStreamOp.SetStreamName(NBackup::CB_CDC_STREAM_NAME);
2925
alterCdcStreamOp.MutableDisable();
3026

3127
TVector<ISubOperation::TPtr> result;
3228

33-
DoAlterStream(alterCdcStreamOp, opId, workingDirPath, tablePath, result);
29+
NCdc::DoAlterStream(alterCdcStreamOp, opId, workingDirPath, tablePath, result);
3430

3531
return result;
3632
}

ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,8 @@ ISubOperation::TPtr RejectOnTablePathChecks(const TOperationId& opId, const TPat
698698

699699
} // anonymous
700700

701+
namespace NCdc {
702+
701703
void DoCreateStream(const NKikimrSchemeOp::TCreateCdcStream& op, const TOperationId& opId, const TPath& workingDirPath, const TPath& tablePath,
702704
const bool acceptExisted, const bool initialScan, TVector<ISubOperation::TPtr>& result)
703705
{
@@ -781,6 +783,8 @@ void DoCreatePqPart(const TOperationId& opId, const TPath& streamPath, const TSt
781783
result.push_back(CreateNewPQ(NextPartId(opId, result), outTx));
782784
}
783785

786+
} // namespace NCdc
787+
784788
ISubOperation::TPtr CreateNewCdcStreamImpl(TOperationId id, const TTxTransaction& tx) {
785789
return MakeSubOperation<TNewCdcStream>(id, tx);
786790
}
@@ -899,8 +903,8 @@ TVector<ISubOperation::TPtr> CreateNewCdcStream(TOperationId opId, const TTxTran
899903
DoCreateLock(opId, workingDirPath, tablePath, result);
900904
}
901905

902-
DoCreateStream(op, opId, workingDirPath, tablePath, acceptExisted, initialScan, result);
903-
DoCreatePqPart(opId, streamPath, streamName, table, op, boundaries, acceptExisted, result);
906+
NCdc::DoCreateStream(op, opId, workingDirPath, tablePath, acceptExisted, initialScan, result);
907+
NCdc::DoCreatePqPart(opId, streamPath, streamName, table, op, boundaries, acceptExisted, result);
904908

905909
return result;
906910
}

ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <ydb/core/engine/mkql_proto.h>
88
#include <ydb/core/scheme/scheme_types_proto.h>
99

10-
namespace NKikimr::NSchemeShard {
10+
namespace NKikimr::NSchemeShard::NCdc {
1111

1212
void DoCreateStream(
1313
const NKikimrSchemeOp::TCreateCdcStream& op,
@@ -28,4 +28,4 @@ void DoCreatePqPart(
2828
const bool acceptExisted,
2929
TVector<ISubOperation::TPtr>& result);
3030

31-
} // namespace NKikimr::NSchemesShard
31+
} // namespace NKikimr::NSchemesShard::NCdc

ydb/core/tx/schemeshard/schemeshard__operation_create_continuous_backup.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44

55
#include "schemeshard__operation_create_cdc_stream.h"
66

7+
#include <ydb/core/tx/schemeshard/backup/constants.h>
8+
79
#include <ydb/core/engine/mkql_proto.h>
810
#include <ydb/core/scheme/scheme_types_proto.h>
911

10-
namespace {
11-
12-
constexpr static char const* cbCdcStreamName = "continuousBackupImpl";
13-
14-
}
15-
1612
namespace NKikimr::NSchemeShard {
1713

1814
TVector<ISubOperation::TPtr> CreateNewContinuousBackup(TOperationId opId, const TTxTransaction& tx, TOperationContext& context) {
@@ -27,13 +23,13 @@ TVector<ISubOperation::TPtr> CreateNewContinuousBackup(TOperationId opId, const
2723
NKikimrSchemeOp::TCreateCdcStream createCdcStreamOp;
2824
createCdcStreamOp.SetTableName(tableName);
2925
auto& streamDescription = *createCdcStreamOp.MutableStreamDescription();
30-
streamDescription.SetName(cbCdcStreamName);
26+
streamDescription.SetName(NBackup::CB_CDC_STREAM_NAME);
3127
streamDescription.SetMode(NKikimrSchemeOp::ECdcStreamModeUpdate);
3228
streamDescription.SetFormat(NKikimrSchemeOp::ECdcStreamFormatProto);
3329

3430
auto table = context.SS->Tables.at(tablePath.Base()->PathId);
3531

36-
const auto streamPath = tablePath.Child(cbCdcStreamName);
32+
const auto streamPath = tablePath.Child(NBackup::CB_CDC_STREAM_NAME);
3733

3834
TVector<TString> boundaries;
3935
const auto& partitions = table->GetPartitions();
@@ -48,8 +44,8 @@ TVector<ISubOperation::TPtr> CreateNewContinuousBackup(TOperationId opId, const
4844

4945
TVector<ISubOperation::TPtr> result;
5046

51-
DoCreateStream(createCdcStreamOp, opId, workingDirPath, tablePath, acceptExisted, false, result);
52-
DoCreatePqPart(opId, streamPath, cbCdcStreamName, table, createCdcStreamOp, boundaries, acceptExisted, result);
47+
NCdc::DoCreateStream(createCdcStreamOp, opId, workingDirPath, tablePath, acceptExisted, false, result);
48+
NCdc::DoCreatePqPart(opId, streamPath, NBackup::CB_CDC_STREAM_NAME, table, createCdcStreamOp, boundaries, acceptExisted, result);
5349

5450
return result;
5551
}

ydb/core/tx/schemeshard/schemeshard__operation_drop_cdc_stream.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ class TDropCdcStreamAtTable: public TSubOperation {
435435

436436
} // anonymous
437437

438+
namespace NCdc {
439+
438440
void DoDropStream(
439441
const NKikimrSchemeOp::TDropCdcStream& op,
440442
const TOperationId& opId,
@@ -495,6 +497,8 @@ void DoDropStream(
495497
}
496498
}
497499

500+
} // namespace NCdc
501+
498502
ISubOperation::TPtr CreateDropCdcStreamImpl(TOperationId id, const TTxTransaction& tx) {
499503
return MakeSubOperation<TDropCdcStream>(id, tx);
500504
}
@@ -579,7 +583,7 @@ TVector<ISubOperation::TPtr> CreateDropCdcStream(TOperationId opId, const TTxTra
579583

580584
TVector<ISubOperation::TPtr> result;
581585

582-
DoDropStream(op, opId, workingDirPath, tablePath, streamPath, lockTxId, context, result);
586+
NCdc::DoDropStream(op, opId, workingDirPath, tablePath, streamPath, lockTxId, context, result);
583587

584588
return result;
585589
}

ydb/core/tx/schemeshard/schemeshard__operation_drop_cdc_stream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <ydb/core/engine/mkql_proto.h>
88
#include <ydb/core/scheme/scheme_types_proto.h>
99

10-
namespace NKikimr::NSchemeShard {
10+
namespace NKikimr::NSchemeShard::NCdc {
1111

1212
void DoDropStream(
1313
const NKikimrSchemeOp::TDropCdcStream& op,
@@ -19,4 +19,4 @@ void DoDropStream(
1919
TOperationContext& context,
2020
TVector<ISubOperation::TPtr>& result);
2121

22-
} // namespace NKikimr::NSchemesShard
22+
} // namespace NKikimr::NSchemesShard::NCdc

0 commit comments

Comments
 (0)