-
Notifications
You must be signed in to change notification settings - Fork 137
Parallelize file uploads in fs cp command. #4132
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
Changes from 12 commits
5896ae4
b933398
2fa03e1
d393388
14cfad9
2a9ec1b
179a944
79dd600
2d1f19d
caaff68
12dec5c
2be2174
7db079d
e720670
4029571
6a8077b
1b0ecb2
8d0ede6
4bbbe57
1f331ff
f8bf48a
22da2b3
674fa2e
fdfc0e1
2dc735b
ff6c248
0a96e6a
fddf223
f11edd1
7acce54
ecf7113
7227b83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| localdir/file1.txt -> dbfs:/Volumes/main/default/data/uploaded-dir/file1.txt | ||
| localdir/file2.txt -> dbfs:/Volumes/main/default/data/uploaded-dir/file2.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| mkdir -p localdir | ||
| echo -n "file1 content" > localdir/file1.txt | ||
| echo -n "file2 content" > localdir/file2.txt | ||
|
|
||
| # Recursive directory copy (output sorted for deterministic ordering). | ||
| $CLI fs cp -r localdir dbfs:/Volumes/main/default/data/uploaded-dir 2>&1 | sort | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| Local = true | ||
| Cloud = false | ||
renaudhartert-db marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Ignore = ["localdir"] | ||
|
|
||
| # Recursive copy: localdir/ -> uploaded-dir/. | ||
| [[Server]] | ||
renaudhartert-db marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Pattern = "PUT /api/2.0/fs/directories/Volumes/main/default/data/uploaded-dir" | ||
| Response.StatusCode = 200 | ||
|
|
||
| [[Server]] | ||
| Pattern = "HEAD /api/2.0/fs/directories/Volumes/main/default/data/uploaded-dir" | ||
| Response.StatusCode = 200 | ||
|
|
||
| [[Server]] | ||
| Pattern = "PUT /api/2.0/fs/files/Volumes/main/default/data/uploaded-dir/file1.txt" | ||
| Response.StatusCode = 200 | ||
|
|
||
| [[Server]] | ||
| Pattern = "PUT /api/2.0/fs/files/Volumes/main/default/data/uploaded-dir/file2.txt" | ||
| Response.StatusCode = 200 | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
|
|
||
| >>> [CLI] fs cp local.txt dbfs:/Volumes/main/default/data/mydir/ | ||
| local.txt -> dbfs:/Volumes/main/default/data/mydir/local.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| echo -n "hello world!" > local.txt | ||
renaudhartert-db marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Copy file into a directory (trailing slash indicates directory target). | ||
| trace $CLI fs cp local.txt dbfs:/Volumes/main/default/data/mydir/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| Local = true | ||
| Cloud = false | ||
| Ignore = ["local.txt"] | ||
renaudhartert-db marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Copy file into existing directory: local.txt -> mydir/local.txt. | ||
| [[Server]] | ||
renaudhartert-db marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Pattern = "HEAD /api/2.0/fs/directories/Volumes/main/default/data/mydir" | ||
| Response.StatusCode = 200 | ||
|
|
||
| [[Server]] | ||
| Pattern = "PUT /api/2.0/fs/files/Volumes/main/default/data/mydir/local.txt" | ||
| Response.StatusCode = 200 | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| >>> [CLI] fs cp local.txt dbfs:/Volumes/main/default/data/uploaded.txt | ||
| local.txt -> dbfs:/Volumes/main/default/data/uploaded.txt | ||
|
|
||
| >>> [CLI] fs cp dbfs:/Volumes/main/default/data/remote.txt downloaded.txt | ||
| dbfs:/Volumes/main/default/data/remote.txt -> downloaded.txt | ||
| content from volume |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| echo -n "hello world!" > local.txt | ||
|
|
||
| # Upload local file to volume. | ||
| trace $CLI fs cp local.txt dbfs:/Volumes/main/default/data/uploaded.txt | ||
|
|
||
| # Download file from volume to local. | ||
| trace $CLI fs cp dbfs:/Volumes/main/default/data/remote.txt downloaded.txt | ||
|
|
||
| cat downloaded.txt | ||
renaudhartert-db marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| Local = true | ||
| Cloud = false | ||
| Ignore = ["local.txt", "downloaded.txt"] | ||
|
|
||
| # Upload: local.txt -> dbfs:/Volumes/.../uploaded.txt. | ||
| [[Server]] | ||
renaudhartert-db marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Pattern = "HEAD /api/2.0/fs/directories/Volumes/main/default/data/uploaded.txt" | ||
| Response.StatusCode = 404 | ||
|
|
||
| [[Server]] | ||
| Pattern = "HEAD /api/2.0/fs/files/Volumes/main/default/data/uploaded.txt" | ||
| Response.StatusCode = 404 | ||
|
|
||
| [[Server]] | ||
| Pattern = "HEAD /api/2.0/fs/directories/Volumes/main/default/data" | ||
| Response.StatusCode = 200 | ||
|
|
||
| [[Server]] | ||
| Pattern = "PUT /api/2.0/fs/files/Volumes/main/default/data/uploaded.txt" | ||
| Response.StatusCode = 200 | ||
|
|
||
| # Download: dbfs:/Volumes/.../remote.txt -> downloaded.txt. | ||
| [[Server]] | ||
| Pattern = "HEAD /api/2.0/fs/directories/Volumes/main/default/data/remote.txt" | ||
| Response.StatusCode = 404 | ||
|
|
||
| [[Server]] | ||
| Pattern = "HEAD /api/2.0/fs/files/Volumes/main/default/data/remote.txt" | ||
| Response.StatusCode = 200 | ||
|
|
||
| [[Server]] | ||
| Pattern = "GET /api/2.0/fs/files/Volumes/main/default/data/remote.txt" | ||
| Response.StatusCode = 200 | ||
| Response.Body = "content from volume" | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| >>> errcode [CLI] fs cp src dst --concurrency -1 | ||
| Error: --concurrency must be at least 1 | ||
|
|
||
| Exit code: 1 | ||
|
|
||
| >>> errcode [CLI] fs cp src dst --concurrency 0 | ||
| Error: --concurrency must be at least 1 | ||
|
|
||
| Exit code: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Invalid concurrency values should fail. | ||
| trace errcode $CLI fs cp src dst --concurrency -1 | ||
| trace errcode $CLI fs cp src dst --concurrency 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Local = true | ||
| Cloud = false |
Uh oh!
There was an error while loading. Please reload this page.