-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
lightning: add ExternalEngineConfig to create an external engine #46636
Conversation
Signed-off-by: lance6716 <lance6716@gmail.com>
Hi @lance6716. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #46636 +/- ##
================================================
- Coverage 73.2843% 72.6918% -0.5925%
================================================
Files 1319 1340 +21
Lines 395850 402517 +6667
================================================
+ Hits 290096 292597 +2501
- Misses 87263 91387 +4124
- Partials 18491 18533 +42
Flags with carried forward coverage won't be shown. Click here to find out more.
|
} | ||
}() | ||
go func() { | ||
err2 := local.CloseEngine( |
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.
this is the expected usage
Signed-off-by: lance6716 <lance6716@gmail.com>
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.
Rest LGTM
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
@@ -177,13 +185,13 @@ func (e *Engine) createMergeIter(ctx context.Context, start kv.Key) (*MergeKVIte | |||
return iter, nil | |||
} | |||
|
|||
// KVStatistics returns the total kv size and total kv length. | |||
// KVStatistics returns the total kv size and total kv count. | |||
func (e *Engine) KVStatistics() (totalKVSize int64, totalKVLength int64) { |
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.
func (e *Engine) KVStatistics() (totalKVSize int64, totalKVLength int64) { | |
func (e *Engine) KVStatistics() (totalKVSize int64, totalKVCount int64) { |
allEngines := local.lockAllEnginesUnless(importMutexStateClose, 0) | ||
allEngines := make([]common.Engine, 0, 8) | ||
for _, e := range local.externalEngine { | ||
allEngines = append(allEngines, e) |
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.
Why not close it directly?
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.
file, err := os.Create(filepath.Join(l.base, name)) | ||
filename := filepath.Join(l.base, name) | ||
dir := filepath.Dir(filename) | ||
err := os.MkdirAll(dir, 0750) |
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.
Why do you change it?
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.
in other storage backend like s3, name can contain /
. But LocalStorage will raise error. I found it when using LocalStorage in the unit tests of this PR
Signed-off-by: lance6716 <lance6716@gmail.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tangenta, wjhuang2016 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/retest |
@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: lance6716 <lance6716@gmail.com>
/retest |
@lance6716: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
@lance6716: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
What problem does this PR solve?
Issue Number: ref #45719
Problem Summary:
What is changed and how it works?
Add ExternalEngineConfig. local backend CloseEngine will use ExternalEngineConfig to create an external engine, and then local backend can import it with the UUID.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.