Class BlockScanner
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.BlockScanner
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBlockScanner(DataNode datanode) BlockScanner(DataNode datanode, org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoidSet up a scanner for the given block pool and volume.longbooleanReturns true if there is any scanner thread registered.booleanReturns true if the block scanner is enabled.voidStops and removes all volume scanners.voidremoveVolumeScanner(FsVolumeSpi volume) Stops and removes a volume scanner.voidsetJoinVolumeScannersTimeOutMs(long joinScannersTimeOutMs)
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
BlockScanner
-
BlockScanner
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns true if the block scanner is enabled. If the block scanner is disabled, no volume scanners will be created, and no threads will start. -
hasAnyRegisteredScanner
public boolean hasAnyRegisteredScanner()Returns true if there is any scanner thread registered. -
addVolumeScanner
Set up a scanner for the given block pool and volume.- Parameters:
ref- A reference to the volume.
-
removeVolumeScanner
Stops and removes a volume scanner. This function will block until the volume scanner has stopped.- Parameters:
volume- The volume to remove.
-
removeAllVolumeScanners
public void removeAllVolumeScanners()Stops and removes all volume scanners. This function is called on shutdown. It will return even if some of the scanners don't terminate in time. Since the scanners are daemon threads and do not alter the block content, it is safe to ignore such conditions on shutdown. -
getJoinVolumeScannersTimeOutMs
public long getJoinVolumeScannersTimeOutMs() -
setJoinVolumeScannersTimeOutMs
public void setJoinVolumeScannersTimeOutMs(long joinScannersTimeOutMs)
-