File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/main/java/org/embulk/output Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 4
4
import org .apache .hadoop .conf .Configuration ;
5
5
import org .apache .hadoop .fs .FileSystem ;
6
6
import org .apache .hadoop .fs .Path ;
7
+ import org .apache .hadoop .util .Progressable ;
7
8
import org .embulk .config .*;
8
9
import org .embulk .spi .*;
9
10
import org .jruby .embed .ScriptingContainer ;
@@ -139,13 +140,19 @@ public void nextFile() {
139
140
currentPath = new Path (workingPath + String .format (sequenceFormat , taskIndex , fileIndex ));
140
141
try {
141
142
if (fs .exists (currentPath )) {
142
- // TODO: appropriate exception
143
- throw Throwables .propagate (new IOException (currentPath .toString () + "already exists." ));
143
+ throw new IllegalAccessException (currentPath .toString () + "already exists." );
144
144
}
145
- currentStream = fs .create (currentPath );
145
+ currentStream = fs .create (
146
+ currentPath ,
147
+ new Progressable () {
148
+ @ Override
149
+ public void progress () {
150
+ logger .info ("{} byte written." , 1 );
151
+ }
152
+ });
146
153
logger .info ("Uploading '{}'" , currentPath .toString ());
147
154
}
148
- catch (IOException e ) {
155
+ catch (IOException | IllegalAccessException e ) {
149
156
logger .error (e .getMessage ());
150
157
throw Throwables .propagate (e );
151
158
}
You can’t perform that action at this time.
0 commit comments