HDFS-15890. Improve the Logs for File Concat Operation. Contributed by Bhavik Patel.
(cherry picked from commit 9ba60c33d8
)
This commit is contained in:
parent
f4a9327002
commit
aec9d2cff7
@ -52,9 +52,9 @@ static FileStatus concat(FSDirectory fsd, FSPermissionChecker pc,
|
|||||||
String target, String[] srcs, boolean logRetryCache) throws IOException {
|
String target, String[] srcs, boolean logRetryCache) throws IOException {
|
||||||
validatePath(target, srcs);
|
validatePath(target, srcs);
|
||||||
assert srcs != null;
|
assert srcs != null;
|
||||||
if (FSDirectory.LOG.isDebugEnabled()) {
|
NameNode.stateChangeLog.debug("DIR* NameSystem.concat: {} to {}",
|
||||||
FSDirectory.LOG.debug("concat {} to {}", Arrays.toString(srcs), target);
|
Arrays.toString(srcs), target);
|
||||||
}
|
|
||||||
final INodesInPath targetIIP = fsd.resolvePath(pc, target, DirOp.WRITE);
|
final INodesInPath targetIIP = fsd.resolvePath(pc, target, DirOp.WRITE);
|
||||||
// write permission for the target
|
// write permission for the target
|
||||||
if (fsd.isPermissionEnabled()) {
|
if (fsd.isPermissionEnabled()) {
|
||||||
@ -66,11 +66,6 @@ static FileStatus concat(FSDirectory fsd, FSPermissionChecker pc,
|
|||||||
// check the srcs
|
// check the srcs
|
||||||
INodeFile[] srcFiles = verifySrcFiles(fsd, srcs, targetIIP, pc);
|
INodeFile[] srcFiles = verifySrcFiles(fsd, srcs, targetIIP, pc);
|
||||||
|
|
||||||
if(NameNode.stateChangeLog.isDebugEnabled()) {
|
|
||||||
NameNode.stateChangeLog.debug("DIR* NameSystem.concat: " +
|
|
||||||
Arrays.toString(srcs) + " to " + target);
|
|
||||||
}
|
|
||||||
|
|
||||||
long timestamp = now();
|
long timestamp = now();
|
||||||
fsd.writeLock();
|
fsd.writeLock();
|
||||||
try {
|
try {
|
||||||
@ -234,10 +229,8 @@ private static void verifyQuota(FSDirectory fsd, INodesInPath targetIIP,
|
|||||||
static void unprotectedConcat(FSDirectory fsd, INodesInPath targetIIP,
|
static void unprotectedConcat(FSDirectory fsd, INodesInPath targetIIP,
|
||||||
INodeFile[] srcList, long timestamp) throws IOException {
|
INodeFile[] srcList, long timestamp) throws IOException {
|
||||||
assert fsd.hasWriteLock();
|
assert fsd.hasWriteLock();
|
||||||
if (NameNode.stateChangeLog.isDebugEnabled()) {
|
NameNode.stateChangeLog.debug("DIR* NameSystem.concat to {}",
|
||||||
NameNode.stateChangeLog.debug("DIR* FSNamesystem.concat to "
|
targetIIP.getPath());
|
||||||
+ targetIIP.getPath());
|
|
||||||
}
|
|
||||||
|
|
||||||
final INodeFile trgInode = targetIIP.getLastINode().asFile();
|
final INodeFile trgInode = targetIIP.getLastINode().asFile();
|
||||||
QuotaCounts deltas = computeQuotaDeltas(fsd, trgInode, srcList);
|
QuotaCounts deltas = computeQuotaDeltas(fsd, trgInode, srcList);
|
||||||
|
@ -1057,6 +1057,8 @@ public boolean rename(String src, String dst) throws IOException {
|
|||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void concat(String trg, String[] src) throws IOException {
|
public void concat(String trg, String[] src) throws IOException {
|
||||||
checkNNStartup();
|
checkNNStartup();
|
||||||
|
stateChangeLog.debug("*DIR* NameNode.concat: src path {} to" +
|
||||||
|
" target path {}", Arrays.toString(src), trg);
|
||||||
namesystem.checkOperation(OperationCategory.WRITE);
|
namesystem.checkOperation(OperationCategory.WRITE);
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user