org.apache.hadoop.hive.ql
Class Context

java.lang.Object
  extended by org.apache.hadoop.hive.ql.Context

public class Context
extends Object

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  boolean explain
           
protected  int pathid
           
protected  int randomid
           
 
Constructor Summary
Context()
           
Context(HiveConf conf)
           
 
Method Summary
 void clear()
           
 boolean getExplain()
          Find out whether the current query is an explain query
 String getExternalTmpFileURI(URI extURI)
          Get a path to store tmp data destined for external URI
 String getLocalTmpFileURI()
          Get a tmp path on local host to store intermediate data
 String getMRTmpFileURI()
          Get a path to store map-reduce intermediate data in
 org.apache.hadoop.fs.Path getResDir()
           
 org.apache.hadoop.fs.Path getResFile()
           
 DataInput getStream()
           
 boolean isMRTmpFileURI(String uriStr)
          check if path is tmp path.
 void setExplain(boolean value)
          Set the context on whether the current query is an explain query
 void setResDir(org.apache.hadoop.fs.Path resDir)
           
 void setResFile(org.apache.hadoop.fs.Path resFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

randomid

protected int randomid

pathid

protected int pathid

explain

protected boolean explain
Constructor Detail

Context

public Context()

Context

public Context(HiveConf conf)
Method Detail

setExplain

public void setExplain(boolean value)
Set the context on whether the current query is an explain query

Parameters:
value - true if the query is an explain query, false if not

getExplain

public boolean getExplain()
Find out whether the current query is an explain query

Returns:
true if the query is an explain query, false if not

isMRTmpFileURI

public boolean isMRTmpFileURI(String uriStr)
check if path is tmp path. the assumption is that all uri's relative to scratchdir are temporary

Returns:
true if a uri is a temporary uri for map-reduce intermediate data, false otherwise

getMRTmpFileURI

public String getMRTmpFileURI()
Get a path to store map-reduce intermediate data in

Returns:
next available path for map-red intermediate data

getLocalTmpFileURI

public String getLocalTmpFileURI()
Get a tmp path on local host to store intermediate data

Returns:
next available tmp path on local fs

getExternalTmpFileURI

public String getExternalTmpFileURI(URI extURI)
Get a path to store tmp data destined for external URI

Parameters:
extURI - external URI to which the tmp data has to be eventually moved
Returns:
next available tmp path on the file system corresponding extURI

getResFile

public org.apache.hadoop.fs.Path getResFile()
Returns:
the resFile

setResFile

public void setResFile(org.apache.hadoop.fs.Path resFile)
Parameters:
resFile - the resFile to set

getResDir

public org.apache.hadoop.fs.Path getResDir()
Returns:
the resDir

setResDir

public void setResDir(org.apache.hadoop.fs.Path resDir)
Parameters:
resDir - the resDir to set

clear

public void clear()
           throws IOException
Throws:
IOException

getStream

public DataInput getStream()


Copyright © 2009 The Apache Software Foundation