Skip to content

Commit 3092df2

Browse files
committed
Remove dependency on org.apache.commons:commons-lang3
This is because the upstream (open-source) ZK has explicitly excluded the use of commons-lang3. No logical change.
1 parent 65c23f5 commit 3092df2

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

zookeeper-server/src/main/java/org/apache/zookeeper/server/backup/BackupProcess.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import java.io.File;
44
import java.io.IOException;
55

6-
import org.apache.commons.lang.NullArgumentException;
7-
import org.apache.commons.lang.time.StopWatch;
86
import org.apache.zookeeper.server.backup.storage.BackupStorageProvider;
97
import 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);

0 commit comments

Comments
 (0)