Revert "HDFS-11140. Directory Scanner should log startup message time correctly. Contributed by Yiqun Lin."
This reverts commit 0857641f62
.
This commit is contained in:
parent
0857641f62
commit
deb4743b2c
|
@ -791,15 +791,6 @@ public class RawLocalFileSystem extends FileSystem {
|
||||||
pathToFile(p).toPath(), BasicFileAttributeView.class);
|
pathToFile(p).toPath(), BasicFileAttributeView.class);
|
||||||
FileTime fmtime = (mtime >= 0) ? FileTime.fromMillis(mtime) : null;
|
FileTime fmtime = (mtime >= 0) ? FileTime.fromMillis(mtime) : null;
|
||||||
FileTime fatime = (atime >= 0) ? FileTime.fromMillis(atime) : null;
|
FileTime fatime = (atime >= 0) ? FileTime.fromMillis(atime) : null;
|
||||||
|
|
||||||
// On some macOS environment, BasicFileAttributeView.setTimes
|
|
||||||
// does not set times correctly when the argument of accessTime is null.
|
|
||||||
// TODO: Remove this after the issue is fixed.
|
|
||||||
if (fatime == null && Shell.MAC) {
|
|
||||||
FileStatus f = getFileStatus(p);
|
|
||||||
fatime = FileTime.fromMillis(f.getAccessTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
view.setTimes(fmtime, fatime, null);
|
view.setTimes(fmtime, fatime, null);
|
||||||
} catch (NoSuchFileException e) {
|
} catch (NoSuchFileException e) {
|
||||||
throw new FileNotFoundException("File " + p + " does not exist");
|
throw new FileNotFoundException("File " + p + " does not exist");
|
||||||
|
|
|
@ -37,8 +37,6 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import org.apache.commons.lang.time.FastDateFormat;
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.classification.InterfaceAudience;
|
import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
|
@ -63,7 +61,7 @@ public class DirectoryScanner implements Runnable {
|
||||||
private static final int MILLIS_PER_SECOND = 1000;
|
private static final int MILLIS_PER_SECOND = 1000;
|
||||||
private static final String START_MESSAGE =
|
private static final String START_MESSAGE =
|
||||||
"Periodic Directory Tree Verification scan"
|
"Periodic Directory Tree Verification scan"
|
||||||
+ " starting at %s with interval of %dms";
|
+ " starting at %dms with interval of %dms";
|
||||||
private static final String START_MESSAGE_WITH_THROTTLE = START_MESSAGE
|
private static final String START_MESSAGE_WITH_THROTTLE = START_MESSAGE
|
||||||
+ " and throttle limit of %dms/s";
|
+ " and throttle limit of %dms/s";
|
||||||
|
|
||||||
|
@ -270,12 +268,10 @@ public class DirectoryScanner implements Runnable {
|
||||||
String logMsg;
|
String logMsg;
|
||||||
|
|
||||||
if (throttleLimitMsPerSec < MILLIS_PER_SECOND) {
|
if (throttleLimitMsPerSec < MILLIS_PER_SECOND) {
|
||||||
logMsg = String.format(START_MESSAGE_WITH_THROTTLE,
|
logMsg = String.format(START_MESSAGE_WITH_THROTTLE, firstScanTime,
|
||||||
FastDateFormat.getInstance().format(firstScanTime), scanPeriodMsecs,
|
scanPeriodMsecs, throttleLimitMsPerSec);
|
||||||
throttleLimitMsPerSec);
|
|
||||||
} else {
|
} else {
|
||||||
logMsg = String.format(START_MESSAGE,
|
logMsg = String.format(START_MESSAGE, firstScanTime, scanPeriodMsecs);
|
||||||
FastDateFormat.getInstance().format(firstScanTime), scanPeriodMsecs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info(logMsg);
|
LOG.info(logMsg);
|
||||||
|
|
Loading…
Reference in New Issue