public class SamzaExecutor extends java.lang.Object implements SqlExecutor
| Constructor and Description |
|---|
SamzaExecutor() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String[]> |
consumeQueryResult(ExecutionContext context,
int startRow,
int endRow)
Consumes rows from query result.
|
NonQueryResult |
executeNonQuery(ExecutionContext context,
java.io.File sqlFile)
Executes all the NON-QUERY statements in the sqlFile.
|
NonQueryResult |
executeNonQuery(ExecutionContext context,
java.util.List<java.lang.String> statement) |
QueryResult |
executeQuery(ExecutionContext context,
java.lang.String statement) |
EnvironmentVariableHandler |
getEnvironmentVariableHandler() |
int |
getRowCount() |
org.apache.samza.sql.schema.SqlSchema |
getTableSchema(ExecutionContext context,
java.lang.String tableName) |
java.lang.String |
getVersion()
Gets the version of this executor.
|
java.util.List<SqlFunction> |
listFunctions(ExecutionContext context) |
java.util.List<java.lang.String> |
listTables(ExecutionContext context) |
ExecutionStatus |
queryExecutionStatus(int execId) |
void |
removeExecution(ExecutionContext context,
int exeId)
Removing an ongoing execution shall result in an error.
|
java.util.List<java.lang.String[]> |
retrieveQueryResult(ExecutionContext context,
int startRow,
int endRow)
Row starts at 0.
|
void |
start(ExecutionContext context)
SqlExecutor shall be ready to accept all other calls after start() is called.
|
void |
stop(ExecutionContext context)
Indicates no further calls will be made thus it's safe for the executor to clean up.
|
void |
stopExecution(ExecutionContext context,
int exeId) |
public void start(ExecutionContext context)
SqlExecutorstart in interface SqlExecutorcontext - The ExecutionContext at the time of the call.public void stop(ExecutionContext context) throws ExecutorException
SqlExecutorstop in interface SqlExecutorcontext - The ExecutionContext at the time of the call.ExecutorException - if the Executor encounters an error.public EnvironmentVariableHandler getEnvironmentVariableHandler()
getEnvironmentVariableHandler in interface SqlExecutorpublic java.util.List<java.lang.String> listTables(ExecutionContext context) throws ExecutorException
listTables in interface SqlExecutorcontext - The ExecutionContext at the time of the call.ExecutorException - if the Executor encounters an error.public org.apache.samza.sql.schema.SqlSchema getTableSchema(ExecutionContext context, java.lang.String tableName) throws ExecutorException
getTableSchema in interface SqlExecutorcontext - The ExecutionContext at the time of the call.tableName - Name of the table to get the schema for.ExecutorException - if the Executor encounters an error.public QueryResult executeQuery(ExecutionContext context, java.lang.String statement) throws ExecutorException
executeQuery in interface SqlExecutorcontext - The ExecutionContext at the time of the call.statement - statement to executeExecutorException - if the Executor encounters an error.public int getRowCount()
getRowCount in interface SqlExecutorpublic java.util.List<java.lang.String[]> retrieveQueryResult(ExecutionContext context, int startRow, int endRow)
SqlExecutorretrieveQueryResult in interface SqlExecutorcontext - The ExecutionContext at the time of the call.startRow - Start row index (inclusive)endRow - End row index (inclusive)public java.util.List<java.lang.String[]> consumeQueryResult(ExecutionContext context, int startRow, int endRow)
SqlExecutorconsumeQueryResult in interface SqlExecutorcontext - The ExecutionContext at the time of the call.startRow - Start row index (inclusive)endRow - End row index (inclusive)public NonQueryResult executeNonQuery(ExecutionContext context, java.io.File sqlFile) throws ExecutorException
SqlExecutorexecuteNonQuery in interface SqlExecutorcontext - The ExecutionContext at the time of the call.sqlFile - A File object to read statements from.ExecutorException - if the Executor encounters an error.public NonQueryResult executeNonQuery(ExecutionContext context, java.util.List<java.lang.String> statement) throws ExecutorException
executeNonQuery in interface SqlExecutorcontext - The ExecutionContext at the time of the call.statement - A list of non-query sql statements.ExecutorException - if the Executor encounters an error.public void stopExecution(ExecutionContext context, int exeId) throws ExecutorException
stopExecution in interface SqlExecutorcontext - The ExecutionContext at the time of the call.exeId - Execution ID.ExecutorException - if the Executor encounters an error.public void removeExecution(ExecutionContext context, int exeId) throws ExecutorException
SqlExecutorremoveExecution in interface SqlExecutorcontext - The ExecutionContext at the time of the callexeId - Execution ID.ExecutorException - if the Executor encounters an error.public ExecutionStatus queryExecutionStatus(int execId) throws ExecutorException
queryExecutionStatus in interface SqlExecutorexecId - Execution ID.ExecutorException - if the Executor encounters an error.public java.util.List<SqlFunction> listFunctions(ExecutionContext context)
listFunctions in interface SqlExecutorcontext - The ExecutionContext at the time of the call.public java.lang.String getVersion()
SqlExecutorgetVersion in interface SqlExecutor