|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.ql.Driver
public class Driver
Field Summary | |
---|---|
protected int |
tryCount
|
Constructor Summary | |
---|---|
Driver()
|
|
Driver(HiveConf conf)
for backwards compatibility with current tests |
Method Summary | |
---|---|
int |
acquireReadWriteLocks()
Acquire read and write locks needed by the statement. |
int |
close()
|
int |
compile(String command)
Compile a new query. |
int |
compile(String command,
boolean resetTaskIds)
Compile a new query, but potentially reset taskID counter. |
void |
destroy()
|
int |
execute()
|
org.apache.hadoop.mapred.ClusterStatus |
getClusterStatus()
Return the status information about the Map-Reduce cluster |
int |
getMaxRows()
Return the maximum number of rows returned by getResults |
QueryPlan |
getPlan()
|
Query |
getQueryPlan()
|
boolean |
getResults(ArrayList<String> res)
|
Schema |
getSchema()
|
static Schema |
getSchema(BaseSemanticAnalyzer sem,
HiveConf conf)
Get a Schema with fields represented with native Hive types |
Schema |
getThriftSchema()
Get a Schema with fields represented with Thrift DDL types |
int |
getTryCount()
|
boolean |
hasReduceTasks(List<Task<? extends Serializable>> tasks)
|
void |
init()
|
void |
launchTask(Task<? extends Serializable> tsk,
String queryId,
boolean noName,
Map<TaskResult,TaskRunner> running,
String jobname,
int jobs,
DriverContext cxt)
Launches a new task |
TaskResult |
pollTasks(Set<TaskResult> results)
Polls running tasks to see if a task has ended. |
void |
restoreSession(org.apache.hadoop.hive.ql.Driver.QueryState qs)
|
CommandProcessorResponse |
run(String command)
|
void |
saveSession(org.apache.hadoop.hive.ql.Driver.QueryState qs)
|
void |
setMaxRows(int maxRows)
Set the maximum number of rows returned by getResults |
void |
setTryCount(int tryCount)
|
void |
taskCleanup()
Cleans up remaining tasks in case of failure |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int tryCount
Constructor Detail |
---|
public Driver(HiveConf conf)
public Driver()
Method Detail |
---|
public void init()
init
in interface CommandProcessor
public org.apache.hadoop.mapred.ClusterStatus getClusterStatus() throws Exception
Exception
public Schema getSchema()
public static Schema getSchema(BaseSemanticAnalyzer sem, HiveConf conf)
public Schema getThriftSchema() throws Exception
Exception
public int getMaxRows()
public void setMaxRows(int maxRows)
public boolean hasReduceTasks(List<Task<? extends Serializable>> tasks)
public int compile(String command)
command
- The SQL query to compile.public void saveSession(org.apache.hadoop.hive.ql.Driver.QueryState qs)
public void restoreSession(org.apache.hadoop.hive.ql.Driver.QueryState qs)
public int compile(String command, boolean resetTaskIds)
command
- The HiveQL query to compileresetTaskIds
- Resets taskID counter if true.
public QueryPlan getPlan()
public int acquireReadWriteLocks()
public CommandProcessorResponse run(String command) throws CommandNeedRetryException
run
in interface CommandProcessor
CommandNeedRetryException
public int execute() throws CommandNeedRetryException
CommandNeedRetryException
public void launchTask(Task<? extends Serializable> tsk, String queryId, boolean noName, Map<TaskResult,TaskRunner> running, String jobname, int jobs, DriverContext cxt)
tsk
- task being launchedqueryId
- Id of the query containing the tasknoName
- whether the task has a name setrunning
- map from taskresults to taskrunnersjobname
- name of the task, if it is a map-reduce jobjobs
- number of map-reduce jobscxt
- the driver contextpublic void taskCleanup()
public TaskResult pollTasks(Set<TaskResult> results)
results
- Set of result objects for running tasks
public boolean getResults(ArrayList<String> res) throws IOException, CommandNeedRetryException
IOException
CommandNeedRetryException
public int getTryCount()
public void setTryCount(int tryCount)
public int close()
public void destroy()
public Query getQueryPlan() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |