@InterfaceAudience.Private public class StreamSlowMonitor extends Object implements ConfigurationObserver
Modifier and Type | Class and Description |
---|---|
private static class |
StreamSlowMonitor.PacketAckData |
Modifier and Type | Field and Description |
---|---|
private static String |
DATANODE_PACKET_FLUSH_CHECK_SPEED_MIN_DATA_LENGTH_KEY
Configure for the speed check of packet min length.
|
private static String |
DATANODE_SLOW_PACKET_FLUSH_MIN_SPEED_KEY
Configure for the check of large packet(which is configured by
DATANODE_PACKET_FLUSH_CHECK_SPEED_MIN_DATA_LENGTH_KEY ) flush speed. |
static String |
DATANODE_SLOW_PACKET_PROCESS_TIME_KEY
Configure for the slow packet process time, a duration from send to ACK.
|
private org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache<org.apache.hadoop.hdfs.protocol.DatanodeInfo,Deque<StreamSlowMonitor.PacketAckData>> |
datanodeSlowDataQueue |
private static long |
DEFAULT_DATANODE_PACKET_FLUSH_CHECK_SPEED_MIN_DATA_LENGTH |
private static double |
DEFAULT_DATANODE_SLOW_PACKET_FLUSH_MIN_SPEED |
private static long |
DEFAULT_DATANODE_SLOW_PACKET_PROCESS_TIME |
private static long |
DEFAULT_WAL_SLOW_DETECT_DATA_TTL |
private static int |
DEFAULT_WAL_SLOW_DETECT_MIN_COUNT |
private ExcludeDatanodeManager |
excludeDatanodeManager |
private static org.slf4j.Logger |
LOG |
private long |
minLengthForSpeedCheck |
private double |
minPacketFlushSpeedKBs |
private int |
minSlowDetectCount |
private String |
name |
private long |
slowDataTtl |
private long |
slowPacketAckMs |
private static String |
WAL_SLOW_DETECT_DATA_TTL_KEY
Configure for the TTL of the data that a datanode detected slow.
|
private static String |
WAL_SLOW_DETECT_MIN_COUNT_KEY
Configure for the min count for a datanode detected slow.
|
Constructor and Description |
---|
StreamSlowMonitor(org.apache.hadoop.conf.Configuration conf,
String name,
ExcludeDatanodeManager excludeDatanodeManager) |
Modifier and Type | Method and Description |
---|---|
private boolean |
addSlowAckData(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanodeInfo,
long dataLength,
long processTime) |
void |
checkProcessTimeAndSpeed(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanodeInfo,
long packetDataLen,
long processTimeMs,
long lastAckTimestamp,
int unfinished)
Check if the packet process time shows that the relevant datanode is a slow node.
|
static StreamSlowMonitor |
create(org.apache.hadoop.conf.Configuration conf,
String name) |
ExcludeDatanodeManager |
getExcludeDatanodeManager() |
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
This method would be called by the
ConfigurationManager object when the
Configuration object is reloaded from disk. |
private void |
setConf(org.apache.hadoop.conf.Configuration conf) |
private static final org.slf4j.Logger LOG
private static final String WAL_SLOW_DETECT_MIN_COUNT_KEY
ExcludeDatanodeManager.tryAddExcludeDN(DatanodeInfo, String)
of this regionsever.private static final int DEFAULT_WAL_SLOW_DETECT_MIN_COUNT
private static final String WAL_SLOW_DETECT_DATA_TTL_KEY
private static final long DEFAULT_WAL_SLOW_DETECT_DATA_TTL
private static final String DATANODE_PACKET_FLUSH_CHECK_SPEED_MIN_DATA_LENGTH_KEY
private static final long DEFAULT_DATANODE_PACKET_FLUSH_CHECK_SPEED_MIN_DATA_LENGTH
public static final String DATANODE_SLOW_PACKET_PROCESS_TIME_KEY
DATANODE_PACKET_FLUSH_CHECK_SPEED_MIN_DATA_LENGTH_KEY
private static final long DEFAULT_DATANODE_SLOW_PACKET_PROCESS_TIME
private static final String DATANODE_SLOW_PACKET_FLUSH_MIN_SPEED_KEY
DATANODE_PACKET_FLUSH_CHECK_SPEED_MIN_DATA_LENGTH_KEY
) flush speed.
e.g. If the configured slow packet process time is smaller than 10s, then here 20KB/s means
64KB should be processed in less than 3.2s.private static final double DEFAULT_DATANODE_SLOW_PACKET_FLUSH_MIN_SPEED
private final org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache<org.apache.hadoop.hdfs.protocol.DatanodeInfo,Deque<StreamSlowMonitor.PacketAckData>> datanodeSlowDataQueue
private final ExcludeDatanodeManager excludeDatanodeManager
private int minSlowDetectCount
private long slowDataTtl
private long slowPacketAckMs
private double minPacketFlushSpeedKBs
private long minLengthForSpeedCheck
public StreamSlowMonitor(org.apache.hadoop.conf.Configuration conf, String name, ExcludeDatanodeManager excludeDatanodeManager)
public static StreamSlowMonitor create(org.apache.hadoop.conf.Configuration conf, String name)
public void checkProcessTimeAndSpeed(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanodeInfo, long packetDataLen, long processTimeMs, long lastAckTimestamp, int unfinished)
datanodeInfo
- the datanode that processed the packetpacketDataLen
- the data length of the packet (in bytes)processTimeMs
- the process time (in ms) of the packet on the datanode,lastAckTimestamp
- the last acked timestamp of the packet on another datanodeunfinished
- if the packet is unfinished flushed to the datanode replicaspublic void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
ConfigurationObserver
ConfigurationManager
object when the
Configuration
object is reloaded from disk.onConfigurationChange
in interface ConfigurationObserver
private boolean addSlowAckData(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanodeInfo, long dataLength, long processTime)
private void setConf(org.apache.hadoop.conf.Configuration conf)
public ExcludeDatanodeManager getExcludeDatanodeManager()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.