Skip to content
Closed
Show file tree
Hide file tree
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 @@ -168,8 +168,7 @@ public AutoCloseDataSetLock readLock(LockLevel level, String... resources) {
AutoCloseDataSetLock volLock = getReadLock(level, resources);
volLock.setParentLock(bpLock);
if (openLockTrace) {
LOG.info("Sub lock " + resources[0] + resources[1] + " parent lock " +
resources[0]);
LOG.info("Sub lock {}, parent lock {}.", resources[0] + resources[1], resources[0]);
}
return volLock;
} else {
Expand All @@ -179,7 +178,7 @@ public AutoCloseDataSetLock readLock(LockLevel level, String... resources) {
AutoCloseDataSetLock dirLock = getReadLock(level, resources);
dirLock.setParentLock(volLock);
if (openLockTrace) {
LOG.debug("Sub lock " + resources[0] + resources[1] + resources[2] + " parent lock " +
LOG.info("Sub lock {}, parent lock {}", resources[0] + resources[1] + resources[2],
resources[0] + resources[1]);
}
return dirLock;
Expand All @@ -195,8 +194,7 @@ public AutoCloseDataSetLock writeLock(LockLevel level, String... resources) {
AutoCloseDataSetLock volLock = getWriteLock(level, resources);
volLock.setParentLock(bpLock);
if (openLockTrace) {
LOG.info("Sub lock " + resources[0] + resources[1] + " parent lock " +
resources[0]);
LOG.info("Sub lock {}, parent lock {}.", resources[0] + resources[1], resources[0]);
}
return volLock;
} else {
Expand All @@ -206,7 +204,7 @@ public AutoCloseDataSetLock writeLock(LockLevel level, String... resources) {
AutoCloseDataSetLock dirLock = getWriteLock(level, resources);
dirLock.setParentLock(volLock);
if (openLockTrace) {
LOG.debug("Sub lock " + resources[0] + resources[1] + resources[2] + " parent lock " +
LOG.info("Sub lock {}, parent lock {}.", resources[0] + resources[1] + resources[2],
resources[0] + resources[1]);
}
return dirLock;
Expand Down Expand Up @@ -273,6 +271,9 @@ public void addLock(LockLevel level, String... resources) {
new ReentrantReadWriteLock(isFair));
lockMap.addLock(lockName, new ReentrantReadWriteLock(isFair));
}
if (openLockTrace) {
LOG.info("Added {} lock, lock name: {}", level.name(), lockName);
}
}

@Override
Expand All @@ -281,6 +282,9 @@ public void removeLock(LockLevel level, String... resources) {
try (AutoCloseDataSetLock lock = writeLock(level, resources)) {
lockMap.removeLock(lockName);
}
if (openLockTrace) {
LOG.info("Removed {} lock, lock name: {}", level.name(), lockName);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ private synchronized void activateVolume(
List<String> allSubDirNameForDataSetLock = datasetSubLockStrategy.getAllSubLockNames();
for (String dir : allSubDirNameForDataSetLock) {
lockManager.addLock(LockLevel.DIR, bp, ref.getVolume().getStorageID(), dir);
LOG.info("Added DIR lock for bpid:{}, volume storageid:{}, dir:{}",
bp, ref.getVolume().getStorageID(), dir);
}
LOG.info("Added DIR lock for bpid:{}, volume storageid:{}.", bp,
ref.getVolume().getStorageID());
}
DatanodeStorage dnStorage = storageMap.get(sd.getStorageUuid());
if (dnStorage != null) {
Expand Down Expand Up @@ -3297,9 +3297,8 @@ public void addBlockPool(String bpid, Configuration conf)
List<String> allSubDirNameForDataSetLock = datasetSubLockStrategy.getAllSubLockNames();
for (String dir : allSubDirNameForDataSetLock) {
lockManager.addLock(LockLevel.DIR, bpid, v, dir);
LOG.info("Added DIR lock for bpid:{}, volume storageid:{}, dir:{}",
bpid, v, dir);
}
LOG.info("Added DIR lock for bpid:{}, volume storageid:{}.", bpid, v);
}
}
try {
Expand Down