File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
zookeeper-server/src/main/java/org/apache/zookeeper/server/backup Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 33import java .io .File ;
44import java .io .IOException ;
55
6- import org .apache .commons .lang .NullArgumentException ;
7- import org .apache .commons .lang .time .StopWatch ;
86import org .apache .zookeeper .server .backup .storage .BackupStorageProvider ;
97import org .slf4j .Logger ;
108
@@ -60,10 +58,6 @@ public abstract class BackupProcess implements Runnable {
6058 */
6159 public BackupProcess (Logger logger , BackupStorageProvider backupStorage ,
6260 long backupIntervalInMilliseconds ) {
63- if (logger == null ) {
64- throw new NullArgumentException ("BackupProcess: logger is null!" );
65- }
66-
6761 this .logger = logger ;
6862 this .backupStorage = backupStorage ;
6963 this .backupIntervalInMilliseconds = backupIntervalInMilliseconds ;
@@ -87,10 +81,7 @@ public void run(int iterations) {
8781
8882 while (isRunning ) {
8983 BackupManager .BackupFile fileToCopy ;
90- StopWatch sw = new StopWatch ();
91-
92- sw .start ();
93-
84+ long startTime = System .currentTimeMillis ();
9485 try {
9586 if (logger .isDebugEnabled ()) {
9687 logger .debug ("Starting iteration" );
@@ -121,8 +112,7 @@ public void run(int iterations) {
121112
122113 endIteration (errorFree );
123114
124- sw .stop ();
125- long elapsedTime = sw .getTime ();
115+ long elapsedTime = System .currentTimeMillis () - startTime ;
126116
127117 logger .info ("Completed backup iteration in {} milliseconds. ErrorFree: {}." ,
128118 elapsedTime , errorFree );
You can’t perform that action at this time.
0 commit comments