Skip to content
Open
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
4 changes: 2 additions & 2 deletions AnnService/Aggregator.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions AnnService/BalancedDataPartition.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions AnnService/Client.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions AnnService/IndexBuilder.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions AnnService/IndexSearcher.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions AnnService/SSDServing.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions AnnService/Server.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions AnnService/SocketLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
24 changes: 24 additions & 0 deletions AnnService/inc/Core/Common/CommonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,30 @@ namespace SPTAG
}
}
}

static void PrintPostingDiff(std::string &p1, std::string &p2, const char *pos)
{
if (p1.size() != p2.size())
{
SPTAGLIB_LOG(Helper::LogLevel::LL_Error,
"Merge %s: p1 and p2 have different sizes: before=%u after=%u\n", pos, p1.size(),
p2.size());
return;
}
std::string diff = "";
for (size_t i = 0; i < p1.size(); i++)
{
if (p1[i] != p2[i])
{
diff += "[" + std::to_string(i) + "]:" + std::to_string(int(p1[i])) + "^" +
std::to_string(int(p2[i])) + " ";
}
}
if (diff.size() != 0)
{
SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "%s: %s\n", pos, diff.substr(0, 1000).c_str());
}
}
};
}
}
Expand Down
18 changes: 10 additions & 8 deletions AnnService/inc/Core/Common/Dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,17 @@ namespace SPTAG
{
if (data != nullptr) {
if (ownData) ALIGN_FREE(data);
for (char* ptr : *incBlocks) ALIGN_FREE(ptr);
incBlocks->clear();
}

rows = rows_;

if (incBlocks != nullptr)
{
for (char *ptr : *incBlocks)
ALIGN_FREE(ptr);
incBlocks->clear();
}
incRows = 0;

if (rowEnd_ >= colStart_) cols = rowEnd_;
else cols = cols_ * sizeof(T);
data = (char*)data_;
Expand Down Expand Up @@ -390,11 +396,7 @@ namespace SPTAG
IOBINARY(pInput, ReadBinary, sizeof(SizeType), (char*)&(r));
IOBINARY(pInput, ReadBinary, sizeof(DimensionType), (char*)(&c));

if (data == nullptr) Initialize(r, c, blockSize, capacity);
else if (r > rows + incRows) {
SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Read more data (%d, %d) than before (%d, %d)!\n", r, c, rows + incRows, mycols);
if(AddBatch(r - rows - incRows) != ErrorCode::Success) return ErrorCode::MemoryOverFlow;
}
if (data == nullptr || r != rows + incRows) Initialize(r, c, blockSize, capacity);

for (SizeType i = 0; i < r; i++) {
IOBINARY(pInput, ReadBinary, sizeof(T) * mycols, (char*)At(i));
Expand Down
4 changes: 2 additions & 2 deletions AnnService/inc/Core/MetadataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class MemMetadataSet : public MetadataSet
std::uint64_t p_blockSize, std::uint64_t p_capacity, std::uint64_t p_metaSize);

MemMetadataSet(const std::string& p_metafile, const std::string& p_metaindexfile,
std::uint64_t p_blockSize, std::uint64_t p_capacity, std::uint64_t p_metaSize);
std::uint64_t p_blockSize, std::uint64_t p_capacity, std::uint64_t p_metaSize, int start = 0, int count = -1);

MemMetadataSet(std::shared_ptr<Helper::DiskIO> p_metain, std::shared_ptr<Helper::DiskIO> p_metaindexin,
std::uint64_t p_blockSize, std::uint64_t p_capacity, std::uint64_t p_metaSize);
Expand All @@ -118,7 +118,7 @@ class MemMetadataSet : public MetadataSet

private:
ErrorCode Init(std::shared_ptr<Helper::DiskIO> p_metain, std::shared_ptr<Helper::DiskIO> p_metaindexin,
std::uint64_t p_blockSize, std::uint64_t p_capacity, std::uint64_t p_metaSize);
std::uint64_t p_blockSize, std::uint64_t p_capacity, std::uint64_t p_metaSize, int start = 0, int count = -1);

std::shared_ptr<void> m_lock;

Expand Down
Loading
Loading