diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_algorithm.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_algorithm.h index 5a7093f..c4cf72c 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_algorithm.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_algorithm.h @@ -25,9 +25,8 @@ namespace core { //! hnsw graph algorithm implement class HnswSparseAlgorithm { public: - typedef std::unique_ptr UPointer; + using UPointer = std::unique_ptr; - public: //! Constructor explicit HnswSparseAlgorithm(HnswSparseEntity &entity); @@ -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}; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h index 35c45cc..635d786 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h @@ -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, diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h index a026989..200b3e9 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h @@ -34,7 +34,7 @@ using SparseChunk = IndexStorage::Segment; class SparseChunkBroker { public: - typedef std::shared_ptr Pointer; + using Pointer = std::shared_ptr; enum CHUNK_TYPE { CHUNK_TYPE_HEADER = 1, @@ -127,7 +127,6 @@ class SparseChunkBroker { ailego::StringHelper::ToString(seq_id); } - private: IndexStreamer::Stats &stats_; HnswSparseChunkMeta chunk_meta_{}; size_t page_mask_{0UL}; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h index 0f269a5..c232d09 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h @@ -24,7 +24,6 @@ class HnswSparseSearcher : public IndexSearcher { public: using ContextPointer = IndexSearcher::Context::Pointer; - public: HnswSparseSearcher(void); virtual ~HnswSparseSearcher(void); @@ -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_{}; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.h index 2a14149..d1105be 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.h @@ -24,7 +24,6 @@ class HnswSparseSearcherEntity : public HnswSparseEntity { using Pointer = std::shared_ptr; using SegmentPointer = IndexStorage::Segment::Pointer; - public: struct SegmentGroupParam { SegmentGroupParam(SegmentPointer neighbors_in, SegmentPointer neighbors_meta_in, @@ -105,7 +104,6 @@ class HnswSparseSearcherEntity : public HnswSparseEntity { virtual int cleanup(void) override; - public: bool is_loaded() const { return loaded_; } diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h index fa2712b..c752342 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h @@ -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: diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h index 84087af..fcef695 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h @@ -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); @@ -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_{};