Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ebulk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
ebulk
Commits
04090942
Commit
04090942
authored
Oct 21, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always yes mode for uploads and downloads
parent
9de1e703
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
13 deletions
+37
-13
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/input/fif.rb
...data/embulk-wendelin-dataset-tool/lib/embulk/input/fif.rb
+17
-10
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/input/wendelin.rb
...embulk-wendelin-dataset-tool/lib/embulk/input/wendelin.rb
+20
-3
No files found.
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/input/fif.rb
View file @
04090942
...
...
@@ -60,11 +60,15 @@ module Embulk
if
not
conflicts
.
empty?
puts
@logger
.
warn
(
"Some of your local files already exist in remote dataset."
,
print
=
TRUE
)
@logger
.
warn
(
"You may want to cancel this partial ingestion and download the full dataset to make local changes."
,
print
=
TRUE
)
if
task
[
'always_yes_mode'
]
!=
"true"
@logger
.
warn
(
"You may want to cancel this partial ingestion and download the full dataset to make local changes."
,
print
=
TRUE
)
end
puts
@logger
.
warn
(
"Current ingestion WILL OVERWRITE the following files in remote dataset:"
,
print
=
TRUE
)
puts
"** press key **"
option
=
gets
if
task
[
'always_yes_mode'
]
!=
"true"
puts
"** press key **"
option
=
gets
end
print_short
=
conflicts
.
length
>
500
@dataset_utils
.
showChangesList
(
conflicts
,
""
,
print_short
,
status
=
DatasetUtils
::
OVERWRITE
)
else
...
...
@@ -85,6 +89,7 @@ module Embulk
if
task
[
'chunk_size'
]
==
0
task
[
'chunk_size'
]
=
DatasetUtils
::
CHUNK_SIZE
end
task
[
'always_yes_mode'
]
=
config
.
param
(
'always_yes'
,
:string
)
@data_set
=
task
[
'data_set'
]
@dataset_utils
=
DatasetUtils
.
new
(
""
)
paths
=
config
.
param
(
'path_prefix'
,
:array
)
...
...
@@ -133,7 +138,7 @@ module Embulk
else
if
not
@dataset_utils
.
partialIngestionFileExist
()
@logger
.
info
(
"Checking local dataset..."
,
print
=
TRUE
)
if
not
@dataset_utils
.
reportUpToDate
(
data_stream_dict
,
@data_set
)
if
not
@dataset_utils
.
reportUpToDate
(
data_stream_dict
,
@data_set
)
and
task
[
'always_yes_mode'
]
!=
"true"
puts
@logger
.
error
(
"Your current dataset is outdated. Please, run a download to update it before ingest your changes."
,
print
=
TRUE
)
puts
...
...
@@ -153,12 +158,14 @@ module Embulk
end
self
.
status
(
task
,
push
=
TRUE
)
@logger
.
info
(
"Continue with ingestion? (y/n)"
,
print
=
TRUE
)
option
=
gets
option
=
option
.
chomp
if
option
==
"n"
@logger
.
info
(
"Ingestion cancelled by user."
,
print
=
TRUE
)
@logger
.
abortExecution
()
if
task
[
'always_yes_mode'
]
!=
"true"
@logger
.
info
(
"Continue with ingestion? (y/n)"
,
print
=
TRUE
)
option
=
gets
option
=
option
.
chomp
if
option
==
"n"
@logger
.
info
(
"Ingestion cancelled by user."
,
print
=
TRUE
)
@logger
.
abortExecution
()
end
end
if
not
@dataset_utils
.
reportFileExist
()
@dataset_utils
.
createReportFile
()
...
...
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/input/wendelin.rb
View file @
04090942
...
...
@@ -31,6 +31,14 @@ module Embulk
end
end
def
self
.
alwaysYesDownload
()
@dataset_utils
.
deleteSplitOperationControlFile
()
@dataset_utils
.
deleteSplitOperationFile
()
@dataset_utils
.
deleteCompletedFile
()
@dataset_utils
.
createReportFile
()
@logger
.
info
(
"[always yes mode] Download operation will overwrite previous local dataset."
,
print
=
TRUE
)
end
def
self
.
askUserForAction
(
task
,
action
,
show_message
)
option
=
@dataset_utils
.
getConfiguration
(
action
,
task
[
'tool_dir'
])
valid_option
=
option
!=
DatasetUtils
::
OPTION_ABORT
?
TRUE
:
FALSE
...
...
@@ -104,7 +112,8 @@ module Embulk
'data_set'
=>
@data_set
,
'chunk_size'
=>
DatasetUtils
::
CHUNK_SIZE
+
10
,
'output_path'
=>
@output_path
,
'tool_dir'
=>
@tool_dir
'tool_dir'
=>
@tool_dir
,
'always_yes_mode'
=>
config
.
param
(
'always_yes'
,
:string
)
}
if
task
[
'chunk_size'
]
==
0
task
[
'chunk_size'
]
=
DatasetUtils
::
CHUNK_SIZE
...
...
@@ -158,10 +167,18 @@ module Embulk
task
[
'data_streams'
]
=
@dataset_utils
.
getRemoteFileListForDiscardLocalChanges
(
task
[
'data_streams'
],
@data_set
,
check_changes
=
FALSE
,
changes
=
local_changes
)
else
self
.
askUserForAction
(
task
,
action
=
DatasetUtils
::
OPTION_UPDATE
,
show_message
=
TRUE
)
if
task
[
'always_yes_mode'
]
!=
"true"
self
.
askUserForAction
(
task
,
action
=
DatasetUtils
::
OPTION_UPDATE
,
show_message
=
TRUE
)
else
self
.
alwaysYesDownload
()
end
end
elsif
not
@dataset_utils
.
partialIngestionFileExist
()
self
.
askUserForAction
(
task
,
action
=
DatasetUtils
::
OPTION_RESUME
,
show_message
=
TRUE
)
if
task
[
'always_yes_mode'
]
!=
"true"
self
.
askUserForAction
(
task
,
action
=
DatasetUtils
::
OPTION_RESUME
,
show_message
=
TRUE
)
else
self
.
alwaysYesDownload
()
end
else
if
@dataset_utils
.
discardChangesFileExist
()
puts
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment