Package org.openjdk.jmc.jdp.client
Class Pruner
- java.lang.Object
-
- org.openjdk.jmc.jdp.client.Pruner
-
- All Implemented Interfaces:
java.lang.Runnable
final class Pruner extends java.lang.Object implements java.lang.Runnable
This package private class prunes packets that have timed out, discovering lost services. This class is responsible for emittingDiscoveryEvent.Type
LOST events.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
DEFAULT_MAX_HB_TIME
(package private) static double
HB_MISSED_BEFORE_DOWN
This is how many heart beats to wait before considering the service down.private boolean
isRunning
(package private) int
maxHBTime
The maximum time to wait for the next heart beat, no matter what.private PacketProcessor
processor
(package private) static long
PRUNING_INTERVAL
How often to check for packets to mark as dead.
-
Constructor Summary
Constructors Constructor Description Pruner(PacketProcessor processor, int maxHBTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkPackets()
private void
remove(PacketProcessor.DiscoverableInfo info)
void
run()
void
stop()
-
-
-
Field Detail
-
PRUNING_INTERVAL
static final long PRUNING_INTERVAL
How often to check for packets to mark as dead.- See Also:
- Constant Field Values
-
DEFAULT_MAX_HB_TIME
static final int DEFAULT_MAX_HB_TIME
- See Also:
maxHBTime
, Constant Field Values
-
maxHBTime
final int maxHBTime
The maximum time to wait for the next heart beat, no matter what.
-
HB_MISSED_BEFORE_DOWN
static double HB_MISSED_BEFORE_DOWN
This is how many heart beats to wait before considering the service down.
-
isRunning
private volatile boolean isRunning
-
processor
private final PacketProcessor processor
-
-
Constructor Detail
-
Pruner
public Pruner(PacketProcessor processor, int maxHBTime)
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
checkPackets
private void checkPackets()
-
remove
private void remove(PacketProcessor.DiscoverableInfo info)
- Parameters:
key
- the descriptor to remove.
-
stop
public void stop()
-
-