public abstract class OperationThread extends HazelcastManagedThread implements StaticMetricsProvider
There are 2 flavors of OperationThread: - threads that deal with operations for a specific partition - threads that deal with non partition specific tasks
The actual processing of an operation is forwarded to the OperationRunner
.
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
OperationThread(String name,
int threadId,
OperationQueue queue,
ILogger logger,
NodeExtension nodeExtension,
boolean priority,
ClassLoader configClassLoader) |
Modifier and Type | Method and Description |
---|---|
void |
awaitTermination(int timeout,
TimeUnit unit) |
int |
getThreadId() |
abstract OperationRunner |
operationRunner(int partitionId) |
void |
provideStaticMetrics(MetricsRegistry registry) |
void |
run()
Manages the thread lifecycle and can be overridden to customize if needed.
|
void |
shutdown() |
afterRun, beforeRun, executeRun, setContextClassLoader
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public OperationThread(String name, int threadId, OperationQueue queue, ILogger logger, NodeExtension nodeExtension, boolean priority, ClassLoader configClassLoader)
public int getThreadId()
public abstract OperationRunner operationRunner(int partitionId)
public final void run()
HazelcastManagedThread
run
in interface Runnable
run
in class HazelcastManagedThread
public void provideStaticMetrics(MetricsRegistry registry)
provideStaticMetrics
in interface StaticMetricsProvider
public final void shutdown()
public final void awaitTermination(int timeout, TimeUnit unit) throws InterruptedException
InterruptedException
Copyright © 2019 Hazelcast, Inc.. All rights reserved.