Skip to content
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

Improve the name mechanism of vineyard objects. #2010

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dashanji
Copy link
Member

What do these changes do?

  • Make sure one name is associated with one vineyard object.
  • Fix the name can't be all digits.
  • Support delete vineyard object by name.

Related issue number

Fixes #2003

* Make sure one name is associated with one vineyard object.
* Fix the name can't be all digits.
* Support delete vineyard object by name.

Signed-off-by: Ye Cao <[email protected]>
@@ -57,6 +57,14 @@ namespace vineyard {
} while (0)
#endif // ENSURE_VINEYARDD_READY

// Helper function to adjust the name if it's all digits.
std::string AdjustName(const std::string& name) {
if (std::regex_match(name, std::regex("[0-9]+$"))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// as the nlohmann/json can't convert '/names/1234: 12345' to 'names:{"1234",
// "12345"}'
std::string new_name = AdjustName(name);
std::cout << "new_name is: " << new_name << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove those debugging logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

name不是数据对象的唯一标识问题
2 participants