You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/FileMonitoringTimerTask.java
+43-15Lines changed: 43 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,9 @@
24
24
importorg.slf4j.LoggerFactory;
25
25
26
26
importjava.nio.file.Path;
27
+
importjava.util.ArrayList;
28
+
importjava.util.Collections;
29
+
importjava.util.List;
27
30
importjava.util.TimerTask;
28
31
importjava.util.function.Consumer;
29
32
@@ -42,34 +45,59 @@ public class FileMonitoringTimerTask extends TimerTask {
42
45
staticfinalStringPROCESS_ERROR_MESSAGE =
43
46
"Could not process file change : ";
44
47
45
-
finalprivatePathfilePath;
48
+
finalprivateList<Path> filePaths;
46
49
finalprivateConsumer<Path> onFileChange;
47
50
finalConsumer<Throwable> onChangeFailure;
48
-
privatelonglastProcessed;
51
+
privateList<Long>lastProcessed;
49
52
50
53
/**
51
-
* Create file monitoring task to be scheduled using a standard Java {@link java.util.Timer}
52
-
* instance.
54
+
* See {@link #FileMonitoringTimerTask(List, Consumer, Consumer)}.
53
55
*
54
-
* @param filePath The path to the file to monitor.
55
-
* @param onFileChange The function to call when the file has changed.
56
-
* @param onChangeFailure The function to call when an exception is thrown during the
57
-
* file change processing.
56
+
* @param filePath The file to monitor.
57
+
* @param onFileChange What to do when the file changes.
58
+
* @param onChangeFailure What to do when <code>onFileChange</code>
0 commit comments