HDFS-2360. Ugly stacktrce when quota exceeds. (harsh)

This commit is contained in:
Harsh J 2015-03-17 00:59:50 +05:30
parent 56085203c4
commit 046521cd65
2 changed files with 10 additions and 1 deletions

View File

@ -321,6 +321,8 @@ Release 2.8.0 - UNRELEASED
IMPROVEMENTS
HDFS-2360. Ugly stacktrace when quota exceeds. (harsh)
OPTIMIZATIONS
BUG FIXES

View File

@ -57,6 +57,7 @@
import org.apache.hadoop.hdfs.client.HdfsDataOutputStream;
import org.apache.hadoop.hdfs.client.HdfsDataOutputStream.SyncFlag;
import org.apache.hadoop.hdfs.protocol.BlockStoragePolicy;
import org.apache.hadoop.hdfs.protocol.QuotaExceededException;
import org.apache.hadoop.hdfs.protocol.DSQuotaExceededException;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
@ -551,7 +552,13 @@ public void run() {
} catch (Throwable e) {
// Log warning if there was a real error.
if (restartingNodeIndex.get() == -1) {
DFSClient.LOG.warn("DataStreamer Exception", e);
// Since their messages are descriptive enough, do not always
// log a verbose stack-trace WARN for quota exceptions.
if (e instanceof QuotaExceededException) {
DFSClient.LOG.debug("DataStreamer Quota Exception", e);
} else {
DFSClient.LOG.warn("DataStreamer Exception", e);
}
}
if (e instanceof IOException) {
setLastException((IOException)e);