Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ydb/core/tx/sharding/hash_intervals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,17 @@ std::shared_ptr<NKikimr::NSharding::IGranuleShardingLogic> TConsistencySharding6
}
}

ui64 TSpecificShardingInfo::GetUnifiedDistributionBorder(const ui32 idx, const ui64 shardsCount) const {
AFL_VERIFY(idx <= shardsCount);
if (idx == shardsCount) {
return Max<ui64>();
}
#ifdef KIKIMR_DISABLE_WINDOWS
AFL_VERIFY(false)("error", "windows implementation doesn't works");
return 0;
#else
return Max<ui64>() * (1.0 * idx / shardsCount);
#endif
}

}
8 changes: 1 addition & 7 deletions ydb/core/tx/sharding/hash_intervals.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ class TSpecificShardingInfo {
std::vector<TConsistencyShardingTablet> SpecialSharding;
std::vector<TConsistencyShardingTablet*> ActiveWriteSpecialSharding;
std::vector<TConsistencyShardingTablet*> ActiveReadSpecialSharding;
ui64 GetUnifiedDistributionBorder(const ui32 idx, const ui64 shardsCount) const {
AFL_VERIFY(idx <= shardsCount);
if (idx == shardsCount) {
return Max<ui64>();
}
return Max<ui64>() * (1.0 * idx / shardsCount);
}
ui64 GetUnifiedDistributionBorder(const ui32 idx, const ui64 shardsCount) const;

TConclusionStatus CheckIntervalsFilling() const {
{
Expand Down
6 changes: 6 additions & 0 deletions ydb/core/tx/sharding/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ SRCS(

END()

IF (OS_WINDOWS)
CFLAGS(
-DKIKIMR_DISABLE_WINDOWS
)
ENDIF()

RECURSE_FOR_TESTS(
ut
)