-
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 GetLoadState, RefreshLoad, GrantPrivilege and RevokePriv…
…ilege Signed-off-by: Ruichen Bao <ruichen.bao@zju.edu.cn>
- Loading branch information
Showing
7 changed files
with
225 additions
and
2 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,45 @@ | ||
#include "milvus/types/LoadState.h" | ||
|
||
namespace milvus { | ||
|
||
LoadState::LoadState() : code_(LoadStateCode::NotExist) { | ||
UpdateStateDesc(); | ||
} | ||
|
||
LoadState::LoadState(LoadStateCode code) : code_(code) { | ||
UpdateStateDesc(); | ||
} | ||
|
||
LoadStateCode LoadState::GetCode() const { | ||
return code_; | ||
} | ||
|
||
const std::string& LoadState::GetDesc() const { | ||
return state_desc_; | ||
} | ||
|
||
void LoadState::SetCode(LoadStateCode code) { | ||
code_ = code; | ||
UpdateStateDesc(); | ||
} | ||
|
||
void LoadState::UpdateStateDesc() { | ||
switch (code_) { | ||
case LoadStateCode::NotExist: | ||
state_desc_ = "NotExist"; | ||
break; | ||
case LoadStateCode::NotLoad: | ||
state_desc_ = "NotLoad"; | ||
break; | ||
case LoadStateCode::Loading: | ||
state_desc_ = "Loading"; | ||
break; | ||
case LoadStateCode::Loaded: | ||
state_desc_ = "Loaded"; | ||
break; | ||
default: | ||
state_desc_ = "Unknown"; | ||
} | ||
} | ||
|
||
} // 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
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,29 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace milvus { | ||
|
||
enum class LoadStateCode { | ||
NotExist = 0, | ||
NotLoad = 1, | ||
Loading = 2, | ||
Loaded = 3 | ||
}; | ||
|
||
class LoadState { | ||
public: | ||
LoadState(); | ||
explicit LoadState(LoadStateCode code); | ||
|
||
LoadStateCode GetCode() const; | ||
const std::string& GetDesc() const; | ||
void SetCode(LoadStateCode code); | ||
|
||
private: | ||
LoadStateCode code_; | ||
std::string state_desc_; | ||
void UpdateStateDesc(); | ||
}; | ||
|
||
} // namespace milvus |