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 TypeMethodDescriptionint
Returns the ID of the scope when this helper is passed to aninstantiate
method otherwise-1
boolean
boolean
isProcedureReadOnly
(String procedureName) Test if a procedure is read only.void
Log a message in the system log at the debug log levelvoid
Log a message and throwable in the system log at the debug log levelvoid
Log a message in the system log at the error log levelvoid
Log a message and throwable in the system log at the error log levelvoid
Log a message in the system log at the info log levelvoid
Log a message and throwable in the system log at the info log levelvoid
logWarning
(String message) Log a message in the system log at the warning log levelvoid
logWarning
(String message, Throwable throwable) Log a message and throwable in the system log at the warning log levelvoid
validateProcedure
(CompoundErrors errors, boolean restrictProcedureByScope, String procedureName, Object[] parameters) Validate that a procedure withname
exists andparameters
are 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 aninstantiate
method otherwise-1
If
scope
isTaskScope.PARTITIONS
id
will be a partition ID. Ifscope
isTaskScope.HOSTS
id
will be a host ID. Otherwiseid
will be-1
- Returns:
- The ID of the scope
-
isDebugLoggingEnabled
boolean isDebugLoggingEnabled()- Returns:
true
if 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 withname
exists andparameters
are valid for that procedure.Note: parameter validation might not work for system procedures
- Parameters:
errors
-CompoundErrors
instance 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 withprocedureName
thenfalse
is returned- Parameters:
procedureName
- Name of procedure.- Returns:
true
ifprocedureName
is read only
-