HBASE-9060 ExportSnapshot job fails if target path contains percentage character (Jerry He)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1507791 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
mbertozzi 2013-07-28 12:17:10 +00:00
parent d42ecb89bd
commit cf7b641afa
1 changed files with 5 additions and 3 deletions

View File

@ -246,7 +246,7 @@ public final class ExportSnapshot extends Configured implements Tool {
final Path outputPath, final FSDataOutputStream out,
final long inputFileSize) {
final String statusMessage = "copied %s/" + StringUtils.humanReadableInt(inputFileSize) +
" (%.3f%%) from " + inputPath + " to " + outputPath;
" (%.3f%%)";
try {
byte[] buffer = new byte[BUFFER_SIZE];
@ -263,7 +263,8 @@ public final class ExportSnapshot extends Configured implements Tool {
context.getCounter(Counter.BYTES_COPIED).increment(reportBytes);
context.setStatus(String.format(statusMessage,
StringUtils.humanReadableInt(totalBytesWritten),
reportBytes/(float)inputFileSize));
totalBytesWritten/(float)inputFileSize) +
" from " + inputPath + " to " + outputPath);
reportBytes = 0;
}
}
@ -271,7 +272,8 @@ public final class ExportSnapshot extends Configured implements Tool {
context.getCounter(Counter.BYTES_COPIED).increment(reportBytes);
context.setStatus(String.format(statusMessage,
StringUtils.humanReadableInt(totalBytesWritten),
reportBytes/(float)inputFileSize));
totalBytesWritten/(float)inputFileSize) +
" from " + inputPath + " to " + outputPath);
// Verify that the written size match
if (totalBytesWritten != inputFileSize) {