public class DatasetVolumeChecker
extends java.lang.Object
FsDatasetSpi and allows retrieving a list of failed volumes.
This splits out behavior that was originally implemented across
DataNode, FsDatasetImpl and FsVolumeList.| Modifier and Type | Class | Description |
|---|---|---|
static interface |
DatasetVolumeChecker.Callback |
A callback interface that is supplied the result of running an
async disk check on multiple volumes.
|
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Constructor | Description |
|---|---|
DatasetVolumeChecker(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.util.Timer timer) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Set<FsVolumeSpi> |
checkAllVolumes(FsDatasetSpi<? extends FsVolumeSpi> dataset) |
Run checks against all volumes of a dataset.
|
boolean |
checkVolume(FsVolumeSpi volume,
DatasetVolumeChecker.Callback callback) |
Check a single volume asynchronously, returning a
ListenableFuture
that can be used to retrieve the final result. |
long |
getNumSkippedChecks() |
Return the number of checks skipped because the minimum gap since the
last check had not elapsed.
|
long |
getNumSyncDatasetChecks() |
|
long |
getNumVolumeChecks() |
|
void |
shutdownAndWait(int gracePeriod,
java.util.concurrent.TimeUnit timeUnit) |
Shutdown the checker and its associated ExecutorService.
|
public DatasetVolumeChecker(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.util.Timer timer)
throws org.apache.hadoop.util.DiskChecker.DiskErrorException
conf - Configuration object.timer - Timer object used for throttling checks.org.apache.hadoop.util.DiskChecker.DiskErrorExceptionpublic java.util.Set<FsVolumeSpi> checkAllVolumes(FsDatasetSpi<? extends FsVolumeSpi> dataset) throws java.lang.InterruptedException
dataset - - FsDatasetSpi to be checked.java.lang.InterruptedExceptionpublic boolean checkVolume(FsVolumeSpi volume, DatasetVolumeChecker.Callback callback)
ListenableFuture
that can be used to retrieve the final result.
If the volume cannot be referenced then it is already closed and
cannot be checked. No error is propagated to the callback.volume - the volume that is to be checked.callback - callback to be invoked when the volume check completes.public void shutdownAndWait(int gracePeriod,
java.util.concurrent.TimeUnit timeUnit)
ExecutorService.awaitTermination(long, java.util.concurrent.TimeUnit) for the interpretation
of the parameters.public long getNumVolumeChecks()
public long getNumSyncDatasetChecks()
public long getNumSkippedChecks()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.