|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.ql.Context
public class Context
Context for Semantic Analyzers. Usage: not reusable - construct a new one for each query should call clear() at end of use to remove temporary folders
Field Summary | |
---|---|
protected String |
cmd
|
protected boolean |
explain
|
protected HiveLockManager |
hiveLockMgr
|
protected List<HiveLock> |
hiveLocks
|
protected int |
pathid
|
protected int |
tryCount
|
Constructor Summary | |
---|---|
Context(org.apache.hadoop.conf.Configuration conf)
|
|
Context(org.apache.hadoop.conf.Configuration conf,
String executionId)
Create a Context with a given executionId. |
Method Summary | |
---|---|
void |
addCS(String path,
org.apache.hadoop.fs.ContentSummary cs)
|
void |
clear()
|
static String |
generateExecutionId()
Generate a unique executionId. |
String |
getCmd()
Find the original query command. |
org.apache.hadoop.conf.Configuration |
getConf()
|
org.apache.hadoop.fs.ContentSummary |
getCS(String path)
|
boolean |
getExplain()
Find whether the current query is an explain query |
String |
getExternalTmpFileURI(URI extURI)
Get a path to store tmp data destined for external URI. |
HiveLockManager |
getHiveLockMgr()
|
List<HiveLock> |
getHiveLocks()
|
String |
getLocalScratchDir(boolean mkdir)
Create a local scratch directory on demand and return it. |
String |
getLocalTmpFileURI()
Get a tmp path on local host to store intermediate data. |
String |
getMRScratchDir()
Create a map-reduce scratch directory on demand and return it. |
String |
getMRTmpFileURI()
Get a path to store map-reduce intermediate data in. |
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 |
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 |
localizeKeys(Map<String,Object> map)
Given a mapping from paths to objects, localize any MR tmp paths |
String |
localizeMRTmpFileURI(String originalURI)
Given a URI for mapreduce intermediate output, swizzle the it to point to the local file system. |
void |
localizePaths(List<String> paths)
Given a list of paths, localize any MR tmp paths contained therein |
void |
restoreOriginalTracker()
|
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 |
setHDFSCleanup(boolean isHDFSCleanup)
|
void |
setHiveLockMgr(HiveLockManager hiveLockMgr)
|
void |
setHiveLocks(List<HiveLock> hiveLocks)
|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int pathid
protected boolean explain
protected String cmd
protected int tryCount
protected List<HiveLock> hiveLocks
protected HiveLockManager hiveLockMgr
Constructor Detail |
---|
public Context(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public Context(org.apache.hadoop.conf.Configuration conf, String executionId)
Method Detail |
---|
public void setExplain(boolean value)
value
- true if the query is an explain query, false if notpublic boolean getExplain()
public void setCmd(String cmd)
cmd
- the original query command stringpublic String getCmd()
public String getLocalScratchDir(boolean mkdir)
public String getMRScratchDir()
public boolean isMRTmpFileURI(String uriStr)
public String getMRTmpFileURI()
public String localizeMRTmpFileURI(String originalURI)
originalURI
- uri to localize
public String getLocalTmpFileURI()
public String getExternalTmpFileURI(URI extURI)
extURI
- external URI to which the tmp data has to be eventually moved
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 setTokenRewriteStream(org.antlr.runtime.TokenRewriteStream tokenRewriteStream)
tokenRewriteStream
- the stream being usedpublic org.antlr.runtime.TokenRewriteStream getTokenRewriteStream()
public static String generateExecutionId()
public boolean isLocalOnlyExecutionMode()
public List<HiveLock> getHiveLocks()
public void setHiveLocks(List<HiveLock> hiveLocks)
public HiveLockManager getHiveLockMgr()
public void setHiveLockMgr(HiveLockManager hiveLockMgr)
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(String path)
public Map<String,org.apache.hadoop.fs.ContentSummary> getPathToCS()
public org.apache.hadoop.conf.Configuration getConf()
public void localizeKeys(Map<String,Object> map)
map
- mapping from paths to objectspublic void localizePaths(List<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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |