Class LongGCDisruption
- java.lang.Object
-
- org.elasticsearch.test.disruption.SingleNodeDisruption
-
- org.elasticsearch.test.disruption.LongGCDisruption
-
- All Implemented Interfaces:
ServiceDisruptionScheme
- Direct Known Subclasses:
IntermittentLongGCDisruption
public class LongGCDisruption extends SingleNodeDisruption
Suspends all threads on the specified node in order to simulate a long gc.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
disruptedNode
-
Fields inherited from class org.elasticsearch.test.disruption.SingleNodeDisruption
cluster, logger, random
-
-
Constructor Summary
Constructors Constructor Description LongGCDisruption(java.util.Random random, java.lang.String disruptedNode)
-
Method Summary
Modifier and Type Method Description TimeValue
expectedTimeToHeal()
protected long
getBlockDetectionIntervalInMillis()
protected long
getSuspendingTimeoutInMillis()
protected java.util.regex.Pattern[]
getUnsafeClasses()
boolean
isBlockDetectionSupported()
boolean
isDisruptedNodeThread(java.lang.String threadName)
protected void
onBlockDetected(java.lang.management.ThreadInfo blockedThread, java.lang.management.ThreadInfo blockingThread)
void
removeAndEnsureHealthy(InternalTestCluster cluster)
protected void
resumeThreads(java.util.Set<java.lang.Thread> threads)
void
startDisrupting()
void
stopDisrupting()
protected boolean
suspendThreads(java.util.Set<java.lang.Thread> nodeThreads)
resolves all threads belonging to given node and suspends them if their current stack trace is "safe".-
Methods inherited from class org.elasticsearch.test.disruption.SingleNodeDisruption
applyToCluster, applyToNode, ensureNodeCount, removeFromCluster, removeFromNode, testClusterClosed
-
-
-
-
Method Detail
-
startDisrupting
public void startDisrupting()
-
isDisruptedNodeThread
public boolean isDisruptedNodeThread(java.lang.String threadName)
-
stopDisrupting
public void stopDisrupting()
-
removeAndEnsureHealthy
public void removeAndEnsureHealthy(InternalTestCluster cluster)
-
expectedTimeToHeal
public TimeValue expectedTimeToHeal()
-
suspendThreads
protected boolean suspendThreads(java.util.Set<java.lang.Thread> nodeThreads)
resolves all threads belonging to given node and suspends them if their current stack trace is "safe". Threads are added to nodeThreads if suspended. returns true if some live threads were found. The caller is expected to call this method until no more "live" are found.
-
getUnsafeClasses
protected java.util.regex.Pattern[] getUnsafeClasses()
-
getSuspendingTimeoutInMillis
protected long getSuspendingTimeoutInMillis()
-
isBlockDetectionSupported
public boolean isBlockDetectionSupported()
-
getBlockDetectionIntervalInMillis
protected long getBlockDetectionIntervalInMillis()
-
onBlockDetected
protected void onBlockDetected(java.lang.management.ThreadInfo blockedThread, @Nullable java.lang.management.ThreadInfo blockingThread)
-
resumeThreads
protected void resumeThreads(java.util.Set<java.lang.Thread> threads)
-
-