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, yieldequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitstartpublic 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.Configurablepublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurablepublic void setThreadId(int threadId)
MetaStoreThreadsetThreadId in interface MetaStoreThreadthreadId - id of the threadpublic void init(AtomicBoolean stop, AtomicBoolean looped) throws org.apache.hadoop.hive.metastore.api.MetaException
MetaStoreThreadConfigurable.setConf(Configuration) and MetaStoreThread.setThreadId(int)
have been called.init in interface MetaStoreThreadstop - 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.org.apache.hadoop.hive.metastore.api.MetaExceptionpublic boolean runOneWorkerIteration(SessionState ss, String user, HiveConf conf, boolean doWait) throws InterruptedException
InterruptedExceptionpublic void waitForQueuedCommands()
throws InterruptedException
InterruptedExceptionpublic int getQueueLength()
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.