HDFS-12805. Ozone: Redundant characters printed in exception log. Contributed by Yiqun Lin.

This commit is contained in:
Xiaoyu Yao 2017-11-15 11:40:44 -08:00 committed by Owen O'Malley
parent 93f1b04949
commit 419e86d580
3 changed files with 10 additions and 11 deletions

View File

@ -99,7 +99,7 @@ public abstract class BucketProcessTemplate {
return response;
} catch (IllegalArgumentException argEx) {
LOG.error("Invalid bucket. ex:{}", argEx);
LOG.error("Invalid bucket.", argEx);
throw ErrorTable.newError(ErrorTable.INVALID_BUCKET_NAME, userArgs,
argEx);
} catch (IOException fsExp) {
@ -149,7 +149,7 @@ public abstract class BucketProcessTemplate {
*/
void handleIOException(String bucket, String reqID, String hostName,
IOException fsExp) throws OzoneException {
LOG.error("IOException: {}", fsExp);
LOG.error("IOException:", fsExp);
OzoneException exp = null;
if (fsExp instanceof FileAlreadyExistsException) {

View File

@ -94,10 +94,10 @@ public abstract class KeyProcessTemplate {
return response;
} catch (IllegalArgumentException argExp) {
LOG.error("Invalid bucket in key call. ex:{}", argExp);
LOG.error("Invalid bucket in key call.", argExp);
throw newError(INVALID_BUCKET_NAME, userArgs, argExp);
} catch (IOException fsExp) {
LOG.error("IOException. ex : {}", fsExp);
LOG.error("IOException:", fsExp);
// Map KEY_NOT_FOUND to INVALID_KEY
if (fsExp.getMessage().endsWith(
KeySpaceManagerProtocolProtos.Status.KEY_NOT_FOUND.name())) {
@ -109,7 +109,7 @@ public abstract class KeyProcessTemplate {
throw ErrorTable.newError(ErrorTable.SERVER_ERROR, userArgs, fsExp);
} catch (NoSuchAlgorithmException algoEx) {
LOG.error("NoSuchAlgorithmException. Probably indicates an unusual java "
+ "installation. ex : {}", algoEx);
+ "installation.", algoEx);
throw ErrorTable.newError(SERVER_ERROR, userArgs, algoEx);
}
}

View File

@ -97,7 +97,7 @@ public abstract class VolumeProcessTemplate {
return response;
} catch (IllegalArgumentException ex) {
LOG.error("illegal argument. {}", ex);
LOG.error("Illegal argument.", ex);
throw ErrorTable.newError(ErrorTable.INVALID_VOLUME_NAME, userArgs, ex);
} catch (IOException ex) {
handleIOException(volume, reqID, hostName, ex);
@ -130,7 +130,7 @@ public abstract class VolumeProcessTemplate {
*/
private void handleIOException(String volume, String reqID, String hostName,
IOException fsExp) throws OzoneException {
LOG.error("IOException: {}", fsExp);
LOG.error("IOException:", fsExp);
OzoneException exp = null;
if ((fsExp != null && fsExp.getMessage().endsWith(
@ -178,7 +178,7 @@ public abstract class VolumeProcessTemplate {
try {
args.setQuota(quota);
} catch (IllegalArgumentException ex) {
LOG.debug("Malformed Quota: {}", ex);
LOG.debug("Malformed Quota.", ex);
throw ErrorTable.newError(ErrorTable.MALFORMED_QUOTA, args, ex);
}
}
@ -235,7 +235,7 @@ public abstract class VolumeProcessTemplate {
ListVolumes volumes = fs.listVolumes(listArgs);
return OzoneUtils.getResponse(user, HTTP_OK, volumes.toJsonString());
} catch (IOException ex) {
LOG.debug("unable to get the volume list for the user. Ex: {}", ex);
LOG.debug("unable to get the volume list for the user.", ex);
OzoneException exp = ErrorTable.newError(ErrorTable.SERVER_ERROR,
user, ex);
exp.setMessage("unable to get the volume list for the user");
@ -264,8 +264,7 @@ public abstract class VolumeProcessTemplate {
ListBuckets bucketList = fs.listBuckets(listArgs);
return OzoneUtils.getResponse(args, HTTP_OK, bucketList.toJsonString());
} catch (IOException ex) {
LOG.debug("unable to get the bucket list for the specified volume." +
" Ex: {}", ex);
LOG.debug("unable to get the bucket list for the specified volume.", ex);
OzoneException exp =
ErrorTable.newError(ErrorTable.SERVER_ERROR, args, ex);
exp.setMessage("unable to get the bucket list for the specified volume.");