Skip to content

refactor(server): support update TTL in labels & enhance configs#2938

Merged
zyxxoo merged 6 commits intomasterfrom
enhance-configs
Jan 22, 2026
Merged

refactor(server): support update TTL in labels & enhance configs#2938
zyxxoo merged 6 commits intomasterfrom
enhance-configs

Conversation

@imbajin
Copy link
Member

@imbajin imbajin commented Jan 14, 2026

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

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • xxx

Does this PR potentially affect the following parts?

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

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.
Copilot AI review requested due to automatic review settings January 14, 2026 10:56
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@dosubot dosubot bot added feature New feature tests Add or improve test cases labels Jan 14, 2026
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 89.13043% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.62%. Comparing base (37be6cd) to head (733edc8).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...e/hugegraph/schema/builder/VertexLabelBuilder.java 84.61% 2 Missing and 2 partials ⚠️
...che/hugegraph/schema/builder/EdgeLabelBuilder.java 94.11% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@imbajin imbajin changed the title refactor: fix update TTL failed & enhance server configs refactor: support update TTL in labels & enhance server configs Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@imbajin imbajin changed the title refactor: support update TTL in labels & enhance server configs refactor(server): support update TTL in labels & enhance configs Jan 14, 2026
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.
@imbajin imbajin requested a review from Copilot January 14, 2026 11:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

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.
@imbajin imbajin requested a review from Copilot January 14, 2026 11:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

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.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Updated project management settings and collaborator list.
@imbajin imbajin requested review from Thespica and zyxxoo January 16, 2026 10:33
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 21, 2026
@zyxxoo zyxxoo merged commit e0f572b into master Jan 22, 2026
14 of 15 checks passed
@zyxxoo zyxxoo deleted the enhance-configs branch January 22, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. tests Add or improve test cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TTL在schema元数据创建后是否可以支持修改?

4 participants