Skip to content

Commit

Permalink
[YQ-2728] spurious empty TMaybe fix (ydb-platform#1984) (ydb-platform…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alnen authored Feb 16, 2024
1 parent fa0cfd9 commit 97ec42c
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 186 deletions.
2 changes: 1 addition & 1 deletion ydb/core/fq/libs/common/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ FederatedQuery::IamAuth GetAuth(const FederatedQuery::Connection& connection);

TString RemoveDatabaseFromStr(TString str, const TString& substr);

NYql::TIssues RemoveDatabaseFromIssues(const NYql::TIssues& issues, const TString& str);
NYql::TIssues RemoveDatabaseFromIssues(const NYql::TIssues& issues, const TString& databasePath);

} // namespace NFq
22 changes: 10 additions & 12 deletions ydb/core/fq/libs/control_plane_proxy/actors/base_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,29 @@
#include <ydb/core/fq/libs/control_plane_proxy/control_plane_proxy.h>
#include <ydb/library/yql/public/issue/yql_issue.h>

namespace NFq {
namespace NPrivate {
namespace NFq::NPrivate {

using namespace NActors;
using namespace NThreading;
using namespace NYdb;

template<typename TDerived>
class TPlainBaseActor : public NActors::TActorBootstrapped<TDerived> {
class TPlainBaseActor : public TActorBootstrapped<TDerived> {
public:
using TBase = NActors::TActorBootstrapped<TDerived>;
using TBase = TActorBootstrapped<TDerived>;
using TBase::Become;
using TBase::SelfId;
using TBase::Send;

public:
TPlainBaseActor(const TActorId& successActorId,
const TActorId& errorActorId,
TDuration requestTimeout,
const NPrivate::TRequestCommonCountersPtr& counters)
const TActorId& errorActorId,
TDuration requestTimeout,
const TRequestCommonCountersPtr& counters)
: Counters(counters)
, SuccessActorId(successActorId)
, ErrorActorId(errorActorId)
, RequestTimeout(requestTimeout) { }
, RequestTimeout(std::move(requestTimeout)) { }

void Bootstrap() {
CPP_LOG_T("TBaseActor Bootstrap started. Actor id: " << SelfId());
Expand Down Expand Up @@ -84,7 +83,7 @@ class TPlainBaseActor : public NActors::TActorBootstrapped<TDerived> {
virtual IEventBase* MakeTimeoutEventImpl(NYql::TIssue issue) = 0;

protected:
const NPrivate::TRequestCommonCountersPtr Counters;
const TRequestCommonCountersPtr Counters;
const TActorId SuccessActorId;
const TActorId ErrorActorId;
const TDuration RequestTimeout;
Expand Down Expand Up @@ -112,7 +111,7 @@ class TBaseActor : public TPlainBaseActor<TDerived> {
TBaseActor(const TActorId& proxyActorId,
const TEventRequestPtr request,
TDuration requestTimeout,
const NPrivate::TRequestCommonCountersPtr& counters)
const TRequestCommonCountersPtr& counters)
: TPlainBaseActor<TDerived>(proxyActorId,
request->Sender,
std::move(requestTimeout),
Expand Down Expand Up @@ -152,5 +151,4 @@ class TBaseActor : public TPlainBaseActor<TDerived> {
const TEventRequestPtr Request;
};

} // namespace NPrivate
} // namespace NFq
} // namespace NFq::NPrivate
15 changes: 6 additions & 9 deletions ydb/core/fq/libs/control_plane_proxy/actors/request_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@
#include <ydb/core/fq/libs/control_plane_storage/events/events.h>
#include <ydb/library/yql/public/issue/yql_issue.h>

namespace NFq {
namespace NPrivate {
namespace NFq::NPrivate {

template<class TRequestProto, class TRequest, class TResponse, class TRequestProxy, class TResponseProxy>
class TRequestActor :
public NActors::TActorBootstrapped<
public TActorBootstrapped<
TRequestActor<TRequestProto, TRequest, TResponse, TRequestProxy, TResponseProxy>> {
protected:
using TBase = NActors::TActorBootstrapped<
TRequestActor<TRequestProto, TRequest, TResponse, TRequestProxy, TResponseProxy>>;
using TBase = TActorBootstrapped<TRequestActor>;
using TBase::SelfId;
using TBase::Send;
using TBase::PassAway;
using TBase::Become;
using TBase::Schedule;

typename TRequestProxy::TPtr RequestProxy;
::NFq::TControlPlaneProxyConfig Config;
TControlPlaneProxyConfig Config;
TActorId ServiceId;
TRequestCounters Counters;
TInstant StartTime;
Expand All @@ -42,7 +40,7 @@ class TRequestActor :
static constexpr char ActorName[] = "YQ_CONTROL_PLANE_PROXY_REQUEST_ACTOR";

explicit TRequestActor(typename TRequestProxy::TPtr requestProxy,
const ::NFq::TControlPlaneProxyConfig& config,
const TControlPlaneProxyConfig& config,
const TActorId& serviceId,
const TRequestCounters& counters,
const std::function<void(const TDuration&, bool, bool)>& probe,
Expand Down Expand Up @@ -255,5 +253,4 @@ class TCreateQueryRequestActor :
}
};

}
}
} // namespace NFq::NPrivate
Loading

0 comments on commit 97ec42c

Please sign in to comment.