File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
hadoop-tools/hadoop-aws/src
main/java/org/apache/hadoop/fs/s3a
test/java/org/apache/hadoop/fs/s3a/performance Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1100,7 +1100,8 @@ private static class ProgressableListener implements ProgressListener {
1100
1100
this .progress = progress ;
1101
1101
}
1102
1102
1103
- public void progressChanged (ProgressListenerEvent eventType , int bytesTransferred ) {
1103
+ @ Override
1104
+ public void progressChanged (ProgressListenerEvent eventType , long bytesTransferred ) {
1104
1105
if (progress != null ) {
1105
1106
progress .progress ();
1106
1107
}
Original file line number Diff line number Diff line change 21
21
import java .io .IOException ;
22
22
import java .util .Arrays ;
23
23
import java .util .Collection ;
24
+ import java .util .concurrent .atomic .AtomicLong ;
24
25
25
26
import org .assertj .core .api .Assertions ;
26
27
import org .junit .Test ;
@@ -213,8 +214,11 @@ public void testCreateFilePerformanceFlag() throws Throwable {
213
214
S3AFileSystem fs = getFileSystem ();
214
215
215
216
Path path = methodPath ();
217
+ // increment progress events
218
+ AtomicLong progressEvents = new AtomicLong (0 );
216
219
FSDataOutputStreamBuilder builder = fs .createFile (path )
217
220
.overwrite (false )
221
+ .progress (progressEvents ::incrementAndGet )
218
222
.recursive ();
219
223
220
224
// this has a broken return type; something to do with the return value of
@@ -225,6 +229,10 @@ public void testCreateFilePerformanceFlag() throws Throwable {
225
229
always (NO_HEAD_OR_LIST ),
226
230
with (OBJECT_BULK_DELETE_REQUEST , 0 ),
227
231
with (OBJECT_DELETE_REQUEST , 0 ));
232
+
233
+ Assertions .assertThat (progressEvents .get ())
234
+ .describedAs ("progress events" )
235
+ .isGreaterThanOrEqualTo (1 );
228
236
}
229
237
230
238
@ Test
You can’t perform that action at this time.
0 commit comments