Package org.voltdb.task
Interface TaskHelper
public interface TaskHelper
Helper interface passed to
IntervalGenerator, ActionGenerator and ActionScheduler instances for
calling in to the volt system to perform logging, validation and other operations-
Method Summary
Modifier and TypeMethodDescriptionintReturns the ID of the scope when this helper is passed to aninstantiatemethod otherwise-1booleanbooleanisProcedureReadOnly(String procedureName) Test if a procedure is read only.voidLog a message in the system log at the debug log levelvoidLog a message and throwable in the system log at the debug log levelvoidLog a message in the system log at the error log levelvoidLog a message and throwable in the system log at the error log levelvoidLog a message in the system log at the info log levelvoidLog a message and throwable in the system log at the info log levelvoidlogWarning(String message) Log a message in the system log at the warning log levelvoidlogWarning(String message, Throwable throwable) Log a message and throwable in the system log at the warning log levelvoidvalidateProcedure(CompoundErrors errors, boolean restrictProcedureByScope, String procedureName, Object[] parameters) Validate that a procedure withnameexists andparametersare valid for that procedure.
-
Method Details
-
getTaskName
String getTaskName()- Returns:
- The name of the task
-
getTaskScope
TaskScope getTaskScope()- Returns:
- The scope in which the task will be executing
-
getScopeId
int getScopeId()Returns the ID of the scope when this helper is passed to aninstantiatemethod otherwise-1If
scopeisTaskScope.PARTITIONSidwill be a partition ID. IfscopeisTaskScope.HOSTSidwill be a host ID. Otherwiseidwill be-1- Returns:
- The ID of the scope
-
isDebugLoggingEnabled
boolean isDebugLoggingEnabled()- Returns:
trueif debug logging is enabled
-
logDebug
Log a message in the system log at the debug log level- Parameters:
message- to log
-
logDebug
Log a message and throwable in the system log at the debug log level- Parameters:
message- to logthrowable- to log along withmessage
-
logInfo
Log a message in the system log at the info log level- Parameters:
message- to log
-
logInfo
Log a message and throwable in the system log at the info log level- Parameters:
message- to logthrowable- to log along withmessage
-
logWarning
Log a message in the system log at the warning log level- Parameters:
message- to log
-
logWarning
Log a message and throwable in the system log at the warning log level- Parameters:
message- to logthrowable- to log along withmessage
-
logError
Log a message in the system log at the error log level- Parameters:
message- to log
-
logError
Log a message and throwable in the system log at the error log level- Parameters:
message- to logthrowable- to log along withmessage
-
validateProcedure
void validateProcedure(CompoundErrors errors, boolean restrictProcedureByScope, String procedureName, Object[] parameters) Validate that a procedure withnameexists andparametersare valid for that procedure.Note: parameter validation might not work for system procedures
- Parameters:
errors-CompoundErrorsinstance to collect errorsrestrictProcedureByScope- If true type of procedures will be restricted. SeeActionGeneratorBase.restrictProcedureByScope()procedureName- Name of procedure to validateparameters- that will be passed toname
-
isProcedureReadOnly
Test if a procedure is read only. If a procedure cannot be found withprocedureNamethenfalseis returned- Parameters:
procedureName- Name of procedure.- Returns:
trueifprocedureNameis read only
-