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

Refactor schemaManager to support ServerBasedSchemaManager #241

Merged
merged 3 commits into from
Apr 12, 2019
Merged

Refactor schemaManager to support ServerBasedSchemaManager #241

merged 3 commits into from
Apr 12, 2019

Conversation

dangleptr
Copy link
Contributor

@dangleptr dangleptr commented Mar 27, 2019

Refactor schemaManager to support ServerBasedSchemaManager which will be updated by meta client. It is the foundation about SchemaManager on Meta server (#170 )

The main changes include:

  • Split original SchemaManager class into two classes, NebulaSchemaProvider and SchemaManager. Currently, we just leave the static interfaces in SchemaManager.
  • Change all static interfaces and members into non-static. So we could generate many instances of SchemaManager as needs.
  • Readjust some places to use the new SchemaManager.
  • Comment some code in Graph module because @dutor has changed the usage about SchemaManager and StorageClient (Not submit yet).

@nebula-community-bot
Copy link
Member

Unit testing passed.

std::string name_;
nebula::cpp2::ValueType type_;
};
static std::unique_ptr<SchemaManager> instance();
Copy link
Contributor

Choose a reason for hiding this comment

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

A static get or instance often refers to a singleton, here create might be a better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion.

GraphSpaceID space, EdgeType edge, int32_t ver = -1) override;

std::shared_ptr<const SchemaProviderIf> getEdgeSchema(
const folly::StringPiece spaceName,
Copy link
Contributor

@dutor dutor Apr 1, 2019

Choose a reason for hiding this comment

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

folly::Range<const char*>, aka. folly::StringPiece, is already immutable, in terms of it's owner. So it not necessary to make the parameter constant. Besides, it makes little sence to make the parameter constant if it's passed by value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good proposal.

@nebula-community-bot
Copy link
Member

Unit testing failed.

@dangleptr
Copy link
Contributor Author

Jenkins go

@nebula-community-bot
Copy link
Member

Unit testing passed.

darionyaphet
darionyaphet previously approved these changes Apr 10, 2019
@dangleptr
Copy link
Contributor Author

@dutor Please check the changes inside graph module. If there is no problems, i will merge it later.

@nebula-community-bot
Copy link
Member

Unit testing passed.

Copy link
Contributor

@dutor dutor left a comment

Choose a reason for hiding this comment

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

Fabulous!

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dutor dutor merged commit 744dc48 into vesoft-inc:master Apr 12, 2019
@dutor dutor deleted the schemaMan branch April 12, 2019 08:33
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Feb 16, 2020
…c#241)

* Refactor schemaManager to support ServerBasedSchemaManager

* Rebase on master
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
…c#241)

* Refactor schemaManager to support ServerBasedSchemaManager

* Rebase on master
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Mar 21, 2022
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.

4 participants