-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: add Compact, CreateResourceGroup, DropResourceGroup, Describ…
…eResourceGroup, ListResourceGroups and UpdateResourceGroup Signed-off-by: Ruichen Bao <ruichen.bao@zju.edu.cn>
- Loading branch information
Showing
11 changed files
with
473 additions
and
0 deletions.
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
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
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,16 @@ | ||
#include "milvus/types/NodeInfo.h" | ||
|
||
NodeInfo::NodeInfo(int64_t id, const std::string& addr, const std::string& host) | ||
: node_id(id), address(addr), hostname(host) {} | ||
|
||
int64_t NodeInfo::GetNodeId() const { | ||
return node_id; | ||
} | ||
|
||
const std::string& NodeInfo::GetAddress() const { | ||
return address; | ||
} | ||
|
||
const std::string& NodeInfo::GetHostname() const { | ||
return hostname; | ||
} |
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,52 @@ | ||
#include "milvus/types/ResourceGroupConfig.h" | ||
|
||
namespace milvus { | ||
|
||
ResourceGroupConfig::ResourceGroupConfig(int req_node_num, int lim_node_num, | ||
const std::vector<std::string>& from, | ||
const std::vector<std::string>& to, | ||
const std::vector<std::pair<std::string, std::string>>& labels) | ||
: requests_node_num(req_node_num), limits_node_num(lim_node_num), | ||
transfer_from(from), transfer_to(to), node_labels(labels) {} | ||
|
||
int ResourceGroupConfig::GetRequestsNodeNum() const { | ||
return requests_node_num; | ||
} | ||
|
||
void ResourceGroupConfig::SetRequestsNodeNum(int num) { | ||
requests_node_num = num; | ||
} | ||
|
||
int ResourceGroupConfig::GetLimitsNodeNum() const { | ||
return limits_node_num; | ||
} | ||
|
||
void ResourceGroupConfig::SetLimitsNodeNum(int num) { | ||
limits_node_num = num; | ||
} | ||
|
||
const std::vector<std::string>& ResourceGroupConfig::GetTransferFrom() const { | ||
return transfer_from; | ||
} | ||
|
||
void ResourceGroupConfig::SetTransferFrom(const std::vector<std::string>& from) { | ||
transfer_from = from; | ||
} | ||
|
||
const std::vector<std::string>& ResourceGroupConfig::GetTransferTo() const { | ||
return transfer_to; | ||
} | ||
|
||
void ResourceGroupConfig::SetTransferTo(const std::vector<std::string>& to) { | ||
transfer_to = to; | ||
} | ||
|
||
const std::vector<std::pair<std::string, std::string>>& ResourceGroupConfig::GetNodeLabels() const { | ||
return node_labels; | ||
} | ||
|
||
void ResourceGroupConfig::SetNodeLabels(const std::vector<std::pair<std::string, std::string>>& labels) { | ||
node_labels = labels; | ||
} | ||
|
||
} // namespace milvus |
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 @@ | ||
#include "milvus/types/ResourceGroupDesc.h" | ||
|
||
namespace milvus { | ||
|
||
ResourceGroupDesc::ResourceGroupDesc(const std::string& name, int32_t capacity, int32_t available_nodes, | ||
const std::map<std::string, int32_t>& loaded_replicas, | ||
const std::map<std::string, int32_t>& outgoing_nodes, | ||
const std::map<std::string, int32_t>& incoming_nodes, | ||
const ResourceGroupConfig& config, | ||
const std::vector<NodeInfo>& nodes) | ||
: name(name), capacity(capacity), num_available_node(available_nodes), | ||
num_loaded_replica(loaded_replicas), num_outgoing_node(outgoing_nodes), | ||
num_incoming_node(incoming_nodes), config(config), nodes(nodes) {} | ||
|
||
const std::string& ResourceGroupDesc::GetName() const { | ||
return name; | ||
} | ||
|
||
int32_t ResourceGroupDesc::GetCapacity() const { | ||
return capacity; | ||
} | ||
|
||
int32_t ResourceGroupDesc::GetNumAvailableNode() const { | ||
return num_available_node; | ||
} | ||
|
||
const std::map<std::string, int32_t>& ResourceGroupDesc::GetNumLoadedReplica() const { | ||
return num_loaded_replica; | ||
} | ||
|
||
const std::map<std::string, int32_t>& ResourceGroupDesc::GetNumOutgoingNode() const { | ||
return num_outgoing_node; | ||
} | ||
|
||
const std::map<std::string, int32_t>& ResourceGroupDesc::GetNumIncomingNode() const { | ||
return num_incoming_node; | ||
} | ||
|
||
const ResourceGroupConfig& ResourceGroupDesc::GetConfig() const { | ||
return config; | ||
} | ||
|
||
const std::vector<NodeInfo>& ResourceGroupDesc::GetNodes() const { | ||
return nodes; | ||
} | ||
|
||
} // namespace milvus |
Oops, something went wrong.