public class Worker extends Thread
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected HiveConf |
conf |
protected AtomicBoolean |
looped |
protected RawStore |
rs |
protected AtomicBoolean |
stop |
protected int |
threadId |
protected CompactionTxnHandler |
txnHandler |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
Worker() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
findUserToRunAs(String location,
Table t)
Determine which user to run an operation as, based on the owner of the directory to be
compacted.
|
static String |
hostname()
Get the hostname that this worker is run on.
|
void |
init(AtomicBoolean stop,
AtomicBoolean looped) |
protected Partition |
resolvePartition(CompactionInfo ci)
Get the partition being compacted.
|
protected StorageDescriptor |
resolveStorageDescriptor(Table t,
Partition p)
Get the storage descriptor for a compaction.
|
protected Table |
resolveTable(CompactionInfo ci)
Find the table being compacted
|
void |
run() |
protected boolean |
runJobAsSelf(String owner)
Determine whether to run this job as the current user or whether we need a doAs to switch
users.
|
void |
setHiveConf(HiveConf conf) |
void |
setThreadId(int threadId) |
protected String |
tableName(Table t) |
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, waitstartprotected HiveConf conf
protected CompactionTxnHandler txnHandler
protected RawStore rs
protected int threadId
protected AtomicBoolean stop
protected AtomicBoolean looped
public static String hostname()
public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException
init in interface MetaStoreThreadMetaExceptionpublic void setHiveConf(HiveConf conf)
setHiveConf in interface MetaStoreThreadpublic void setThreadId(int threadId)
setThreadId in interface MetaStoreThreadprotected Table resolveTable(CompactionInfo ci) throws MetaException
ci - compaction info returned from the compaction queueMetaException - if the table cannot be found.protected Partition resolvePartition(CompactionInfo ci) throws Exception
ci - compaction info returned from the compaction queueException - if underlying calls throw, or if the partition name resolves to more than
one partition.protected StorageDescriptor resolveStorageDescriptor(Table t, Partition p)
t - table from resolveTable(org.apache.hadoop.hive.metastore.txn.CompactionInfo)p - table from resolvePartition(org.apache.hadoop.hive.metastore.txn.CompactionInfo)protected String findUserToRunAs(String location, Table t) throws IOException, InterruptedException
location - directory that will be read or written to.t - metastore table objectIOException - if neither the hive metastore user nor the table owner can stat
the location.InterruptedExceptionprotected boolean runJobAsSelf(String owner)
owner - of the directory we will be working in, as determined by
findUserToRunAs(String, org.apache.hadoop.hive.metastore.api.Table)Copyright © 2016 The Apache Software Foundation. All rights reserved.