-
Notifications
You must be signed in to change notification settings - Fork 525
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
Add graphs.enable_dynamic_create_drop
option
#1809
Conversation
CLA Assistant Lite bot Good! All Contributors have signed the CLA. |
|
I have read the CLA Document and I hereby sign the CLA |
"dynamic_create_graph", | ||
"Whether to create graph dynamically", | ||
disallowEmpty(), | ||
true |
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.
Thank you for your contribution.
Not sure in what scenario the option needs to be turned off?
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.
Hi @javeme , thanks for your reply, I am worried that my online stable graph instance will be dropped by misoperation.
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.
Get it, sounds make sense
Codecov Report
@@ Coverage Diff @@
## master #1809 +/- ##
============================================
+ Coverage 66.93% 68.90% +1.97%
+ Complexity 980 692 -288
============================================
Files 446 446
Lines 37781 37787 +6
Branches 5380 5380
============================================
+ Hits 25289 26038 +749
+ Misses 9768 9082 -686
+ Partials 2724 2667 -57
Continue to review full report at Codecov.
|
hugegraph-api/src/main/java/com/baidu/hugegraph/config/ServerOptions.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/com/baidu/hugegraph/config/ServerOptions.java
Outdated
Show resolved
Hide resolved
"dynamic_create_graph", | ||
"Whether to create graph dynamically", | ||
disallowEmpty(), | ||
true |
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.
Get it, sounds make sense
hugegraph-api/src/main/java/com/baidu/hugegraph/core/GraphManager.java
Outdated
Show resolved
Hide resolved
@@ -157,6 +159,10 @@ public HugeGraph cloneGraph(String name, String newName, | |||
} | |||
|
|||
public HugeGraph createGraph(String name, String configText) { | |||
E.checkArgument(hugeConfig.get(ServerOptions.ENABLE_DYNAMIC_CREATE_DROP), | |||
"Not allowed to create graph dynamically, " + | |||
"please set `enable_dynamic_create_drop` to true.", |
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.
align with ""Not allowed..."
E.checkArgument(hugeConfig.get(ServerOptions.ENABLE_DYNAMIC_CREATE_DROP), | ||
"Not allowed to create graph dynamically, " + | ||
"please set `enable_dynamic_create_drop` to true.", | ||
name); |
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.
need to fill graph name parameter: "Not allowed to create graph dynamically: '%s', "?
@@ -171,6 +177,10 @@ public HugeGraph createGraph(String name, String configText) { | |||
|
|||
public void dropGraph(String name) { | |||
HugeGraph graph = this.graph(name); | |||
E.checkArgument(hugeConfig.get(ServerOptions.ENABLE_DYNAMIC_CREATE_DROP), | |||
"Not allowed to drop graph dynamically, " + | |||
"please set `enable_dynamic_create_drop` to true.", |
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.
align with ""Not allowed..."
E.checkArgument(hugeConfig.get(ServerOptions.ENABLE_DYNAMIC_CREATE_DROP), | ||
"Not allowed to drop graph dynamically, " + | ||
"please set `enable_dynamic_create_drop` to true.", | ||
name); |
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.
ditto
@@ -157,6 +159,10 @@ public HugeGraph cloneGraph(String name, String newName, | |||
} | |||
|
|||
public HugeGraph createGraph(String name, String configText) { | |||
E.checkArgument(hugeConfig.get(ServerOptions.ENABLE_DYNAMIC_CREATE_DROP), |
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.
can rename hugeConfig to conf, and expect 'this.xx' prefix style for member access: "this.conf"
DYNAMIC_CREATE_GRAPH
optiongraphs.enable_dynamic_create_drop
option
closed #1808