mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 02:05:41 +00:00
## What this PR does Removes two unused C++ third-party dependencies from `internal/core` to reduce dependency count, comprehension cost, and link/build surface. ### rapidjson Linked into `milvus_core` but has **zero `#include` usage** in the C++ sources (only a stale comment in `common/Json.h`). knowhere v3.0.3 and milvus-storage do not depend on it. Removes the conan requirement, `find_package(RapidJSON)`, and the link target. ### OpenDAL backend Experimental `ChunkManager` backend gated behind `USE_OPENDAL` (**default OFF**) — released binaries never built it. Removes `OpenDALChunkManager`, the vendored OpenDAL Rust dependency, and all `USE_OPENDAL` build plumbing (Makefile / core_build.sh / 3rdparty_build.sh / CMake). The Go-side `"opendal"` storageType value remains a backward-compatible alias to the standard remote chunk manager. ### Kept `simde` is **not** removed — knowhere v3.0.3 requires it (`find_package(simde REQUIRED)`, used in `src/index/sparse/codec/varintdecode.c`). issue: #50551 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: xiaofanluan <xf@hjjaq.com> Co-authored-by: xiaofanluan <xf@hjjaq.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
145 lines
3.4 KiB
C++
145 lines
3.4 KiB
C++
// Licensed to the LF AI & Data foundation under one
|
|
// or more contributor license agreements. See the NOTICE file
|
|
// distributed with this work for additional information
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
// to you under the Apache License, Version 2.0 (the
|
|
// "License"); you may not use this file except in compliance
|
|
// with the License. You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace milvus::storage {
|
|
|
|
/**
|
|
* @brief This ChunkManager is abstract interface for milvus that
|
|
* used to manager operation and interaction with storage
|
|
*/
|
|
class ChunkManager {
|
|
public:
|
|
/**
|
|
* @brief Whether file exists or not
|
|
* @param filepath
|
|
* @return true
|
|
* @return false
|
|
*/
|
|
virtual bool
|
|
Exist(const std::string& filepath) = 0;
|
|
|
|
/**
|
|
* @brief Get file size
|
|
* @param filepath
|
|
* @return uint64_t
|
|
*/
|
|
virtual uint64_t
|
|
Size(const std::string& filepath) = 0;
|
|
|
|
/**
|
|
* @brief Read file to buffer
|
|
* @param filepath
|
|
* @param buf
|
|
* @param len
|
|
* @return uint64_t
|
|
*/
|
|
virtual uint64_t
|
|
Read(const std::string& filepath, void* buf, uint64_t len) = 0;
|
|
|
|
/**
|
|
* @brief Write buffer to file without offset
|
|
* @param filepath
|
|
* @param buf
|
|
* @param len
|
|
*/
|
|
virtual void
|
|
Write(const std::string& filepath, void* buf, uint64_t len) = 0;
|
|
|
|
/**
|
|
* @brief Read file to buffer with offset
|
|
* @param filepath
|
|
* @param buf
|
|
* @param len
|
|
* @return uint64_t
|
|
*/
|
|
virtual uint64_t
|
|
Read(const std::string& filepath,
|
|
uint64_t offset,
|
|
void* buf,
|
|
uint64_t len) = 0;
|
|
|
|
/**
|
|
* @brief Write buffer to file with offset
|
|
* @param filepath
|
|
* @param buf
|
|
* @param len
|
|
*/
|
|
virtual void
|
|
Write(const std::string& filepath,
|
|
uint64_t offset,
|
|
void* buf,
|
|
uint64_t len) = 0;
|
|
|
|
/**
|
|
* @brief List files with same prefix
|
|
* @param filepath
|
|
* @return std::vector<std::string>
|
|
*/
|
|
virtual std::vector<std::string>
|
|
ListWithPrefix(const std::string& filepath) = 0;
|
|
|
|
/**
|
|
* @brief Remove specified file
|
|
* @param filepath
|
|
*/
|
|
virtual void
|
|
Remove(const std::string& filepath) = 0;
|
|
|
|
/**
|
|
* @brief Get the Name object
|
|
* Used for forming diagnosis messages
|
|
* @return std::string
|
|
*/
|
|
virtual std::string
|
|
GetName() const = 0;
|
|
|
|
/**
|
|
* @brief Get the Root Path
|
|
* @return std::string
|
|
* Note: when join path, please check the training '/'
|
|
*/
|
|
virtual std::string
|
|
GetRootPath() const = 0;
|
|
|
|
/**
|
|
* @brief Get the Bucket Name
|
|
* @return std::string
|
|
*/
|
|
virtual std::string
|
|
GetBucketName() const = 0;
|
|
};
|
|
|
|
using ChunkManagerPtr = std::shared_ptr<ChunkManager>;
|
|
|
|
enum class ChunkManagerType : int8_t {
|
|
None = 0,
|
|
Local = 1,
|
|
Minio = 2,
|
|
Remote = 3,
|
|
};
|
|
|
|
extern std::map<std::string, ChunkManagerType> ChunkManagerType_Map;
|
|
|
|
} // namespace milvus::storage
|