Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2759,6 +2759,7 @@ private HdfsFileStatus startFileInt(String src,
long blockSize, CryptoProtocolVersion[] supportedVersions,
String ecPolicyName, String storagePolicy, boolean logRetryCache)
throws IOException {
final String operationName = "create";
if (NameNode.stateChangeLog.isDebugEnabled()) {
StringBuilder builder = new StringBuilder();
builder.append("DIR* NameSystem.startFile: src=").append(src)
Expand Down Expand Up @@ -2796,6 +2797,7 @@ private HdfsFileStatus startFileInt(String src,

checkOperation(OperationCategory.WRITE);
final FSPermissionChecker pc = getPermissionChecker();
FSPermissionChecker.setOperationType(operationName);
writeLock(RwLockMode.FS);
try {
checkOperation(OperationCategory.WRITE);
Expand Down Expand Up @@ -2858,7 +2860,7 @@ private HdfsFileStatus startFileInt(String src,
dir.writeUnlock();
}
} finally {
writeUnlock(RwLockMode.FS, "create",
writeUnlock(RwLockMode.FS, operationName,
getLockReportInfoSupplier(src, null, stat));
// There might be transactions logged while trying to recover the lease.
// They need to be sync'ed even when an exception was thrown.
Expand Down Expand Up @@ -3255,7 +3257,7 @@ INodeFile checkLease(INodesInPath iip, String holder, long fileId)
*/
boolean completeFile(final String src, String holder,
ExtendedBlock last, long fileId)
throws IOException {
throws IOException {
boolean success = false;
final String operationName = "completeFile";
checkOperation(OperationCategory.WRITE);
Expand Down