class TunnelGatewayPumper extends Object implements Runnable
| Constructor and Description |
|---|
TunnelGatewayPumper(RouterContext ctx)Creates a new TunnelGatewayPumper and starts configured number of pump threads. |
| Modifier and Type | Method and Description |
|---|---|
static void | adjustRunningThreads(int newCount)Adjust the running instance's thread count. |
void | adjustThreads(int newCount)Dynamically adjust the number of pumper threads. |
int | getActiveCount()Get the number of pumper threads actively processing (not parked on take()). |
double | getInstanceUtilization()Get pumper pool utilization as a ratio (0.0-1.0). |
static int | getMaxPumpers()Get the current max pumper threads. |
static int | getQueueCapacity()Get the current pumper queue capacity. |
static long | getRequeueTime() |
static double | getUtilization()Get pumper pool utilization as a ratio (0.0-1.0). |
void | resizeQueue(int newCapacity)Resize the pumper queue. |
static void | resizeRunningQueue(int newCapacity)Resize the running instance's queue. |
void | run()Primary thread run loop. |
static void | setMaxPumpers(int max)Set the max pumper threads. |
static void | setQueueCapacity(int capacity)Set the pumper queue capacity. |
static void | setRequeueTime(long ms) |
void | stopPumping()Requests a graceful stop for pump threads. |
void | wantsPumping(PumpedTunnelGateway gw)Requests pumping for a gateway. |
public TunnelGatewayPumper(RouterContext ctx)
ctx - the router contextpublic static void adjustRunningThreads(int newCount)
newCount - desired thread countpublic void adjustThreads(int newCount)
newCount - desired thread countpublic int getActiveCount()
public double getInstanceUtilization()
public static int getMaxPumpers()
public static int getQueueCapacity()
public static long getRequeueTime()
public static double getUtilization()
public void resizeQueue(int newCapacity)
newCapacity - new queue capacitypublic static void resizeRunningQueue(int newCapacity)
newCapacity - new capacitypublic void run()
public static void setMaxPumpers(int max)
public static void setQueueCapacity(int capacity)
resizeQueue(int) to apply to running instance.public static void setRequeueTime(long ms)
public void stopPumping()
public void wantsPumping(PumpedTunnelGateway gw)
gw - the gateway to pump