public class StatsUpdaterThread extends Thread implements MetaStoreThread
Modifier and Type | Class and Description |
---|---|
class |
StatsUpdaterThread.WorkerRunnable |
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected AtomicBoolean |
looped |
static String |
SKIP_STATS_AUTOUPDATE_PROPERTY |
protected AtomicBoolean |
stop |
protected int |
threadId |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
StatsUpdaterThread() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.conf.Configuration |
getConf() |
int |
getQueueLength() |
void |
init(AtomicBoolean stop,
AtomicBoolean looped)
Initialize the thread.
|
void |
run() |
boolean |
runOneWorkerIteration(SessionState ss,
String user,
HiveConf conf,
boolean doWait) |
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
setThreadId(int threadId)
Set the id for this thread.
|
void |
waitForQueuedCommands() |
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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
start
public static final String SKIP_STATS_AUTOUPDATE_PROPERTY
protected org.apache.hadoop.conf.Configuration conf
protected int threadId
protected AtomicBoolean stop
protected AtomicBoolean looped
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public void setThreadId(int threadId)
MetaStoreThread
setThreadId
in interface MetaStoreThread
threadId
- id of the threadpublic void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException
MetaStoreThread
Configurable.setConf(Configuration)
and MetaStoreThread.setThreadId(int)
have been called.init
in interface MetaStoreThread
stop
- a flag to watch for when to stop. If this value is set to true,
the thread will terminate the next time through its main loop.looped
- a flag that is set to true everytime a thread goes through it's main loop.
This is purely for testing so that tests can assure themselves that the thread
has run through it's loop once. The test can set this value to false. The
thread should then assure that the loop has been gone completely through at
least once.MetaException
public boolean runOneWorkerIteration(SessionState ss, String user, HiveConf conf, boolean doWait) throws InterruptedException
InterruptedException
public void waitForQueuedCommands() throws InterruptedException
InterruptedException
public int getQueueLength()
Copyright © 2019 The Apache Software Foundation. All rights reserved.