Skip to content

Commit

Permalink
YQ kqprun remove start message (ydb-platform#7490)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriyPA authored Aug 6, 2024
1 parent 58580f8 commit 77b77cc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
33 changes: 25 additions & 8 deletions ydb/core/testlib/test_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,9 @@ namespace Tests {
hostConfig.SetHostConfigId(nodeId);
TString path = TStringBuilder() << Runtime->GetTempDir() << "pdisk_1.dat";
hostConfig.AddDrive()->SetPath(path);
Cerr << "test_client.cpp: SetPath # " << path << Endl;
if (Settings->Verbose) {
Cerr << "test_client.cpp: SetPath # " << path << Endl;
}
bsConfigureRequest->Record.MutableRequest()->AddCommand()->MutableDefineHostConfig()->CopyFrom(hostConfig);

auto& host = *boxConfig.AddHost();
Expand Down Expand Up @@ -1254,6 +1256,7 @@ namespace Tests {
, DomainName(settings.DomainName)
, SupportsRedirect(settings.SupportsRedirect)
, StoragePoolTypes(settings.StoragePoolTypes)
, Verbose(settings.Verbose)
, FunctionRegistry(NKikimr::NMiniKQL::CreateFunctionRegistry(NKikimr::NMiniKQL::CreateBuiltinRegistry()))
, LoadedFunctionRegistry(NKikimr::NMiniKQL::CreateFunctionRegistry(NKikimr::NMiniKQL::CreateBuiltinRegistry()))
{
Expand All @@ -1272,7 +1275,9 @@ namespace Tests {
Client.reset(new NMsgBusProxy::TMsgBusClient(ClientConfig));
Client->Init();

Cerr << "TClient is connected to server " << ClientConfig.Ip << ":" << ClientConfig.Port << Endl;
if (Verbose) {
Cerr << "TClient is connected to server " << ClientConfig.Ip << ":" << ClientConfig.Port << Endl;
}
}

const NMsgBusProxy::TMsgBusClientConfig& TClient::GetClientConfig() const {
Expand Down Expand Up @@ -1350,13 +1355,17 @@ namespace Tests {

void TClient::WaitRootIsUp(const TString& root) {
while (true) {
Cerr << "WaitRootIsUp '" << root << "'..." << Endl;
if (Verbose) {
Cerr << "WaitRootIsUp '" << root << "'..." << Endl;
}

TAutoPtr<NMsgBusProxy::TBusResponse> resp = Ls(root);
UNIT_ASSERT(resp);

if (resp->Record.GetStatus() == NMsgBusProxy::MSTATUS_OK && resp->Record.GetSchemeStatus() == NKikimrScheme::StatusSuccess) {
Cerr << "WaitRootIsUp '" << root << "' success." << Endl;
if (Verbose) {
Cerr << "WaitRootIsUp '" << root << "' success." << Endl;
}
break;
}
}
Expand All @@ -1381,7 +1390,9 @@ namespace Tests {
TAutoPtr<NBus::TBusMessage> reply;
SendAndWaitCompletion(request, reply);

Cout << PrintToString<NMsgBusProxy::TBusResponse>(reply.Get()) << Endl;
if (Verbose) {
Cout << PrintToString<NMsgBusProxy::TBusResponse>(reply.Get()) << Endl;
}
return reply;
}

Expand Down Expand Up @@ -1411,7 +1422,9 @@ namespace Tests {
msg->Record.MutableFlatTxId()->SetSchemeShardTabletId(schemeshard);
msg->Record.MutableFlatTxId()->SetPathId(pathId);
msg->Record.MutablePollOptions()->SetTimeout(timeout.MilliSeconds());
Cerr << "waiting..." << Endl;
if (Verbose) {
Cerr << "waiting..." << Endl;
}
status = SyncCall(msg, reply);
if (status != NBus::MESSAGE_OK) {
const char *description = NBus::MessageStatusDescription(status);
Expand Down Expand Up @@ -1949,7 +1962,9 @@ namespace Tests {
}

TAutoPtr<NMsgBusProxy::TBusResponse> TClient::LsImpl(const TString& path) {
Cerr << "TClient::Ls request: " << path << Endl;
if (Verbose) {
Cerr << "TClient::Ls request: " << path << Endl;
}

TAutoPtr<NMsgBusProxy::TBusSchemeDescribe> request(new NMsgBusProxy::TBusSchemeDescribe());
request->Record.SetPath(path);
Expand All @@ -1958,7 +1973,9 @@ namespace Tests {
NBus::EMessageStatus msgStatus = SendWhenReady(request, reply);
UNIT_ASSERT_VALUES_EQUAL(msgStatus, NBus::MESSAGE_OK);

Cerr << "TClient::Ls response: " << PrintToString<NMsgBusProxy::TBusResponse>(reply.Get()) << Endl;
if (Verbose) {
Cerr << "TClient::Ls response: " << PrintToString<NMsgBusProxy::TBusResponse>(reply.Get()) << Endl;
}

return dynamic_cast<NMsgBusProxy::TBusResponse*>(reply.Release());
}
Expand Down
3 changes: 3 additions & 0 deletions ydb/core/testlib/test_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ namespace Tests {
NYql::IYtGateway::TPtr YtGateway;
bool InitializeFederatedQuerySetupFactory = false;
TString ServerCertFilePath;
bool Verbose = true;

std::function<IActor*(const TTicketParserSettings&)> CreateTicketParser = NKikimr::CreateTicketParser;
std::shared_ptr<TGrpcServiceFactory> GrpcServiceFactory;
Expand Down Expand Up @@ -207,6 +208,7 @@ namespace Tests {
TServerSettings& SetComputationFactory(NMiniKQL::TComputationNodeFactory computationFactory) { ComputationFactory = std::move(computationFactory); return *this; }
TServerSettings& SetYtGateway(NYql::IYtGateway::TPtr ytGateway) { YtGateway = std::move(ytGateway); return *this; }
TServerSettings& SetInitializeFederatedQuerySetupFactory(bool value) { InitializeFederatedQuerySetupFactory = value; return *this; }
TServerSettings& SetVerbose(bool value) { Verbose = value; return *this; }
TServerSettings& SetPersQueueGetReadSessionsInfoWorkerFactory(
std::shared_ptr<NKikimr::NMsgBusProxy::IPersQueueGetReadSessionsInfoWorkerFactory> factory
) {
Expand Down Expand Up @@ -594,6 +596,7 @@ namespace Tests {
const TString DomainName;
const bool SupportsRedirect;
const TStoragePoolKinds StoragePoolTypes;
const bool Verbose;
NScheme::TKikimrTypeRegistry TypeRegistry;
TIntrusivePtr<NMiniKQL::IFunctionRegistry> FunctionRegistry;
NMsgBusProxy::TMsgBusClientConfig ClientConfig;
Expand Down
1 change: 1 addition & 0 deletions ydb/tests/tools/kqprun/src/ydb_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class TYdbSetup::TImpl {
serverSettings.SetYtGateway(Settings_.YtGateway);
serverSettings.S3ActorsFactory = NYql::NDq::CreateS3ActorsFactory();
serverSettings.SetInitializeFederatedQuerySetupFactory(true);
serverSettings.SetVerbose(false);

SetLoggerSettings(serverSettings);
SetFunctionRegistry(serverSettings);
Expand Down

0 comments on commit 77b77cc

Please sign in to comment.