HDFS-12137. DN dataset lock should be fair. Contributed by Daryn Sharp.
(cherry picked from commit a47820d72a4c4aba857fd7325fa9ae9a95fe8faa) Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
This commit is contained in:
parent
1edc16ee54
commit
561b72970f
@ -127,6 +127,7 @@
|
|||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* FSDataset manages a set of data blocks. Each block
|
* FSDataset manages a set of data blocks. Each block
|
||||||
@ -287,6 +288,7 @@ public LengthInputStream getMetaDataInputStream(ExtendedBlock b)
|
|||||||
this.smallBufferSize = DFSUtilClient.getSmallBufferSize(conf);
|
this.smallBufferSize = DFSUtilClient.getSmallBufferSize(conf);
|
||||||
this.datasetLock = new AutoCloseableLock(
|
this.datasetLock = new AutoCloseableLock(
|
||||||
new InstrumentedLock(getClass().getName(), LOG,
|
new InstrumentedLock(getClass().getName(), LOG,
|
||||||
|
new ReentrantLock(true),
|
||||||
conf.getTimeDuration(
|
conf.getTimeDuration(
|
||||||
DFSConfigKeys.DFS_LOCK_SUPPRESS_WARNING_INTERVAL_KEY,
|
DFSConfigKeys.DFS_LOCK_SUPPRESS_WARNING_INTERVAL_KEY,
|
||||||
DFSConfigKeys.DFS_LOCK_SUPPRESS_WARNING_INTERVAL_DEFAULT,
|
DFSConfigKeys.DFS_LOCK_SUPPRESS_WARNING_INTERVAL_DEFAULT,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user