Commit 2cb6a5d1 authored by Heisenberg's avatar Heisenberg
Browse files

Merge branch 'branch-0.5.0' into fix_thermal_bug


Former-commit-id: 1331a3e2e91d73bf11f28ce8a0d35cf8e98015a1
parents cf84c731 a594ab9a
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -105,13 +105,20 @@ please reinstall CMake with curl:
   ```

##### code format and linting

Install clang-format and clang-tidy
```shell
CentOS 7:   
$ yum install clang
Ubuntu 16.04 or 18.04: 
$ sudo apt-get install clang-format clang-tidy
    
Ubuntu 16.04: 
$ sudo apt-get install clang-tidy
$ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
$ sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
$ sudo apt-get update
$ sudo apt-get install clang-format-6.0
Ubuntu 18.04: 
$ sudo apt-get install clang-tidy clang-format
```  
```shell
$ ./build.sh -l
```

@@ -122,13 +129,14 @@ $ ./build.sh -u
```

##### Run code coverage

Install lcov
```shell
CentOS 7:   
$ yum install lcov
Ubuntu 16.04 or 18.04: 
$ sudo apt-get install lcov
    
``` 
```shell  
$ ./build.sh -u -c
```

+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#include <faiss/IndexIVFPQ.h>
#include <faiss/gpu/GpuAutoTune.h>
#include <faiss/gpu/GpuIndexIVFPQ.h>
#include <memory>
+2 −1
Original line number Diff line number Diff line
@@ -296,7 +296,8 @@ DBImpl::CreateIndex(const std::string& table_id, const TableIndex& index) {
    std::vector<int> file_types;
    if (index.engine_type_ == static_cast<int32_t>(EngineType::FAISS_IDMAP)) {
        file_types = {
            static_cast<int32_t>(meta::TableFileSchema::NEW), static_cast<int32_t>(meta::TableFileSchema::NEW_MERGE),
            static_cast<int32_t>(meta::TableFileSchema::NEW),
            static_cast<int32_t>(meta::TableFileSchema::NEW_MERGE),
        };
    } else {
        file_types = {
+3 −3
Original line number Diff line number Diff line
@@ -55,9 +55,9 @@ MemTableFile::CreateTableFile() {
Status
MemTableFile::Add(const VectorSourcePtr& source, IDNumbers& vector_ids) {
    if (table_file_schema_.dimension_ <= 0) {
        std::string err_msg = "MemTableFile::Add: table_file_schema dimension = " +
                              std::to_string(table_file_schema_.dimension_) + ", table_id = " +
                              table_file_schema_.table_id_;
        std::string err_msg =
            "MemTableFile::Add: table_file_schema dimension = " + std::to_string(table_file_schema_.dimension_) +
            ", table_id = " + table_file_schema_.table_id_;
        ENGINE_LOG_ERROR << err_msg;
        return Status(DB_ERROR, "Not able to create table file");
    }
+12 −9
Original line number Diff line number Diff line
@@ -148,14 +148,17 @@ static const MetaSchema TABLES_SCHEMA(META_TABLES, {
                                                   });

// TableFiles schema
static const MetaSchema TABLEFILES_SCHEMA(
    META_TABLEFILES,
    {
        MetaField("id", "BIGINT", "PRIMARY KEY AUTO_INCREMENT"), MetaField("table_id", "VARCHAR(255)", "NOT NULL"),
        MetaField("engine_type", "INT", "DEFAULT 1 NOT NULL"), MetaField("file_id", "VARCHAR(255)", "NOT NULL"),
        MetaField("file_type", "INT", "DEFAULT 0 NOT NULL"), MetaField("file_size", "BIGINT", "DEFAULT 0 NOT NULL"),
        MetaField("row_count", "BIGINT", "DEFAULT 0 NOT NULL"), MetaField("updated_time", "BIGINT", "NOT NULL"),
        MetaField("created_on", "BIGINT", "NOT NULL"), MetaField("date", "INT", "DEFAULT -1 NOT NULL"),
static const MetaSchema TABLEFILES_SCHEMA(META_TABLEFILES, {
                                                               MetaField("id", "BIGINT", "PRIMARY KEY AUTO_INCREMENT"),
                                                               MetaField("table_id", "VARCHAR(255)", "NOT NULL"),
                                                               MetaField("engine_type", "INT", "DEFAULT 1 NOT NULL"),
                                                               MetaField("file_id", "VARCHAR(255)", "NOT NULL"),
                                                               MetaField("file_type", "INT", "DEFAULT 0 NOT NULL"),
                                                               MetaField("file_size", "BIGINT", "DEFAULT 0 NOT NULL"),
                                                               MetaField("row_count", "BIGINT", "DEFAULT 0 NOT NULL"),
                                                               MetaField("updated_time", "BIGINT", "NOT NULL"),
                                                               MetaField("created_on", "BIGINT", "NOT NULL"),
                                                               MetaField("date", "INT", "DEFAULT -1 NOT NULL"),
                                                           });

}  // namespace
Loading