Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
embulk-input-filename
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
Klaus Wölfel
embulk-input-filename
Commits
996b5c7a
Commit
996b5c7a
authored
Aug 08, 2017
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the multi Dir and single Dir
parent
e48da9bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
20 deletions
+10
-20
src/main/java/org/embulk/input/filename/FilenameInputPlugin.java
...n/java/org/embulk/input/filename/FilenameInputPlugin.java
+6
-20
src/test/java/org/embulk/input/filename/TestFilenameInputPlugin.java
...va/org/embulk/input/filename/TestFilenameInputPlugin.java
+4
-0
No files found.
src/main/java/org/embulk/input/filename/FilenameInputPlugin.java
View file @
996b5c7a
...
...
@@ -173,26 +173,10 @@ public class FilenameInputPlugin
}
int
taskCount
;
// If the we upload only one directory, we set each file as a task.
// In this case the max_threads must equal 1 to keep the file uploading order
if
(
dirList
.
size
()
==
1
){
log
.
info
(
"size==1"
);
ArrayList
<
ArrayList
<
String
>>
oneFile
=
new
ArrayList
<
ArrayList
<
String
>>
();
for
(
String
f
:
allFiles
.
get
(
0
)){
ArrayList
<
String
>
file
=
new
ArrayList
<
String
>
();
file
.
add
(
f
);
oneFile
.
add
(
file
);
}
while
(
tagList
.
size
()<
oneFile
.
size
()){
tagList
.
add
(
tagList
.
get
(
0
));
}
task
.
setFiles
(
oneFile
);
taskCount
=
oneFile
.
size
();
}
else
{
task
.
setFiles
(
allFiles
);
taskCount
=
allFiles
.
size
();
}
int
taskCount
=
allFiles
.
size
();
task
.
setFiles
(
allFiles
);
ArrayList
<
ColumnConfig
>
columns
=
new
ArrayList
<
ColumnConfig
>();
//final String columnName = task.getColumnName();
...
...
@@ -276,6 +260,8 @@ public class FilenameInputPlugin
}
public
ArrayList
<
String
>
listFiles
(
PluginTask
task
,
Path
pathPrefix
,
String
lastPath
,
String
order
)
{
//Path pathPrefix = Paths.get(task.getPathPrefix()).normalize();
...
...
src/test/java/org/embulk/input/filename/TestFilenameInputPlugin.java
View file @
996b5c7a
...
...
@@ -67,6 +67,7 @@ public class TestFilenameInputPlugin
public
void
testOrderByModifiedTime
()
throws
Exception
{
ConfigSource
execConfig
=
embulk
.
newConfig
()
.
set
(
"min_output_tasks"
,
"1"
)
.
set
(
"max_threads"
,
"1"
);
Path
path_src
=
Paths
.
get
(
"src/test/resources/testModifiedOrder"
);
...
...
@@ -131,6 +132,7 @@ public class TestFilenameInputPlugin
public
void
testTagList
()
throws
Exception
{
ConfigSource
execConfig
=
embulk
.
newConfig
()
.
set
(
"min_output_tasks"
,
"1"
)
.
set
(
"max_threads"
,
"1"
);
Path
path_src
=
Paths
.
get
(
"src/test/resources/testDirList"
);
...
...
@@ -223,6 +225,7 @@ public class TestFilenameInputPlugin
public
void
testDirList
()
throws
Exception
{
ConfigSource
execConfig
=
embulk
.
newConfig
()
.
set
(
"min_output_tasks"
,
"1"
)
.
set
(
"max_threads"
,
"1"
);
Path
path_src
=
Paths
.
get
(
"src/test/resources/testDirList"
);
...
...
@@ -297,6 +300,7 @@ public class TestFilenameInputPlugin
public
void
testContent
()
throws
Exception
{
ConfigSource
execConfig
=
embulk
.
newConfig
()
.
set
(
"min_output_tasks"
,
"1"
)
.
set
(
"max_threads"
,
"1"
);
Path
path_src
=
Paths
.
get
(
"src/test/resources/data"
);
...
...
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