1616
1717#include " milvus/types/SegmentInfo.h"
1818
19+ #include < utility>
20+
1921namespace milvus {
2022
2123SegmentInfo::SegmentInfo (int64_t collection_id, int64_t partition_id, int64_t segment_id, int64_t row_count,
2224 SegmentState state)
25+ : SegmentInfo(collection_id, partition_id, segment_id, row_count, state, " " , SegmentLevel::UNKNOWN, 0 , false ) {
26+ }
27+
28+ SegmentInfo::SegmentInfo (int64_t collection_id, int64_t partition_id, int64_t segment_id, int64_t row_count,
29+ SegmentState state, std::string collection_name, SegmentLevel level, int64_t storage_version,
30+ bool is_sorted)
2331 : collection_id_{collection_id},
2432 partition_id_{partition_id},
2533 segment_id_{segment_id},
2634 row_count_{row_count},
27- state_ (state) {
35+ state_ (state),
36+ collection_name_{std::move (collection_name)},
37+ level_{level},
38+ storage_version_{storage_version},
39+ is_sorted_{is_sorted} {
2840}
2941
3042int64_t
@@ -52,13 +64,43 @@ SegmentInfo::State() const {
5264 return state_;
5365}
5466
67+ const std::string&
68+ SegmentInfo::CollectionName () const {
69+ return collection_name_;
70+ }
71+
72+ SegmentLevel
73+ SegmentInfo::Level () const {
74+ return level_;
75+ }
76+
77+ int64_t
78+ SegmentInfo::StorageVersion () const {
79+ return storage_version_;
80+ }
81+
82+ bool
83+ SegmentInfo::IsSorted () const {
84+ return is_sorted_;
85+ }
86+
5587QuerySegmentInfo::QuerySegmentInfo (int64_t collection_id, int64_t partition_id, int64_t segment_id, int64_t row_count,
5688 SegmentState state, std::string index_name, int64_t index_id,
5789 const std::vector<int64_t >& node_ids)
58- : SegmentInfo(collection_id, partition_id, segment_id, row_count, state),
90+ : QuerySegmentInfo(collection_id, partition_id, segment_id, row_count, state, std::move(index_name), index_id,
91+ node_ids, " " , 0 , SegmentLevel::UNKNOWN, 0 , false ) {
92+ }
93+
94+ QuerySegmentInfo::QuerySegmentInfo (int64_t collection_id, int64_t partition_id, int64_t segment_id, int64_t row_count,
95+ SegmentState state, std::string index_name, int64_t index_id,
96+ const std::vector<int64_t >& node_ids, std::string collection_name, int64_t mem_size,
97+ SegmentLevel level, int64_t storage_version, bool is_sorted)
98+ : SegmentInfo(collection_id, partition_id, segment_id, row_count, state, std::move(collection_name), level,
99+ storage_version, is_sorted),
59100 index_name_{std::move (index_name)},
60101 index_id_{index_id},
61- node_ids_{node_ids} {
102+ node_ids_{node_ids},
103+ mem_size_{mem_size} {
62104}
63105
64106std::string
@@ -84,4 +126,9 @@ QuerySegmentInfo::NodeIDs() const {
84126 return node_ids_;
85127}
86128
129+ int64_t
130+ QuerySegmentInfo::MemSize () const {
131+ return mem_size_;
132+ }
133+
87134} // namespace milvus
0 commit comments