HADOOP-16566. S3Guard fsck: Use org.apache.hadoop.util.StopWatch instead of com.google.common.base.Stopwatch (#1433). Contributed by Gabor Bota.

Change-Id: Ied43ef1522dfc6a1210d6fc58c38d8208824931b
This commit is contained in:
Gabor Bota 2019-09-12 19:04:57 +02:00 committed by GitHub
parent fe8cdf0ab8
commit 1505d3f5ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,12 +33,12 @@
import com.google.common.base.Preconditions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Stopwatch;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.s3a.S3AFileStatus;
import org.apache.hadoop.fs.s3a.S3AFileSystem;
import org.apache.hadoop.util.StopWatch;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toSet;
@ -95,7 +95,8 @@ public S3GuardFsck(S3AFileSystem fs, MetadataStore ms)
* @throws IOException
*/
public List<ComparePair> compareS3ToMs(Path p) throws IOException {
Stopwatch stopwatch = Stopwatch.createStarted();
StopWatch stopwatch = new StopWatch();
stopwatch.start();
int scannedItems = 0;
final Path rootPath = rawFS.qualify(p);
@ -146,7 +147,7 @@ public List<ComparePair> compareS3ToMs(Path p) throws IOException {
new S3GuardFsckViolationHandler(rawFS, metadataStore);
comparePairs.forEach(handler::handle);
LOG.info("Total scan time: {}s", stopwatch.elapsed(TimeUnit.SECONDS));
LOG.info("Total scan time: {}s", stopwatch.now(TimeUnit.SECONDS));
LOG.info("Scanned entries: {}", scannedItems);
return comparePairs;