Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nautaa committed Oct 17, 2024
1 parent 7cbb0fa commit e418a5e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/observer/common/type/vector_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class VectorType : public DataType
VectorType() : DataType(AttrType::VECTORS) {}
virtual ~VectorType() {}

int compare(const Value &left, const Value &right) const override {return INT32_MAX; }
int compare(const Value &left, const Value &right) const override { return INT32_MAX; }

RC add(const Value &left, const Value &right, Value &result) const override {return RC::UNIMPLEMENTED; }
RC subtract(const Value &left, const Value &right, Value &result) const override {return RC::UNIMPLEMENTED; }
RC multiply(const Value &left, const Value &right, Value &result) const override {return RC::UNIMPLEMENTED; }
RC add(const Value &left, const Value &right, Value &result) const override { return RC::UNIMPLEMENTED; }
RC subtract(const Value &left, const Value &right, Value &result) const override { return RC::UNIMPLEMENTED; }
RC multiply(const Value &left, const Value &right, Value &result) const override { return RC::UNIMPLEMENTED; }

RC to_string(const Value &val, string &result) const override {return RC::UNIMPLEMENTED; }
RC to_string(const Value &val, string &result) const override { return RC::UNIMPLEMENTED; }
};
14 changes: 10 additions & 4 deletions src/observer/storage/index/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ class Index
Index() = default;
virtual ~Index() = default;

virtual RC create(Table *table, const char *file_name, const IndexMeta &index_meta, const FieldMeta &field_meta) {return RC::UNSUPPORTED; }
virtual RC open(Table *table, const char *file_name, const IndexMeta &index_meta, const FieldMeta &field_meta) {return RC::UNSUPPORTED; }

virtual bool is_vector_index() {return false; }
virtual RC create(Table *table, const char *file_name, const IndexMeta &index_meta, const FieldMeta &field_meta)
{
return RC::UNSUPPORTED;
}
virtual RC open(Table *table, const char *file_name, const IndexMeta &index_meta, const FieldMeta &field_meta)
{
return RC::UNSUPPORTED;
}

virtual bool is_vector_index() { return false; }

const IndexMeta &index_meta() const { return index_meta_; }

Expand Down
14 changes: 7 additions & 7 deletions src/observer/storage/index/ivfflat_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See the Mulan PSL v2 for more details. */
class IvfflatIndex : public Index
{
public:
IvfflatIndex() {};
IvfflatIndex(){};
virtual ~IvfflatIndex() noexcept {};

RC create(Table *table, const char *file_name, const IndexMeta &index_meta, const FieldMeta &field_meta)
Expand All @@ -28,11 +28,11 @@ class IvfflatIndex : public Index
};
RC open(Table *table, const char *file_name, const IndexMeta &index_meta, const FieldMeta &field_meta)
{

return RC::UNIMPLEMENTED;
};

vector<RID> ann_search(const vector<float> &base_vector, size_t limit) {return vector<RID>(); }
vector<RID> ann_search(const vector<float> &base_vector, size_t limit) { return vector<RID>(); }

RC close() { return RC::UNIMPLEMENTED; }

Expand All @@ -42,8 +42,8 @@ class IvfflatIndex : public Index
RC sync() override { return RC::UNIMPLEMENTED; };

private:
bool inited_ = false;
Table * table_ = nullptr;
int lists_ = 1;
int probes_ = 1;
bool inited_ = false;
Table *table_ = nullptr;
int lists_ = 1;
int probes_ = 1;
};

0 comments on commit e418a5e

Please sign in to comment.