Skip to content

Commit

Permalink
Preparation for clang-18 migration (#10983)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitry Nechitaev <[email protected]>
  • Loading branch information
Nechda and Nechda authored Oct 28, 2024
1 parent 37ae9cc commit 6dc162f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
12 changes: 12 additions & 0 deletions ydb/core/blob_depot/data_uncertain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,15 @@ namespace NKikimr::NBlobDepot {
}

} // NKikimr::NBlobDepot

using TAliasEKeyBlobState = ::NKikimr::NBlobDepot::TUncertaintyResolverScope::EKeyBlobState;
template<>
void Out<TAliasEKeyBlobState>(IOutputStream& s, TAliasEKeyBlobState value) {
switch (value) {
case TAliasEKeyBlobState::INITIAL: s << "INITIAL"; break;
case TAliasEKeyBlobState::QUERY_IN_FLIGHT: s << "QUERY_IN_FLIGHT"; break;
case TAliasEKeyBlobState::CONFIRMED: s << "CONFIRMED"; break;
case TAliasEKeyBlobState::WASNT_WRITTEN: s << "WASNT_WRITTEN"; break;
case TAliasEKeyBlobState::ERROR: s << "ERROR"; break;
}
}
29 changes: 11 additions & 18 deletions ydb/core/blob_depot/data_uncertain.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@

namespace NKikimr::NBlobDepot {

struct TUncertaintyResolverScope {
enum class EKeyBlobState {
INITIAL, // just created blob, no activity
QUERY_IN_FLIGHT, // blob should have BlobContext referring to this key too
CONFIRMED, // we got OK for this blob
WASNT_WRITTEN, // we got NODATA for this blob, this key needs to be deleted if possible
ERROR, // we got ERROR or any other reply for this blob
};
};

class TBlobDepot::TData::TUncertaintyResolver {
using EKeyBlobState = TUncertaintyResolverScope::EKeyBlobState;
TBlobDepot* const Self;

struct TPendingUncertainKey {};
Expand All @@ -21,14 +32,6 @@ namespace NKikimr::NBlobDepot {
{}
};

enum class EKeyBlobState {
INITIAL, // just created blob, no activity
QUERY_IN_FLIGHT, // blob should have BlobContext referring to this key too
CONFIRMED, // we got OK for this blob
WASNT_WRITTEN, // we got NODATA for this blob, this key needs to be deleted if possible
ERROR, // we got ERROR or any other reply for this blob
};

struct TKeyContext {
// requests dependent on this key
std::vector<TIntrusivePtr<TResolveOnHold>> DependentRequests;
Expand All @@ -52,16 +55,6 @@ namespace NKikimr::NBlobDepot {
ui64 NumKeysUnresolved = 0;
ui64 NumKeysDropped = 0;

friend void Out<EKeyBlobState>(IOutputStream& s, EKeyBlobState value) {
switch (value) {
case EKeyBlobState::INITIAL: s << "INITIAL"; break;
case EKeyBlobState::QUERY_IN_FLIGHT: s << "QUERY_IN_FLIGHT"; break;
case EKeyBlobState::CONFIRMED: s << "CONFIRMED"; break;
case EKeyBlobState::WASNT_WRITTEN: s << "WASNT_WRITTEN"; break;
case EKeyBlobState::ERROR: s << "ERROR"; break;
}
}

public:
TUncertaintyResolver(TBlobDepot *self);
void PushResultWithUncertainties(TResolveResultAccumulator&& result, std::deque<TKey>&& uncertainties);
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/yql/dq/runtime/dq_arrow_helpers_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NUdf::TUnboxedValue GetValueOfBasicType(TType* type, ui64 value) {
case NUdf::EDataSlot::Uint16:
return NUdf::TUnboxedValuePod(static_cast<ui16>(value % (1 << 16)));
case NUdf::EDataSlot::Int32:
return NUdf::TUnboxedValuePod(static_cast<i32>(-(value % ((1 << 31) - 1))));
return NUdf::TUnboxedValuePod(static_cast<i32>(-(value % ((1ULL << 31) - 1))));
case NUdf::EDataSlot::Uint32:
return NUdf::TUnboxedValuePod(static_cast<ui32>(value % (1 << 31)));
case NUdf::EDataSlot::Int64:
Expand Down

0 comments on commit 6dc162f

Please sign in to comment.