aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilnaz <ilnaz@ydb.tech>2022-09-09 21:48:19 +0300
committerilnaz <ilnaz@ydb.tech>2022-09-09 21:48:19 +0300
commit2f1df3252e615c261b7ad6b5e206c358a11791b1 (patch)
tree0da319a1a6cb1145903f945f9e27efc435bb5e3a
parentd7e6c4d86c2894508eb9bb4e1e64af40d4b91e70 (diff)
downloadydb-2f1df3252e615c261b7ad6b5e206c358a11791b1.tar.gz
Consumers table fixes
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
index d1eaf8e49a..4b8401010f 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
@@ -6,6 +6,7 @@
#include <ydb/public/lib/ydb_cli/common/print_utils.h>
#include <ydb/public/lib/ydb_cli/common/scheme_printers.h>
+#include <util/string/join.h>
namespace NYdb {
namespace NConsoleClient {
@@ -169,32 +170,20 @@ int TCommandDescribe::PrintPathResponse(TDriver& driver, const NScheme::TDescrib
namespace {
TString FormatCodecs(const TVector<NYdb::NTopic::ECodec>& codecs) {
- if (codecs.empty()) {
- return "";
- }
-
- TStringBuilder builder = TStringBuilder();
- for (unsigned int i = 0; i < codecs.size() - 1; ++i) {
- builder << codecs[i] << ", ";
- }
- builder << codecs[codecs.size() - 1];
- return ToString(builder);
+ return JoinSeq(", ", codecs);
}
- void PrintTopicConsumers(
- const TVector<NYdb::NTopic::TConsumer>& consumers) {
+ void PrintTopicConsumers(const TVector<NYdb::NTopic::TConsumer>& consumers) {
if (consumers.empty()) {
return;
}
- TPrettyTable table(
- {"ConsumerName", "SupportedCodecs",
- "ReadFrom", "Important"});
+ TPrettyTable table({ "ConsumerName", "SupportedCodecs", "ReadFrom", "Important" });
for (const auto& c: consumers) {
table.AddRow()
.Column(0, c.GetConsumerName())
.Column(1, FormatCodecs(c.GetSupportedCodecs()))
.Column(2, c.GetReadFrom().ToRfc822StringLocal())
- .Column(3, c.GetImportant());
+ .Column(3, c.GetImportant() ? "Yes" : "No");
// .Column(4, rule.ServiceType())
// .Column(5, rule.Version());
}