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

(cherry picked from commit 046521cd65)
This commit is contained in:
Harsh J 2015-03-17 00:59:50 +05:30
parent 9f227ad696
commit cbb8858367
2 changed files with 10 additions and 1 deletions

View File

@ -8,6 +8,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.fs.Syncable;
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;
@ -550,7 +551,13 @@ public class DFSOutputStream extends FSOutputSummer
} 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);