summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Petrikhin <[email protected]>2022-06-24 15:58:56 +0300
committerAleksandr Petrikhin <[email protected]>2022-06-24 15:58:56 +0300
commitc9301d00fe2cd9d315f2298e1dc5101c04d252f0 (patch)
tree8bcab697d4263c0dedd5d612a9f6d578b9d2fe08
parent87d89a758766acfdcb00000c1db4af6cd89d95c1 (diff)
[LOGBROKER-7553] remove mention of from ydb cli
ref:64ab895dfd55759eb98c96a5bfb076a5a44399f8
-rw-r--r--ydb/apps/ydb/main.cpp2
-rw-r--r--ydb/public/lib/ydb_cli/commands/CMakeLists.txt2
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp4
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_service_topic.cpp (renamed from ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp)106
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_service_topic.h (renamed from ydb/public/lib/ydb_cli/commands/ydb_service_stream.h)28
-rw-r--r--ydb/public/lib/ydb_cli/common/command.cpp4
-rw-r--r--ydb/public/lib/ydb_cli/common/command.h34
7 files changed, 90 insertions, 90 deletions
diff --git a/ydb/apps/ydb/main.cpp b/ydb/apps/ydb/main.cpp
index 61d7c859f85..85019e990c0 100644
--- a/ydb/apps/ydb/main.cpp
+++ b/ydb/apps/ydb/main.cpp
@@ -1,5 +1,5 @@
#include "commands/ydb_root.h"
-#include <ydb/public/lib/ydb_cli/commands/ydb_service_stream.h>
+#include <ydb/public/lib/ydb_cli/commands/ydb_service_topic.h>
TVector<NYdb::NPersQueue::ECodec> NYdb::NConsoleClient::InitAllowedCodecs() {
return TVector<NYdb::NPersQueue::ECodec>{
diff --git a/ydb/public/lib/ydb_cli/commands/CMakeLists.txt b/ydb/public/lib/ydb_cli/commands/CMakeLists.txt
index 08498259ef0..88318a78251 100644
--- a/ydb/public/lib/ydb_cli/commands/CMakeLists.txt
+++ b/ydb/public/lib/ydb_cli/commands/CMakeLists.txt
@@ -43,7 +43,7 @@ target_sources(clicommands PRIVATE
${CMAKE_SOURCE_DIR}/ydb/public/lib/ydb_cli/commands/ydb_service_operation.cpp
${CMAKE_SOURCE_DIR}/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
${CMAKE_SOURCE_DIR}/ydb/public/lib/ydb_cli/commands/ydb_service_scripting.cpp
- ${CMAKE_SOURCE_DIR}/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp
+ ${CMAKE_SOURCE_DIR}/ydb/public/lib/ydb_cli/commands/ydb_service_topic.cpp
${CMAKE_SOURCE_DIR}/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp
${CMAKE_SOURCE_DIR}/ydb/public/lib/ydb_cli/commands/ydb_tools.cpp
${CMAKE_SOURCE_DIR}/ydb/public/lib/ydb_cli/commands/ydb_workload.cpp
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp b/ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp
index 181b01aa5e2..2b37da02946 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_root_common.cpp
@@ -7,7 +7,7 @@
#include "ydb_service_scheme.h"
#include "ydb_service_scripting.h"
#include "ydb_service_table.h"
-#include "ydb_service_stream.h"
+#include "ydb_service_topic.h"
#include "ydb_tools.h"
#include "ydb_yql.h"
@@ -37,7 +37,7 @@ TClientCommandRootCommon::TClientCommandRootCommon(const TClientSettings& settin
AddCommand(std::make_unique<TCommandConfig>());
AddCommand(std::make_unique<TCommandInit>());
AddCommand(std::make_unique<TCommandYql>());
- AddCommand(std::make_unique<TCommandStream>());
+ AddCommand(std::make_unique<TCommandTopic>());
AddCommand(std::make_unique<TCommandWorkload>());
}
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_topic.cpp
index fecef5b3240..4ad99e063b9 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_service_topic.cpp
@@ -1,4 +1,4 @@
-#include "ydb_service_stream.h"
+#include "ydb_service_topic.h"
#include <ydb/public/sdk/cpp/client/ydb_persqueue_public/persqueue.h>
#include <ydb/public/lib/ydb_cli/commands/ydb_command.h>
#include <ydb/public/lib/ydb_cli/common/command.h>
@@ -66,38 +66,38 @@ namespace NYdb::NConsoleClient {
return SupportedCodecs_;
}
- TCommandStream::TCommandStream()
- : TClientCommandTree("stream", {}, "DataStreams service operations") {
- AddCommand(std::make_unique<TCommandStreamCreate>());
- AddCommand(std::make_unique<TCommandStreamAlter>());
- AddCommand(std::make_unique<TCommandStreamDrop>());
- AddCommand(std::make_unique<TCommandStreamConsumer>());
+ TCommandTopic::TCommandTopic()
+ : TClientCommandTree("topic", {}, "TopicService operations") {
+ AddCommand(std::make_unique<TCommandTopicCreate>());
+ AddCommand(std::make_unique<TCommandTopicAlter>());
+ AddCommand(std::make_unique<TCommandTopicDrop>());
+ AddCommand(std::make_unique<TCommandTopicConsumer>());
}
- TCommandStreamCreate::TCommandStreamCreate()
- : TYdbCommand("create", {}, "Create stream command") {}
+ TCommandTopicCreate::TCommandTopicCreate()
+ : TYdbCommand("create", {}, "Create topic command") {}
- void TCommandStreamCreate::Config(TConfig &config) {
+ void TCommandTopicCreate::Config(TConfig &config) {
TYdbCommand::Config(config);
- config.Opts->AddLongOption("partitions-count", "Total partitions count for stream")
+ config.Opts->AddLongOption("partitions-count", "Total partitions count for topic")
.DefaultValue(1)
.StoreResult(&PartitionsCount_);
- config.Opts->AddLongOption("retention-period-hours", "Duration in hours for which data in stream is stored")
+ config.Opts->AddLongOption("retention-period-hours", "Duration in hours for which data in topic is stored")
.DefaultValue(18)
.Optional()
.StoreResult(&RetentionPeriodHours_);
config.Opts->SetFreeArgsNum(1);
- SetFreeArgTitle(0, "<stream-path>", "New stream name");
+ SetFreeArgTitle(0, "<topic-path>", "New topic path");
AddAllowedCodecs(config, AllowedCodecs);
}
- void TCommandStreamCreate::Parse(TConfig &config) {
+ void TCommandTopicCreate::Parse(TConfig &config) {
TYdbCommand::Parse(config);
- ParseStreamName(config, 0);
+ ParseTopicName(config, 0);
ParseCodecs();
}
- int TCommandStreamCreate::Run(TConfig &config) {
+ int TCommandTopicCreate::Run(TConfig &config) {
TDriver driver = CreateDriver(config);
NYdb::NPersQueue::TPersQueueClient persQueueClient(driver);
@@ -111,32 +111,32 @@ namespace NYdb::NConsoleClient {
}
settings.RetentionPeriod(TDuration::Hours(RetentionPeriodHours_));
- auto status = persQueueClient.CreateTopic(StreamName, settings).GetValueSync();
+ auto status = persQueueClient.CreateTopic(TopicName, settings).GetValueSync();
ThrowOnError(status);
return EXIT_SUCCESS;
}
- TCommandStreamAlter::TCommandStreamAlter() : TYdbCommand("alter", {}, "Alter stream command") {}
+ TCommandTopicAlter::TCommandTopicAlter() : TYdbCommand("alter", {}, "Alter topic command") {}
- void TCommandStreamAlter::Config(TConfig &config) {
+ void TCommandTopicAlter::Config(TConfig &config) {
TYdbCommand::Config(config);
- config.Opts->AddLongOption("partitions-count", "Total partitions count for stream")
+ config.Opts->AddLongOption("partitions-count", "Total partitions count for topic")
.StoreResult(&PartitionsCount_);
- config.Opts->AddLongOption("retention-period-hours", "Duration for which data in stream is stored")
+ config.Opts->AddLongOption("retention-period-hours", "Duration for which data in topic is stored")
.Optional()
.StoreResult(&RetentionPeriodHours_);
config.Opts->SetFreeArgsNum(1);
- SetFreeArgTitle(0, "<stream-path>", "Stream to alter");
+ SetFreeArgTitle(0, "<topic-path>", "Topic to alter");
AddAllowedCodecs(config, AllowedCodecs);
}
- void TCommandStreamAlter::Parse(TConfig &config) {
+ void TCommandTopicAlter::Parse(TConfig &config) {
TYdbCommand::Parse(config);
- ParseStreamName(config, 0);
+ ParseTopicName(config, 0);
ParseCodecs();
}
- NYdb::NPersQueue::TAlterTopicSettings TCommandStreamAlter::PrepareAlterSettings(
+ NYdb::NPersQueue::TAlterTopicSettings TCommandTopicAlter::PrepareAlterSettings(
NYdb::NPersQueue::TDescribeTopicResult &describeResult) {
auto settings = NYdb::NPersQueue::TAlterTopicSettings();
settings.SetSettings(describeResult.TopicSettings());
@@ -157,7 +157,7 @@ namespace NYdb::NConsoleClient {
return settings;
}
- int TCommandStreamAlter::Run(TConfig &config) {
+ int TCommandTopicAlter::Run(TConfig &config) {
if (!PartitionsCount_.Defined() && GetCodecs().empty() && !RetentionPeriodHours_.Defined()) {
return EXIT_SUCCESS;
}
@@ -165,48 +165,48 @@ namespace NYdb::NConsoleClient {
TDriver driver = CreateDriver(config);
NYdb::NPersQueue::TPersQueueClient persQueueClient(driver);
- auto describeResult = persQueueClient.DescribeTopic(StreamName).GetValueSync();
+ auto describeResult = persQueueClient.DescribeTopic(TopicName).GetValueSync();
ThrowOnError(describeResult);
auto settings = PrepareAlterSettings(describeResult);
- auto result = persQueueClient.AlterTopic(StreamName, settings).GetValueSync();
+ auto result = persQueueClient.AlterTopic(TopicName, settings).GetValueSync();
ThrowOnError(result);
return EXIT_SUCCESS;
}
- TCommandStreamDrop::TCommandStreamDrop() : TYdbCommand("drop", {}, "Drop stream command") {}
+ TCommandTopicDrop::TCommandTopicDrop() : TYdbCommand("drop", {}, "Drop topic command") {}
- void TCommandStreamDrop::Parse(TConfig &config) {
+ void TCommandTopicDrop::Parse(TConfig &config) {
TYdbCommand::Parse(config);
- ParseStreamName(config, 0);
+ ParseTopicName(config, 0);
}
- void TCommandStreamDrop::Config(TConfig &config) {
+ void TCommandTopicDrop::Config(TConfig &config) {
TYdbCommand::Config(config);
config.Opts->SetFreeArgsNum(1);
- SetFreeArgTitle(0, "<stream-path>", "Stream which will be dropped");
+ SetFreeArgTitle(0, "<topic-path>", "Topic which will be dropped");
}
- int TCommandStreamDrop::Run(TConfig &config) {
+ int TCommandTopicDrop::Run(TConfig &config) {
TDriver driver = CreateDriver(config);
NPersQueue::TPersQueueClient persQueueClient(driver);
auto settings = NYdb::NPersQueue::TDropTopicSettings();
- TStatus status = persQueueClient.DropTopic(StreamName, settings).GetValueSync();
+ TStatus status = persQueueClient.DropTopic(TopicName, settings).GetValueSync();
ThrowOnError(status);
return EXIT_SUCCESS;
}
- TCommandStreamConsumer::TCommandStreamConsumer() : TClientCommandTree("consumer", {}, "Consumer operations") {
- AddCommand(std::make_unique<TCommandStreamConsumerAdd>());
- AddCommand(std::make_unique<TCommandStreamConsumerDrop>());
+ TCommandTopicConsumer::TCommandTopicConsumer() : TClientCommandTree("consumer", {}, "Consumer operations") {
+ AddCommand(std::make_unique<TCommandTopicConsumerAdd>());
+ AddCommand(std::make_unique<TCommandTopicConsumerDrop>());
}
- TCommandStreamConsumerAdd::TCommandStreamConsumerAdd() : TYdbCommand("add", {}, "Consumer add operation") {}
+ TCommandTopicConsumerAdd::TCommandTopicConsumerAdd() : TYdbCommand("add", {}, "Consumer add operation") {}
- void TCommandStreamConsumerAdd::Config(TConfig &config) {
+ void TCommandTopicConsumerAdd::Config(TConfig &config) {
TYdbCommand::Parse(config);
- config.Opts->AddLongOption("consumer-name", "New consumer for stream")
+ config.Opts->AddLongOption("consumer-name", "New consumer for topic")
.Required()
.StoreResult(&ConsumerName_);
config.Opts->AddLongOption("service-type", "Service type of reader")
@@ -216,15 +216,15 @@ namespace NYdb::NConsoleClient {
.Optional()
.StoreResult(&StartingMessageTimestamp_);
config.Opts->SetFreeArgsNum(1);
- SetFreeArgTitle(0, "<stream-path>", "Stream for which consumer will be added");
+ SetFreeArgTitle(0, "<topic-path>", "topic for which consumer will be added");
}
- void TCommandStreamConsumerAdd::Parse(TConfig &config) {
+ void TCommandTopicConsumerAdd::Parse(TConfig &config) {
TYdbCommand::Parse(config);
- ParseStreamName(config, 0);
+ ParseTopicName(config, 0);
}
- int TCommandStreamConsumerAdd::Run(TConfig &config) {
+ int TCommandTopicConsumerAdd::Run(TConfig &config) {
TDriver driver = CreateDriver(config);
NPersQueue::TPersQueueClient persQueueClient(driver);
@@ -239,35 +239,35 @@ namespace NYdb::NConsoleClient {
auto addReadRuleSettings = NYdb::NPersQueue::TAddReadRuleSettings();
addReadRuleSettings.ReadRule(readRuleSettings);
- TStatus status = persQueueClient.AddReadRule(StreamName, addReadRuleSettings).GetValueSync();
+ TStatus status = persQueueClient.AddReadRule(TopicName, addReadRuleSettings).GetValueSync();
ThrowOnError(status);
return EXIT_SUCCESS;
}
- TCommandStreamConsumerDrop::TCommandStreamConsumerDrop() : TYdbCommand("drop", {}, "Consumer drop operation") {}
+ TCommandTopicConsumerDrop::TCommandTopicConsumerDrop() : TYdbCommand("drop", {}, "Consumer drop operation") {}
- void TCommandStreamConsumerDrop::Config(TConfig &config) {
+ void TCommandTopicConsumerDrop::Config(TConfig &config) {
TYdbCommand::Config(config);
config.Opts->AddLongOption("consumer-name", "Consumer which will be dropped")
.Required()
.StoreResult(&ConsumerName_);
config.Opts->SetFreeArgsNum(1);
- SetFreeArgTitle(0, "<stream-path>", "Stream from which consumer will be dropped");
+ SetFreeArgTitle(0, "<topic-path>", "Topic from which consumer will be dropped");
}
- void TCommandStreamConsumerDrop::Parse(TConfig &config) {
+ void TCommandTopicConsumerDrop::Parse(TConfig &config) {
TYdbCommand::Parse(config);
- ParseStreamName(config, 0);
+ ParseTopicName(config, 0);
}
- int TCommandStreamConsumerDrop::Run(TConfig &config) {
+ int TCommandTopicConsumerDrop::Run(TConfig &config) {
TDriver driver = CreateDriver(config);
NPersQueue::TPersQueueClient persQueueClient(driver);
NYdb::NPersQueue::TRemoveReadRuleSettings removeReadRuleSettings = NYdb::NPersQueue::TRemoveReadRuleSettings();
removeReadRuleSettings.ConsumerName(ConsumerName_);
- TStatus status = persQueueClient.RemoveReadRule(StreamName, removeReadRuleSettings).GetValueSync();
+ TStatus status = persQueueClient.RemoveReadRule(TopicName, removeReadRuleSettings).GetValueSync();
ThrowOnError(status);
return EXIT_SUCCESS;
}
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.h b/ydb/public/lib/ydb_cli/commands/ydb_service_topic.h
index 3a1248321b6..2766c26aead 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_service_stream.h
+++ b/ydb/public/lib/ydb_cli/commands/ydb_service_topic.h
@@ -21,15 +21,15 @@ namespace NYdb::NConsoleClient {
TVector<NPersQueue::ECodec> SupportedCodecs_;
};
- class TCommandStream : public TClientCommandTree {
+ class TCommandTopic : public TClientCommandTree {
public:
- TCommandStream();
+ TCommandTopic();
};
- class TCommandStreamCreate : public TYdbCommand, public TCommandWithStreamName, public TCommandWithSupportedCodecs {
+ class TCommandTopicCreate : public TYdbCommand, public TCommandWithTopicName, public TCommandWithSupportedCodecs {
public:
- TCommandStreamCreate();
+ TCommandTopicCreate();
void Config(TConfig &config) override;
void Parse(TConfig &config) override;
int Run(TConfig &config) override;
@@ -39,9 +39,9 @@ namespace NYdb::NConsoleClient {
ui32 PartitionsCount_;
};
- class TCommandStreamAlter : public TYdbCommand, public TCommandWithStreamName, public TCommandWithSupportedCodecs {
+ class TCommandTopicAlter : public TYdbCommand, public TCommandWithTopicName, public TCommandWithSupportedCodecs {
public:
- TCommandStreamAlter();
+ TCommandTopicAlter();
void Config(TConfig &config) override;
void Parse(TConfig &config) override;
int Run(TConfig &config) override;
@@ -52,22 +52,22 @@ namespace NYdb::NConsoleClient {
NYdb::NPersQueue::TAlterTopicSettings PrepareAlterSettings(NYdb::NPersQueue::TDescribeTopicResult &describeResult);
};
- class TCommandStreamDrop : public TYdbCommand, public TCommandWithStreamName {
+ class TCommandTopicDrop : public TYdbCommand, public TCommandWithTopicName {
public:
- TCommandStreamDrop();
+ TCommandTopicDrop();
void Config(TConfig &config) override;
void Parse(TConfig &config) override;
int Run(TConfig &config) override;
};
- class TCommandStreamConsumer : public TClientCommandTree {
+ class TCommandTopicConsumer : public TClientCommandTree {
public:
- TCommandStreamConsumer();
+ TCommandTopicConsumer();
};
- class TCommandStreamConsumerAdd : public TYdbCommand, public TCommandWithStreamName {
+ class TCommandTopicConsumerAdd : public TYdbCommand, public TCommandWithTopicName {
public:
- TCommandStreamConsumerAdd();
+ TCommandTopicConsumerAdd();
void Config(TConfig &config) override;
void Parse(TConfig &config) override;
int Run(TConfig &config) override;
@@ -78,9 +78,9 @@ namespace NYdb::NConsoleClient {
TMaybe<ui64> StartingMessageTimestamp_;
};
- class TCommandStreamConsumerDrop : public TYdbCommand, public TCommandWithStreamName {
+ class TCommandTopicConsumerDrop : public TYdbCommand, public TCommandWithTopicName {
public:
- TCommandStreamConsumerDrop();
+ TCommandTopicConsumerDrop();
void Config(TConfig &config) override;
void Parse(TConfig &config) override;
int Run(TConfig &config) override;
diff --git a/ydb/public/lib/ydb_cli/common/command.cpp b/ydb/public/lib/ydb_cli/common/command.cpp
index bb16be4e495..580fe4d6c06 100644
--- a/ydb/public/lib/ydb_cli/common/command.cpp
+++ b/ydb/public/lib/ydb_cli/common/command.cpp
@@ -373,8 +373,8 @@ void TCommandWithPath::AdjustPath(const TClientCommand::TConfig& config) {
NConsoleClient::AdjustPath(Path, config);
}
-void TCommandWithStreamName::ParseStreamName(const TClientCommand::TConfig &config, const size_t argPos) {
- StreamName = config.ParseResult->GetFreeArgs()[argPos];
+void TCommandWithTopicName::ParseTopicName(const TClientCommand::TConfig &config, const size_t argPos) {
+ TopicName = config.ParseResult->GetFreeArgs()[argPos];
}
}
diff --git a/ydb/public/lib/ydb_cli/common/command.h b/ydb/public/lib/ydb_cli/common/command.h
index 8c65c7f1a7c..6948990a440 100644
--- a/ydb/public/lib/ydb_cli/common/command.h
+++ b/ydb/public/lib/ydb_cli/common/command.h
@@ -130,20 +130,20 @@ public:
bool IsSvnVersionCommand() {
TString lastArg = ArgV[ArgC - 1];
return lastArg == "--svnrevision" || lastArg == "-V";
- }
-
- bool IsVersionCommand() {
- TString lastArg = ArgV[ArgC - 1];
- if (lastArg == "version") {
- return true;
- }
- if (ArgC > 1) {
- TString penultimateArg = ArgV[ArgC - 2];
- if (penultimateArg == "version" && lastArg == "--semantic") {
- return true;
- }
- }
- return false;
+ }
+
+ bool IsVersionCommand() {
+ TString lastArg = ArgV[ArgC - 1];
+ if (lastArg == "version") {
+ return true;
+ }
+ if (ArgC > 1) {
+ TString penultimateArg = ArgV[ArgC - 2];
+ if (penultimateArg == "version" && lastArg == "--semantic") {
+ return true;
+ }
+ }
+ return false;
}
bool IsVersionForceCheckCommand() {
@@ -382,11 +382,11 @@ protected:
TString Path;
};
-class TCommandWithStreamName {
+class TCommandWithTopicName {
protected:
- void ParseStreamName(const TClientCommand::TConfig& config, const size_t argPos);
+ void ParseTopicName(const TClientCommand::TConfig& config, const size_t argPos);
- TString StreamName;
+ TString TopicName;
};
}