Skip to content

Commit

Permalink
fixed priorities
Browse files Browse the repository at this point in the history
  • Loading branch information
ItamarYuran committed Oct 14, 2024
1 parent c76c458 commit 665c8e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
7 changes: 2 additions & 5 deletions cmd/lakectl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ const (
parallelismFlagName = "parallelism"
noProgressBarFlagName = "no-progress"

defaultParallelismConfig = -1
defaultSyncParallelism = 25
defaultParallelismConfig = 25
defaultSyncParallelism = 0
defaultSyncPresign = true
defaultNoProgress = false

Expand Down Expand Up @@ -246,9 +246,6 @@ func getNoProgressMode(cmd *cobra.Command) bool {

func getSyncFlags(cmd *cobra.Command, client *apigen.ClientWithResponses) local.SyncFlags {
parallelism := Must(cmd.Flags().GetInt(parallelismFlagName))
if parallelism < 1 {
DieFmt("Invalid value for parallelism (%d), minimum is 1.\n", parallelism)
}

presignMode := getPresignMode(cmd, client)
return local.SyncFlags{
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,7 @@ lakectl fs download <path URI> [<destination path>] [flags]
```
-h, --help help for download
--no-progress Disable progress bar animation for IO operations
-p, --parallelism int Max concurrent operations to perform (default 25)
-p, --parallelism int Max concurrent operations to perform
--part-size int part size in bytes for multipart download (default 8388608)
--pre-sign Use pre-signed URLs when downloading/uploading data (recommended) (default true)
-r, --recursive recursively download all objects under path
Expand Down Expand Up @@ -1850,7 +1850,7 @@ lakectl fs upload <path URI> [flags]
--content-type string MIME type of contents
-h, --help help for upload
--no-progress Disable progress bar animation for IO operations
-p, --parallelism int Max concurrent operations to perform (default 25)
-p, --parallelism int Max concurrent operations to perform
--pre-sign Use pre-signed URLs when downloading/uploading data (recommended) (default true)
-r, --recursive recursively copy all files under local source
-s, --source string local file to upload, or "-" for stdin
Expand Down Expand Up @@ -2141,7 +2141,7 @@ lakectl local checkout [directory] [flags]
--all Checkout given source branch or reference for all linked directories
-h, --help help for checkout
--no-progress Disable progress bar animation for IO operations
-p, --parallelism int Max concurrent operations to perform (default 25)
-p, --parallelism int Max concurrent operations to perform
--pre-sign Use pre-signed URLs when downloading/uploading data (recommended) (default true)
-r, --ref string Checkout the given reference
-y, --yes Automatically say yes to all confirmations
Expand All @@ -2164,7 +2164,7 @@ lakectl local clone <path URI> [directory] [flags]
--gitignore Update .gitignore file when working in a git repository context (default true)
-h, --help help for clone
--no-progress Disable progress bar animation for IO operations
-p, --parallelism int Max concurrent operations to perform (default 25)
-p, --parallelism int Max concurrent operations to perform
--pre-sign Use pre-signed URLs when downloading/uploading data (recommended) (default true)
```

Expand All @@ -2188,7 +2188,7 @@ lakectl local commit [directory] [flags]
-m, --message string commit message
--meta strings key value pair in the form of key=value
--no-progress Disable progress bar animation for IO operations
-p, --parallelism int Max concurrent operations to perform (default 25)
-p, --parallelism int Max concurrent operations to perform
--pre-sign Use pre-signed URLs when downloading/uploading data (recommended) (default true)
```

Expand Down Expand Up @@ -2268,7 +2268,7 @@ lakectl local pull [directory] [flags]
--force Reset any uncommitted local change
-h, --help help for pull
--no-progress Disable progress bar animation for IO operations
-p, --parallelism int Max concurrent operations to perform (default 25)
-p, --parallelism int Max concurrent operations to perform
--pre-sign Use pre-signed URLs when downloading/uploading data (recommended) (default true)
```

Expand Down
8 changes: 4 additions & 4 deletions pkg/local/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ func (s *SyncManager) Sync(rootPath string, remote *uri.URI, changeSet <-chan *C
defer s.progressBar.Stop()

wg, ctx := errgroup.WithContext(s.ctx)
parallelismToUse := s.cfg.Parallelism
if parallelismToUse <= 0 {
parallelismToUse = s.cfg.SyncFlags.Parallelism
parallelism := s.cfg.Parallelism
if s.cfg.SyncFlags.Parallelism > 0 {
parallelism = s.cfg.SyncFlags.Parallelism
}
for i := 0; i < parallelismToUse; i++ {
for i := 0; i < parallelism; i++ {
wg.Go(func() error {
for change := range changeSet {
if err := s.apply(ctx, rootPath, remote, change); err != nil {
Expand Down

0 comments on commit 665c8e1

Please sign in to comment.