net.sf.sparql.benchmarking.operations.util
Class SleepOperation

java.lang.Object
  extended by net.sf.sparql.benchmarking.operations.AbstractOperation
      extended by net.sf.sparql.benchmarking.operations.util.SleepOperation
All Implemented Interfaces:
Operation

public class SleepOperation
extends AbstractOperation

Creates a new sleep operation

Author:
rvesse

Constructor Summary
SleepOperation(long sleep)
          Creates a new sleep operation
SleepOperation(String name, long sleep)
          Creates a new sleep operation
 
Method Summary
<T extends Options>
boolean
canRun(Runner<T> runner, T options)
          Report whether the operation can run based on the available options
<T extends Options>
OperationCallable<T>
createCallable(Runner<T> runner, T options)
          Creates the callable for running the operation in a background thread
 OperationRun createErrorInformation(String message, int category, long runtime)
          Creates run information for an error
 String getContentString()
          Gets a string that shows the content of the operation e.g.
 String getType()
          Gets a descriptive type string for the operation e.g.
 
Methods inherited from class net.sf.sparql.benchmarking.operations.AbstractOperation
getId, getName, getStats, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SleepOperation

public SleepOperation(long sleep)
Creates a new sleep operation

Parameters:
sleep - Sleep time in seconds

SleepOperation

public SleepOperation(String name,
                      long sleep)
Creates a new sleep operation

Parameters:
name - Name
sleep - Sleep time in seconds
Method Detail

canRun

public <T extends Options> boolean canRun(Runner<T> runner,
                                          T options)
Description copied from interface: Operation
Report whether the operation can run based on the available options

Parameters:
runner - Runner
options - Options
Returns:
True if the operation can run, false otherwise

getType

public String getType()
Description copied from interface: Operation
Gets a descriptive type string for the operation e.g. SPARQL Query

Returns:
Type string

getContentString

public String getContentString()
Description copied from interface: Operation
Gets a string that shows the content of the operation e.g. SPARQL Query string, SPARQL Update string etc.

Returns:
Content string

createCallable

public <T extends Options> OperationCallable<T> createCallable(Runner<T> runner,
                                                               T options)
Description copied from interface: Operation
Creates the callable for running the operation in a background thread

Parameters:
runner - Runner
options - Options
Returns:
Callable

createErrorInformation

public OperationRun createErrorInformation(String message,
                                           int category,
                                           long runtime)
Description copied from interface: Operation
Creates run information for an error

Parameters:
message - Error message
category - Error category
runtime - Runtime
Returns:
Error information


Copyright © 2014. All Rights Reserved.