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
Show 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
...
@@ -60,11 +60,15 @@ module Embulk
if
not
conflicts
.
empty?
if
not
conflicts
.
empty?
puts
puts
@logger
.
warn
(
"Some of your local files already exist in remote dataset."
,
print
=
TRUE
)
@logger
.
warn
(
"Some of your local files already exist in remote dataset."
,
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
)
@logger
.
warn
(
"You may want to cancel this partial ingestion and download the full dataset to make local changes."
,
print
=
TRUE
)
end
puts
puts
@logger
.
warn
(
"Current ingestion WILL OVERWRITE the following files in remote dataset:"
,
print
=
TRUE
)
@logger
.
warn
(
"Current ingestion WILL OVERWRITE the following files in remote dataset:"
,
print
=
TRUE
)
if
task
[
'always_yes_mode'
]
!=
"true"
puts
"** press key **"
puts
"** press key **"
option
=
gets
option
=
gets
end
print_short
=
conflicts
.
length
>
500
print_short
=
conflicts
.
length
>
500
@dataset_utils
.
showChangesList
(
conflicts
,
""
,
print_short
,
status
=
DatasetUtils
::
OVERWRITE
)
@dataset_utils
.
showChangesList
(
conflicts
,
""
,
print_short
,
status
=
DatasetUtils
::
OVERWRITE
)
else
else
...
@@ -85,6 +89,7 @@ module Embulk
...
@@ -85,6 +89,7 @@ module Embulk
if
task
[
'chunk_size'
]
==
0
if
task
[
'chunk_size'
]
==
0
task
[
'chunk_size'
]
=
DatasetUtils
::
CHUNK_SIZE
task
[
'chunk_size'
]
=
DatasetUtils
::
CHUNK_SIZE
end
end
task
[
'always_yes_mode'
]
=
config
.
param
(
'always_yes'
,
:string
)
@data_set
=
task
[
'data_set'
]
@data_set
=
task
[
'data_set'
]
@dataset_utils
=
DatasetUtils
.
new
(
""
)
@dataset_utils
=
DatasetUtils
.
new
(
""
)
paths
=
config
.
param
(
'path_prefix'
,
:array
)
paths
=
config
.
param
(
'path_prefix'
,
:array
)
...
@@ -133,7 +138,7 @@ module Embulk
...
@@ -133,7 +138,7 @@ module Embulk
else
else
if
not
@dataset_utils
.
partialIngestionFileExist
()
if
not
@dataset_utils
.
partialIngestionFileExist
()
@logger
.
info
(
"Checking local dataset..."
,
print
=
TRUE
)
@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
puts
@logger
.
error
(
"Your current dataset is outdated. Please, run a download to update it before ingest your changes."
,
print
=
TRUE
)
@logger
.
error
(
"Your current dataset is outdated. Please, run a download to update it before ingest your changes."
,
print
=
TRUE
)
puts
puts
...
@@ -153,6 +158,7 @@ module Embulk
...
@@ -153,6 +158,7 @@ module Embulk
end
end
self
.
status
(
task
,
push
=
TRUE
)
self
.
status
(
task
,
push
=
TRUE
)
if
task
[
'always_yes_mode'
]
!=
"true"
@logger
.
info
(
"Continue with ingestion? (y/n)"
,
print
=
TRUE
)
@logger
.
info
(
"Continue with ingestion? (y/n)"
,
print
=
TRUE
)
option
=
gets
option
=
gets
option
=
option
.
chomp
option
=
option
.
chomp
...
@@ -160,6 +166,7 @@ module Embulk
...
@@ -160,6 +166,7 @@ module Embulk
@logger
.
info
(
"Ingestion cancelled by user."
,
print
=
TRUE
)
@logger
.
info
(
"Ingestion cancelled by user."
,
print
=
TRUE
)
@logger
.
abortExecution
()
@logger
.
abortExecution
()
end
end
end
if
not
@dataset_utils
.
reportFileExist
()
if
not
@dataset_utils
.
reportFileExist
()
@dataset_utils
.
createReportFile
()
@dataset_utils
.
createReportFile
()
end
end
...
...
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/input/wendelin.rb
View file @
04090942
...
@@ -31,6 +31,14 @@ module Embulk
...
@@ -31,6 +31,14 @@ module Embulk
end
end
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
)
def
self
.
askUserForAction
(
task
,
action
,
show_message
)
option
=
@dataset_utils
.
getConfiguration
(
action
,
task
[
'tool_dir'
])
option
=
@dataset_utils
.
getConfiguration
(
action
,
task
[
'tool_dir'
])
valid_option
=
option
!=
DatasetUtils
::
OPTION_ABORT
?
TRUE
:
FALSE
valid_option
=
option
!=
DatasetUtils
::
OPTION_ABORT
?
TRUE
:
FALSE
...
@@ -104,7 +112,8 @@ module Embulk
...
@@ -104,7 +112,8 @@ module Embulk
'data_set'
=>
@data_set
,
'data_set'
=>
@data_set
,
'chunk_size'
=>
DatasetUtils
::
CHUNK_SIZE
+
10
,
'chunk_size'
=>
DatasetUtils
::
CHUNK_SIZE
+
10
,
'output_path'
=>
@output_path
,
'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
if
task
[
'chunk_size'
]
==
0
task
[
'chunk_size'
]
=
DatasetUtils
::
CHUNK_SIZE
task
[
'chunk_size'
]
=
DatasetUtils
::
CHUNK_SIZE
...
@@ -158,10 +167,18 @@ module Embulk
...
@@ -158,10 +167,18 @@ module Embulk
task
[
'data_streams'
]
=
@dataset_utils
.
getRemoteFileListForDiscardLocalChanges
(
task
[
'data_streams'
],
@data_set
,
task
[
'data_streams'
]
=
@dataset_utils
.
getRemoteFileListForDiscardLocalChanges
(
task
[
'data_streams'
],
@data_set
,
check_changes
=
FALSE
,
changes
=
local_changes
)
check_changes
=
FALSE
,
changes
=
local_changes
)
else
else
if
task
[
'always_yes_mode'
]
!=
"true"
self
.
askUserForAction
(
task
,
action
=
DatasetUtils
::
OPTION_UPDATE
,
show_message
=
TRUE
)
self
.
askUserForAction
(
task
,
action
=
DatasetUtils
::
OPTION_UPDATE
,
show_message
=
TRUE
)
else
self
.
alwaysYesDownload
()
end
end
end
elsif
not
@dataset_utils
.
partialIngestionFileExist
()
elsif
not
@dataset_utils
.
partialIngestionFileExist
()
if
task
[
'always_yes_mode'
]
!=
"true"
self
.
askUserForAction
(
task
,
action
=
DatasetUtils
::
OPTION_RESUME
,
show_message
=
TRUE
)
self
.
askUserForAction
(
task
,
action
=
DatasetUtils
::
OPTION_RESUME
,
show_message
=
TRUE
)
else
self
.
alwaysYesDownload
()
end
else
else
if
@dataset_utils
.
discardChangesFileExist
()
if
@dataset_utils
.
discardChangesFileExist
()
puts
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