-
Notifications
You must be signed in to change notification settings - Fork 969
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
cmd/compact: add new compact cmd, used for specific path #4333
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4333 +/- ##
==========================================
+ Coverage 55.82% 56.03% +0.21%
==========================================
Files 153 155 +2
Lines 39733 40024 +291
==========================================
+ Hits 22181 22428 +247
- Misses 15059 15091 +32
- Partials 2493 2505 +12 ☔ View full report in Codecov by Sentry. |
@@ -0,0 +1,111 @@ | |||
/* | |||
* JuiceFS, Copyright 2020 Juicedata, Inc. |
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.
2024
) | ||
|
||
func GetInode(path string) (uint64, error) { | ||
dpath, err := filepath.Abs(path) |
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.
Is this necessary?
@@ -249,9 +249,9 @@ func (m *dbMeta) Setlk(ctx Context, inode Ino, owner_ uint64, block bool, ltype | |||
return err | |||
} | |||
|
|||
func (r *dbMeta) ListLocks(ctx context.Context, inode Ino) ([]PLockItem, []FLockItem, error) { | |||
func (m *dbMeta) ListLocks(ctx context.Context, inode Ino) ([]PLockItem, []FLockItem, error) { |
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.
We can move these into another PR.
$ juicefs compact --path /mnt/jfs/foo redis://localhost | ||
|
||
# max depth of 5 | ||
$ juicefs summary --path /mnt/jfs/foo --depth 5 /mnt/jfs/foo redis://localhost |
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.
remove this
Description: ` | ||
Examples: | ||
# compact with path | ||
$ juicefs compact --path /mnt/jfs/foo redis://localhost |
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.
We usually need either META-URL or mount point, not both.
compact
could be a tool used by end-user (not admin), so a mountpoint will be easier. The end-user may don't have the secret in META-URL.
// new meta client | ||
metaConf := meta.DefaultConf() | ||
metaConf.MaxDeletes = int(deleteConcurrency) | ||
client := meta.NewClient(metaUri, metaConf) |
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.
close #4303