refactor(server): support update TTL in labels & enhance configs#2938
refactor(server): support update TTL in labels & enhance configs#2938
Conversation
Refactored EdgeLabelBuilder and VertexLabelBuilder to allow updating TTL and TTL start time when appending schema changes. Increased batch limits and write ratio in ServerOptions. Added tests to verify appending TTL to existing vertex and edge labels.
There was a problem hiding this comment.
Pull request overview
This PR refactors the EdgeLabelBuilder and VertexLabelBuilder to fix an issue where TTL (Time-To-Live) and TTL start time could not be updated when appending schema changes. It also increases server batch processing limits and write ratios for improved performance.
Changes:
- Refactored TTL update logic in EdgeLabelBuilder and VertexLabelBuilder to support appending TTL configurations
- Increased batch limits from 500 to 2500 for vertices and edges per batch
- Increased write ratio from 50 to 70 for batch operations
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| VertexLabelBuilder.java | Extracted TTL update logic into updateTTL() method and renamed checkTtl() to checkTTL() |
| EdgeLabelBuilder.java | Extracted TTL update logic into updateTTL() method and renamed checkTtl() to checkTTL() |
| VertexLabelCoreTest.java | Added test for appending TTL to existing vertex label and renamed existing TTL test |
| EdgeLabelCoreTest.java | Added test for appending TTL to existing edge label and renamed existing TTL test |
| ServerOptions.java | Increased MAX_VERTICES_PER_BATCH, MAX_EDGES_PER_BATCH, and MAX_WRITE_RATIO configuration defaults |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java
Show resolved
Hide resolved
...erver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/EdgeLabelBuilder.java
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2938 +/- ##
============================================
- Coverage 39.38% 35.62% -3.77%
+ Complexity 456 333 -123
============================================
Files 812 801 -11
Lines 68660 67523 -1137
Branches 8968 8778 -190
============================================
- Hits 27044 24054 -2990
- Misses 38824 40905 +2081
+ Partials 2792 2564 -228 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Enhanced EdgeLabelBuilder and VertexLabelBuilder to allow explicitly clearing TTL (setting to 0) when appending schema changes. Added corresponding tests to verify TTL reset behavior for both edge and vertex labels.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java
Show resolved
Hide resolved
...erver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/EdgeLabelBuilder.java
Show resolved
Hide resolved
Update EdgeLabelBuilder and VertexLabelBuilder to use nullable Long for TTL and skip TTL update if not set, preventing unintended clearing of existing TTL when appending schema changes. Added tests to verify that appending without specifying TTL does not clear an existing TTL value.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java
Show resolved
Hide resolved
...erver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/EdgeLabelBuilder.java
Show resolved
Hide resolved
...graph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/VertexLabelCoreTest.java
Show resolved
Hide resolved
hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeLabelCoreTest.java
Show resolved
Hide resolved
Enhanced EdgeLabelCoreTest and VertexLabelCoreTest to cover creation and appending of edge and vertex labels with both TTL and ttlStartTime properties. Added assertions to verify that ttlStartTime is set and remains unchanged after appending properties.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...graph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/VertexLabelCoreTest.java
Show resolved
Hide resolved
hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeLabelCoreTest.java
Show resolved
Hide resolved
...ver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java
Show resolved
Hide resolved
...erver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/EdgeLabelBuilder.java
Show resolved
Hide resolved
Added checks in EdgeLabelBuilder and VertexLabelBuilder to ensure ttlStartTime cannot be set if ttl is not specified. This prevents inconsistent schema definitions and enforces correct usage of TTL-related properties.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java
Show resolved
Hide resolved
...erver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/EdgeLabelBuilder.java
Show resolved
Hide resolved
...ver/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java
Show resolved
Hide resolved
Updated project management settings and collaborator list.
Refactored EdgeLabelBuilder and VertexLabelBuilder to allow updating TTL and TTL start time when appending schema changes. Increased batch limits and write ratio in ServerOptions. Added tests to verify appending TTL to existing vertex and edge labels.
Purpose of the PR
Main Changes
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need