java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.service.Service, HealthReporterpublic class LocalDirsHandlerService extends org.apache.hadoop.service.AbstractService implements HealthReporter
| Constructor | Description |
|---|---|
LocalDirsHandlerService() |
|
LocalDirsHandlerService(NodeManagerMetrics nodeManagerMetrics) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
areDisksHealthy() |
The minimum fraction of number of disks needed to be healthy for a node to
be considered healthy in terms of disks is configured using
YarnConfiguration.NM_MIN_HEALTHY_DISKS_FRACTION, with a default
value of YarnConfiguration.DEFAULT_NM_MIN_HEALTHY_DISKS_FRACTION. |
void |
checkDirs() |
|
void |
deregisterLocalDirsChangeListener(DirectoryCollection.DirsChangeListener listener) |
|
void |
deregisterLogDirsChangeListener(DirectoryCollection.DirsChangeListener listener) |
|
java.lang.Iterable<org.apache.hadoop.fs.Path> |
getAllLocalPathsForRead(java.lang.String pathStr) |
|
java.util.List<java.lang.String> |
getDiskFullLocalDirs() |
|
java.util.List<java.lang.String> |
getDiskFullLogDirs() |
|
java.lang.String |
getDisksHealthReport(boolean listGoodDirs) |
Function to generate a report on the state of the disks.
|
java.lang.String |
getHealthReport() |
Returns output from health check.
|
long |
getLastDisksCheckTime() |
|
long |
getLastHealthReportTime() |
Returns time stamp when node health check was last run.
|
java.util.List<java.lang.String> |
getLocalDirs() |
|
java.util.List<java.lang.String> |
getLocalDirsForCleanup() |
Function to get the local dirs which should be considered when cleaning up
resources.
|
java.util.List<java.lang.String> |
getLocalDirsForRead() |
Function to get the local dirs which should be considered for reading
existing files on disk.
|
org.apache.hadoop.fs.Path |
getLocalPathForRead(java.lang.String pathStr) |
|
org.apache.hadoop.fs.Path |
getLocalPathForWrite(java.lang.String pathStr) |
|
org.apache.hadoop.fs.Path |
getLocalPathForWrite(java.lang.String pathStr,
long size,
boolean checkWrite) |
|
java.util.List<java.lang.String> |
getLogDirs() |
|
java.util.List<java.lang.String> |
getLogDirsForCleanup() |
Function to get the log dirs which should be considered when cleaning up
resources.
|
java.util.List<java.lang.String> |
getLogDirsForRead() |
Function to get the log dirs which should be considered for reading
existing files on disk.
|
org.apache.hadoop.fs.Path |
getLogPathForWrite(java.lang.String pathStr,
boolean checkWrite) |
|
org.apache.hadoop.fs.Path |
getLogPathToRead(java.lang.String pathStr) |
|
boolean |
isGoodLocalDir(java.lang.String path) |
|
boolean |
isGoodLogDir(java.lang.String path) |
|
boolean |
isHealthy() |
Gets whether the node is healthy or not.
|
void |
registerLocalDirsChangeListener(DirectoryCollection.DirsChangeListener listener) |
|
void |
registerLogDirsChangeListener(DirectoryCollection.DirsChangeListener listener) |
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration config) |
Method which initializes the timertask and its interval time.
|
protected void |
serviceStart() |
Method used to start the disk health monitoring, if enabled.
|
protected void |
serviceStop() |
Method used to terminate the disk health monitoring service.
|
protected void |
updateMetrics() |
|
static java.lang.String[] |
validatePaths(java.lang.String[] paths) |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic LocalDirsHandlerService()
public LocalDirsHandlerService(NodeManagerMetrics nodeManagerMetrics)
protected void serviceInit(org.apache.hadoop.conf.Configuration config)
throws java.lang.Exception
serviceInit in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionprotected void serviceStart()
throws java.lang.Exception
serviceStart in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionprotected void serviceStop()
throws java.lang.Exception
serviceStop in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionpublic void registerLocalDirsChangeListener(DirectoryCollection.DirsChangeListener listener)
public void registerLogDirsChangeListener(DirectoryCollection.DirsChangeListener listener)
public void deregisterLocalDirsChangeListener(DirectoryCollection.DirsChangeListener listener)
public void deregisterLogDirsChangeListener(DirectoryCollection.DirsChangeListener listener)
public java.util.List<java.lang.String> getLocalDirs()
public java.util.List<java.lang.String> getLogDirs()
public java.util.List<java.lang.String> getDiskFullLocalDirs()
public java.util.List<java.lang.String> getDiskFullLogDirs()
public java.util.List<java.lang.String> getLocalDirsForRead()
public java.util.List<java.lang.String> getLocalDirsForCleanup()
public java.util.List<java.lang.String> getLogDirsForRead()
public java.util.List<java.lang.String> getLogDirsForCleanup()
public java.lang.String getDisksHealthReport(boolean listGoodDirs)
listGoodDirs - flag to determine whether the report should report the state of
good dirs or failed dirspublic java.lang.String getHealthReport()
HealthReportergetHealthReport in interface HealthReporterpublic boolean areDisksHealthy()
YarnConfiguration.NM_MIN_HEALTHY_DISKS_FRACTION, with a default
value of YarnConfiguration.DEFAULT_NM_MIN_HEALTHY_DISKS_FRACTION.public boolean isHealthy()
HealthReporterisHealthy in interface HealthReporterpublic long getLastDisksCheckTime()
public long getLastHealthReportTime()
HealthReportergetLastHealthReportTime in interface HealthReporterpublic boolean isGoodLocalDir(java.lang.String path)
public boolean isGoodLogDir(java.lang.String path)
@VisibleForTesting public void checkDirs()
public org.apache.hadoop.fs.Path getLocalPathForWrite(java.lang.String pathStr)
throws java.io.IOException
java.io.IOExceptionpublic org.apache.hadoop.fs.Path getLocalPathForWrite(java.lang.String pathStr,
long size,
boolean checkWrite)
throws java.io.IOException
java.io.IOExceptionpublic org.apache.hadoop.fs.Path getLocalPathForRead(java.lang.String pathStr)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Iterable<org.apache.hadoop.fs.Path> getAllLocalPathsForRead(java.lang.String pathStr)
throws java.io.IOException
java.io.IOExceptionpublic org.apache.hadoop.fs.Path getLogPathForWrite(java.lang.String pathStr,
boolean checkWrite)
throws java.io.IOException
java.io.IOExceptionpublic org.apache.hadoop.fs.Path getLogPathToRead(java.lang.String pathStr)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String[] validatePaths(java.lang.String[] paths)
protected void updateMetrics()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.