public class Context extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
cboInfo |
protected boolean |
cboSucceeded |
protected String |
cmd |
protected boolean |
explain |
protected boolean |
explainLogical |
protected HiveLockManager |
hiveLockMgr |
protected List<HiveLock> |
hiveLocks |
protected HiveTxnManager |
hiveTxnManager |
protected int |
pathid |
protected int |
tryCount |
Constructor and Description |
---|
Context(org.apache.hadoop.conf.Configuration conf) |
Context(org.apache.hadoop.conf.Configuration conf,
String executionId)
Create a Context with a given executionId.
|
Modifier and Type | Method and Description |
---|---|
void |
addCS(String path,
org.apache.hadoop.fs.ContentSummary cs) |
void |
clear() |
static String |
generateExecutionId()
Generate a unique executionId.
|
AcidUtils.Operation |
getAcidOperation() |
String |
getCboInfo() |
String |
getCmd()
Find the original query command.
|
org.apache.hadoop.conf.Configuration |
getConf() |
org.apache.hadoop.fs.ContentSummary |
getCS(org.apache.hadoop.fs.Path path) |
org.apache.hadoop.fs.ContentSummary |
getCS(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
|
org.apache.hadoop.fs.Path |
getExternalTmpPath(org.apache.hadoop.fs.Path path)
Get a path to store tmp data destined for external Path.
|
org.apache.hadoop.fs.Path |
getExtTmpPathRelTo(org.apache.hadoop.fs.Path path)
This is similar to getExternalTmpPath() with difference being this method returns temp path
within passed in uri, whereas getExternalTmpPath() ignores passed in path and returns temp
path within /tmp
|
List<HiveLock> |
getHiveLocks() |
HiveTxnManager |
getHiveTxnManager() |
Map<LoadTableDesc,WriteEntity> |
getLoadTableOutputMap() |
org.apache.hadoop.fs.Path |
getLocalScratchDir(boolean mkdir)
Create a local scratch directory on demand and return it.
|
org.apache.hadoop.fs.Path |
getLocalTmpPath()
Get a tmp path on local host to store intermediate data.
|
org.apache.hadoop.fs.Path |
getMRScratchDir()
Create a map-reduce scratch directory on demand and return it.
|
org.apache.hadoop.fs.Path |
getMRTmpPath()
Get a path to store map-reduce intermediate data in.
|
org.apache.hadoop.fs.Path |
getMRTmpPath(URI uri) |
Map<WriteEntity,List<HiveLockObj>> |
getOutputLockObjects() |
Map<String,org.apache.hadoop.fs.ContentSummary> |
getPathToCS() |
org.apache.hadoop.fs.Path |
getResDir() |
org.apache.hadoop.fs.Path |
getResFile() |
DataInput |
getStream() |
org.antlr.runtime.TokenRewriteStream |
getTokenRewriteStream() |
int |
getTryCount() |
boolean |
isCboSucceeded() |
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(String uriStr)
Check if path is for intermediate data
|
boolean |
isNeedLockMgr() |
void |
removeScratchDir()
Remove any created scratch directories.
|
void |
resetStream() |
void |
restoreOriginalTracker() |
void |
setAcidOperation(AcidUtils.Operation op) |
void |
setCboInfo(String cboInfo) |
void |
setCboSucceeded(boolean cboSucceeded) |
void |
setCmd(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 |
setHiveLocks(List<HiveLock> hiveLocks) |
void |
setHiveTxnManager(HiveTxnManager txnMgr) |
void |
setNeedLockMgr(boolean needLockMgr) |
void |
setOriginalTracker(String originalTracker) |
void |
setResDir(org.apache.hadoop.fs.Path resDir) |
void |
setResFile(org.apache.hadoop.fs.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 String cboInfo
protected boolean cboSucceeded
protected boolean explainLogical
protected String cmd
protected int tryCount
protected HiveLockManager hiveLockMgr
protected HiveTxnManager hiveTxnManager
public Context(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public Context(org.apache.hadoop.conf.Configuration conf, String executionId)
public Map<LoadTableDesc,WriteEntity> getLoadTableOutputMap()
public Map<WriteEntity,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(String cmd)
cmd
- the original query command stringpublic String getCmd()
public org.apache.hadoop.fs.Path getLocalScratchDir(boolean mkdir)
public org.apache.hadoop.fs.Path getMRScratchDir()
public void removeScratchDir()
public boolean isMRTmpFileURI(String uriStr)
public org.apache.hadoop.fs.Path getMRTmpPath(URI uri)
public org.apache.hadoop.fs.Path getMRTmpPath()
public org.apache.hadoop.fs.Path getLocalTmpPath()
public org.apache.hadoop.fs.Path getExternalTmpPath(org.apache.hadoop.fs.Path path)
path
- external Path to which the tmp data has to be eventually movedpublic org.apache.hadoop.fs.Path getExtTmpPathRelTo(org.apache.hadoop.fs.Path path)
public org.apache.hadoop.fs.Path getResFile()
public void setResFile(org.apache.hadoop.fs.Path resFile)
resFile
- the resFile to setpublic org.apache.hadoop.fs.Path getResDir()
public void setResDir(org.apache.hadoop.fs.Path resDir)
resDir
- the resDir to setpublic void clear() throws IOException
IOException
public DataInput getStream()
public void resetStream()
public void setTokenRewriteStream(org.antlr.runtime.TokenRewriteStream tokenRewriteStream)
tokenRewriteStream
- the stream being usedpublic org.antlr.runtime.TokenRewriteStream getTokenRewriteStream()
public static String generateExecutionId()
public boolean isLocalOnlyExecutionMode()
public HiveTxnManager getHiveTxnManager()
public void setHiveTxnManager(HiveTxnManager txnMgr)
public void setOriginalTracker(String originalTracker)
public void restoreOriginalTracker()
public void addCS(String path, org.apache.hadoop.fs.ContentSummary cs)
public org.apache.hadoop.fs.ContentSummary getCS(org.apache.hadoop.fs.Path path)
public org.apache.hadoop.fs.ContentSummary getCS(String path)
public org.apache.hadoop.conf.Configuration getConf()
public 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)
public void setAcidOperation(AcidUtils.Operation op)
public AcidUtils.Operation getAcidOperation()
public String getCboInfo()
public void setCboInfo(String cboInfo)
public boolean isCboSucceeded()
public void setCboSucceeded(boolean cboSucceeded)
Copyright © 2017 The Apache Software Foundation. All rights reserved.