Skip to content
Closed
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
5 changes: 1 addition & 4 deletions src/core/algorithm/hnsw_sparse/hnsw_sparse_algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ namespace core {
//! hnsw graph algorithm implement
class HnswSparseAlgorithm {
public:
typedef std::unique_ptr<HnswSparseAlgorithm> UPointer;
using UPointer = std::unique_ptr<HnswSparseAlgorithm>;

public:
//! Constructor
explicit HnswSparseAlgorithm(HnswSparseEntity &entity);

Expand Down Expand Up @@ -105,11 +104,9 @@ class HnswSparseAlgorithm {
//! expand neighbors until group nums are reached
void expand_neighbors_by_group(TopkHeap &topk, HnswSparseContext *ctx) const;

private:
HnswSparseAlgorithm(const HnswSparseAlgorithm &) = delete;
HnswSparseAlgorithm &operator=(const HnswSparseAlgorithm &) = delete;

private:
static constexpr uint32_t kLockCnt{1U << 8};
static constexpr uint32_t kLockMask{kLockCnt - 1U};

Expand Down
1 change: 0 additions & 1 deletion src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class HnswSparseBuilder : public IndexBuilder {
constexpr static uint32_t kDefaultLogIntervalSecs = 15U;
constexpr static uint32_t kMaxNeighborCnt = 65535;

private:
enum BUILD_STATE {
BUILD_STATE_INIT = 0,
BUILD_STATE_INITED = 1,
Expand Down
3 changes: 1 addition & 2 deletions src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using SparseChunk = IndexStorage::Segment;

class SparseChunkBroker {
public:
typedef std::shared_ptr<SparseChunkBroker> Pointer;
using Pointer = std::shared_ptr<SparseChunkBroker>;

enum CHUNK_TYPE {
CHUNK_TYPE_HEADER = 1,
Expand Down Expand Up @@ -127,7 +127,6 @@ class SparseChunkBroker {
ailego::StringHelper::ToString(seq_id);
}

private:
IndexStreamer::Stats &stats_;
HnswSparseChunkMeta chunk_meta_{};
size_t page_mask_{0UL};
Expand Down
2 changes: 0 additions & 2 deletions src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class HnswSparseSearcher : public IndexSearcher {
public:
using ContextPointer = IndexSearcher::Context::Pointer;

public:
HnswSparseSearcher(void);
virtual ~HnswSparseSearcher(void);

Expand Down Expand Up @@ -126,7 +125,6 @@ class HnswSparseSearcher : public IndexSearcher {
//! current streamer/searcher
int update_context(HnswSparseContext *ctx) const;

private:
enum State { STATE_INIT = 0, STATE_INITED = 1, STATE_LOADED = 2 };

HnswSparseSearcherEntity entity_{};
Expand Down
2 changes: 0 additions & 2 deletions src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class HnswSparseSearcherEntity : public HnswSparseEntity {
using Pointer = std::shared_ptr<HnswSparseSearcherEntity>;
using SegmentPointer = IndexStorage::Segment::Pointer;

public:
struct SegmentGroupParam {
SegmentGroupParam(SegmentPointer neighbors_in,
SegmentPointer neighbors_meta_in,
Expand Down Expand Up @@ -105,7 +104,6 @@ class HnswSparseSearcherEntity : public HnswSparseEntity {

virtual int cleanup(void) override;

public:
bool is_loaded() const {
return loaded_;
}
Expand Down
2 changes: 0 additions & 2 deletions src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,10 @@ class HnswSparseStreamer : public IndexStreamer {
return 0;
}

private:
//! To share ctx across streamer/searcher, we need to update the context for
//! current streamer/searcher
int update_context(HnswSparseContext *ctx) const;

private:
enum State { STATE_INIT = 0, STATE_INITED = 1, STATE_OPENED = 2 };
class Stats : public IndexStreamer::Stats {
public:
Expand Down
3 changes: 0 additions & 3 deletions src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ class HnswSparseStreamerEntity : public HnswSparseEntity {

virtual void update_ep_and_level(node_id_t ep, level_t level) override;

public:
//! Constructor
HnswSparseStreamerEntity(IndexStreamer::Stats &stats);

Expand Down Expand Up @@ -495,13 +494,11 @@ class HnswSparseStreamerEntity : public HnswSparseEntity {
return 0;
}

private:
HnswSparseStreamerEntity(const HnswSparseStreamerEntity &) = delete;
HnswSparseStreamerEntity &operator=(const HnswSparseStreamerEntity &) =
delete;
static constexpr uint64_t kUpperHashMemoryInflateRatio = 2.0f;

private:
IndexStreamer::Stats &stats_;
HNSWSparseHeader header_{};
std::mutex mutex_{};
Expand Down