public class Context
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
cmd |
protected boolean |
explain |
protected boolean |
explainLogical |
protected HiveLockManager |
hiveLockMgr |
protected java.util.List<HiveLock> |
hiveLocks |
protected int |
pathid |
protected int |
tryCount |
Constructor and Description |
---|
Context(Configuration conf) |
Context(Configuration conf,
java.lang.String executionId)
Create a Context with a given executionId.
|
Modifier and Type | Method and Description |
---|---|
void |
addCS(java.lang.String path,
ContentSummary cs) |
void |
clear() |
static java.lang.String |
generateExecutionId()
Generate a unique executionId.
|
java.lang.String |
getCmd()
Find the original query command.
|
Configuration |
getConf() |
ContentSummary |
getCS(Path path) |
ContentSummary |
getCS(java.lang.String path) |
boolean |
getExplain()
Find whether the current query is an explain query
|
boolean |
getExplainLogical()
Find whether the current query is a logical explain query
|
java.lang.String |
getExternalTmpFileURI(java.net.URI extURI)
Get a path to store tmp data destined for external URI.
|
HiveLockManager |
getHiveLockMgr() |
java.util.List<HiveLock> |
getHiveLocks() |
java.util.Map<LoadTableDesc,WriteEntity> |
getLoadTableOutputMap() |
java.lang.String |
getLocalScratchDir(boolean mkdir)
Create a local scratch directory on demand and return it.
|
java.lang.String |
getLocalTmpFileURI()
Get a tmp path on local host to store intermediate data.
|
java.lang.String |
getMRScratchDir()
Create a map-reduce scratch directory on demand and return it.
|
java.lang.String |
getMRTmpFileURI()
Get a path to store map-reduce intermediate data in.
|
java.util.Map<WriteEntity,java.util.List<HiveLockObj>> |
getOutputLockObjects() |
java.util.Map<java.lang.String,ContentSummary> |
getPathToCS() |
Path |
getResDir() |
Path |
getResFile() |
java.io.DataInput |
getStream() |
org.antlr.runtime.TokenRewriteStream |
getTokenRewriteStream() |
int |
getTryCount() |
boolean |
isHDFSCleanup() |
boolean |
isLocalOnlyExecutionMode()
Does Hive wants to run tasks entirely on the local machine
(where the query is being compiled)?
Today this translates into running hadoop jobs locally
|
boolean |
isMRTmpFileURI(java.lang.String uriStr)
Check if path is for intermediate data
|
boolean |
isNeedLockMgr() |
void |
localizeKeys(java.util.Map<java.lang.String,java.lang.Object> map)
Given a mapping from paths to objects, localize any MR tmp paths
|
java.lang.String |
localizeMRTmpFileURI(java.lang.String originalURI)
Given a URI for mapreduce intermediate output, swizzle the
it to point to the local file system.
|
void |
localizePaths(java.util.List<java.lang.String> paths)
Given a list of paths, localize any MR tmp paths contained therein
|
void |
restoreOriginalTracker() |
void |
setCmd(java.lang.String cmd)
Set the original query command.
|
void |
setExplain(boolean value)
Set the context on whether the current query is an explain query.
|
void |
setExplainLogical(boolean explainLogical)
Set the context on whether the current query is a logical
explain query.
|
void |
setHDFSCleanup(boolean isHDFSCleanup) |
void |
setHiveLockMgr(HiveLockManager hiveLockMgr) |
void |
setHiveLocks(java.util.List<HiveLock> hiveLocks) |
void |
setNeedLockMgr(boolean needLockMgr) |
void |
setOriginalTracker(java.lang.String originalTracker) |
void |
setResDir(Path resDir) |
void |
setResFile(Path resFile) |
void |
setTokenRewriteStream(org.antlr.runtime.TokenRewriteStream tokenRewriteStream)
Set the token rewrite stream being used to parse the current top-level SQL
statement.
|
void |
setTryCount(int tryCount) |
protected int pathid
protected boolean explain
protected boolean explainLogical
protected java.lang.String cmd
protected int tryCount
protected java.util.List<HiveLock> hiveLocks
protected HiveLockManager hiveLockMgr
public Context(Configuration conf) throws java.io.IOException
java.io.IOException
public Context(Configuration conf, java.lang.String executionId)
public java.util.Map<LoadTableDesc,WriteEntity> getLoadTableOutputMap()
public java.util.Map<WriteEntity,java.util.List<HiveLockObj>> getOutputLockObjects()
public void setExplain(boolean value)
value
- true if the query is an explain query, false if notpublic boolean getExplain()
public boolean getExplainLogical()
public void setExplainLogical(boolean explainLogical)
public void setCmd(java.lang.String cmd)
cmd
- the original query command stringpublic java.lang.String getCmd()
public java.lang.String getLocalScratchDir(boolean mkdir)
public java.lang.String getMRScratchDir()
public boolean isMRTmpFileURI(java.lang.String uriStr)
public java.lang.String getMRTmpFileURI()
public java.lang.String localizeMRTmpFileURI(java.lang.String originalURI)
originalURI
- uri to localizepublic java.lang.String getLocalTmpFileURI()
public java.lang.String getExternalTmpFileURI(java.net.URI extURI)
extURI
- external URI to which the tmp data has to be eventually movedpublic Path getResFile()
public void setResFile(Path resFile)
resFile
- the resFile to setpublic Path getResDir()
public void setResDir(Path resDir)
resDir
- the resDir to setpublic void clear() throws java.io.IOException
java.io.IOException
public java.io.DataInput getStream()
public void setTokenRewriteStream(org.antlr.runtime.TokenRewriteStream tokenRewriteStream)
tokenRewriteStream
- the stream being usedpublic org.antlr.runtime.TokenRewriteStream getTokenRewriteStream()
public static java.lang.String generateExecutionId()
public boolean isLocalOnlyExecutionMode()
public java.util.List<HiveLock> getHiveLocks()
public void setHiveLocks(java.util.List<HiveLock> hiveLocks)
public HiveLockManager getHiveLockMgr()
public void setHiveLockMgr(HiveLockManager hiveLockMgr)
public void setOriginalTracker(java.lang.String originalTracker)
public void restoreOriginalTracker()
public void addCS(java.lang.String path, ContentSummary cs)
public ContentSummary getCS(Path path)
public ContentSummary getCS(java.lang.String path)
public java.util.Map<java.lang.String,ContentSummary> getPathToCS()
public Configuration getConf()
public void localizeKeys(java.util.Map<java.lang.String,java.lang.Object> map)
map
- mapping from paths to objectspublic void localizePaths(java.util.List<java.lang.String> paths)
paths
- list of paths to be localizedpublic boolean isHDFSCleanup()
public void setHDFSCleanup(boolean isHDFSCleanup)
isHDFSCleanup
- the isHDFSCleanup to setpublic boolean isNeedLockMgr()
public void setNeedLockMgr(boolean needLockMgr)
public int getTryCount()
public void setTryCount(int tryCount)
Copyright © 2012 The Apache Software Foundation