-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: explicitly specify column groups for storage v2 api #39790
Open
shaoting-huang
wants to merge
1
commit into
milvus-io:master
Choose a base branch
from
shaoting-huang:storagev2_api
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+686
−106
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// 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. | ||
|
||
#include "segcore/arrow_fs_c.h" | ||
#include "milvus-storage/filesystem/fs.h" | ||
#include "common/EasyAssert.h" | ||
#include "common/type_c.h" | ||
|
||
CStatus | ||
InitLocalArrowFileSystemSingleton(const char* c_path) { | ||
try { | ||
std::string path(c_path); | ||
milvus_storage::ArrowFileSystemConfig conf; | ||
conf.root_path = path; | ||
conf.storage_type = "local"; | ||
milvus_storage::ArrowFileSystemSingleton::GetInstance().Init(conf); | ||
|
||
return milvus::SuccessCStatus(); | ||
} catch (std::exception& e) { | ||
return milvus::FailureCStatus(&e); | ||
} | ||
} | ||
|
||
void | ||
CleanLocalArrowFileSystemSingleton() { | ||
milvus_storage::ArrowFileSystemSingleton::GetInstance().Release(); | ||
} | ||
Comment on lines
+38
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to have two separate CleanXXX functions |
||
|
||
CStatus | ||
InitRemoteArrowFileSystemSingleton(CStorageConfig c_storage_config) { | ||
try { | ||
milvus_storage::ArrowFileSystemConfig conf; | ||
conf.address = std::string(c_storage_config.address); | ||
conf.bucket_name = std::string(c_storage_config.bucket_name); | ||
conf.access_key_id = std::string(c_storage_config.access_key_id); | ||
conf.access_key_value = std::string(c_storage_config.access_key_value); | ||
conf.root_path = std::string(c_storage_config.root_path); | ||
conf.storage_type = std::string(c_storage_config.storage_type); | ||
conf.cloud_provider = std::string(c_storage_config.cloud_provider); | ||
conf.iam_endpoint = std::string(c_storage_config.iam_endpoint); | ||
conf.log_level = std::string(c_storage_config.log_level); | ||
conf.region = std::string(c_storage_config.region); | ||
conf.useSSL = c_storage_config.useSSL; | ||
conf.sslCACert = std::string(c_storage_config.sslCACert); | ||
conf.useIAM = c_storage_config.useIAM; | ||
conf.useVirtualHost = c_storage_config.useVirtualHost; | ||
conf.requestTimeoutMs = c_storage_config.requestTimeoutMs; | ||
conf.gcp_credential_json = std::string(c_storage_config.gcp_credential_json); | ||
conf.use_custom_part_upload = c_storage_config.use_custom_part_upload; | ||
milvus_storage::ArrowFileSystemSingleton::GetInstance().Init(conf); | ||
|
||
return milvus::SuccessCStatus(); | ||
} catch (std::exception& e) { | ||
return milvus::FailureCStatus(&e); | ||
} | ||
} | ||
|
||
void | ||
CleanRemoteArrowFileSystemSingleton() { | ||
milvus_storage::ArrowFileSystemSingleton::GetInstance().Release(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// 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 "common/type_c.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
CStatus | ||
InitLocalArrowFileSystemSingleton(const char* c_path); | ||
|
||
void | ||
CleanLocalArrowFileSystemSingleton(); | ||
|
||
CStatus | ||
InitRemoteArrowFileSystemSingleton(CStorageConfig c_storage_config); | ||
|
||
void | ||
CleanRemoteArrowFileSystemSingleton(); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2025 Zilliz | ||
// | ||
// Licensed 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. | ||
|
||
#include "segcore/column_groups_c.h" | ||
#include <vector> | ||
#include <string> | ||
#include <memory> | ||
|
||
using VecVecInt = std::vector<std::vector<int>>; | ||
|
||
extern "C" { | ||
|
||
CColumnGroups NewCColumnGroups() { | ||
auto vv = std::make_unique<VecVecInt>(); | ||
return vv.release(); | ||
} | ||
|
||
void AddCColumnGroup(CColumnGroups cgs, int* group, int group_size) { | ||
if (!cgs || !group) | ||
return; | ||
|
||
auto vv = static_cast<VecVecInt*>(cgs); | ||
std::vector<int> new_group(group, group + group_size); | ||
vv->emplace_back(std::move(new_group)); | ||
} | ||
|
||
int CColumnGroupsSize(CColumnGroups cgs) { | ||
if (!cgs) | ||
return 0; | ||
|
||
auto vv = static_cast<VecVecInt*>(cgs); | ||
return static_cast<int>(vv->size()); | ||
} | ||
|
||
void FreeCColumnGroups(CColumnGroups cgs) { delete static_cast<VecVecInt*>(cgs); } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2025 Zilliz | ||
// | ||
// Licensed 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 <stdint.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef void* CColumnGroups; | ||
|
||
CColumnGroups NewCColumnGroups(); | ||
|
||
void AddCColumnGroup(CColumnGroups cgs, int* group, int group_size); | ||
|
||
int CColumnGroupsSize(CColumnGroups cgs); | ||
|
||
void FreeCColumnGroups(CColumnGroups cgs); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any chance that
use_custom_part_upload
can be false? We can remove it from StorageConfig if it is actually not configurable.