|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
com.sun.slamd.job.JobClass
com.sun.slamd.example.SQLSearchRateJobClass
public class SQLSearchRateJobClass
This class implements a SLAMD job that can be used to measure the search performance of an SQL database. It should work with any database for which a JDBC driver exists.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static java.lang.String |
STAT_TRACKER_EXCEPTIONS_CAUGHT
The display name of the stat tracker that counts exceptions caught while processing queries. |
static java.lang.String |
STAT_TRACKER_QUERIES_COMPLETED
The display name of the stat tracker that tracks the rate at which queries are able to be processed. |
static java.lang.String |
STAT_TRACKER_QUERY_DURATION
The display name of the stat tracker that tracks the average length of time required to process a query. |
static java.lang.String |
STAT_TRACKER_ROWS_RETURNED
The display name of the stat tracker that tracks the average number of rows returned from each query. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
SQLSearchRateJobClass()
Creates a new instance of this SQL SearchRate job. |
|
| Method Summary | |
|---|---|
void |
destroy()
Try to force the thread to exit by closing the connection to the database and setting it to null. |
java.lang.String |
getJobCategoryName()
Retrieves the name of the category in which this job class should be classified. |
java.lang.String |
getJobDescription()
Retrieves a description for this job. |
java.lang.String |
getJobName()
Retrieves the display name for this job. |
ParameterList |
getParameterStubs()
Retrieves a parameter list that can be used to determine all the customizable options that are available for this job. |
java.lang.String |
getQueryVariableComponent()
Retrieves the next value that should be used for the variable portion of the query. |
StatTracker[] |
getStatTrackers()
Retrieves the set of stat trackers that have been maintained by this job. |
StatTracker[] |
getStatTrackerStubs(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval)
Retrieves the set of stat trackers that will be maintained by this job class. |
void |
initializeClient(java.lang.String clientID,
ParameterList parameters)
Performs one-time client initialization for this job, including assigning the values of the parameters to instance variables. |
void |
initializeThread(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
Performs one-time client initialization for this job, including assigning the values of the parameters to instance variables. |
boolean |
providesParameterTest()
Indicates whether this job class implements logic that makes it possible to test the validity of job parameters before scheduling the job for execution (e.g., to see if the server is reachable using the information provided). |
void |
runJob()
Perform the work of actually querying the database. |
boolean |
testJobParameters(ParameterList parameters,
java.util.ArrayList outputMessages)
Provides a means of testing the provided job parameters to determine whether they are valid (e.g., to see if the server is reachable) before scheduling the job for execution. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String STAT_TRACKER_EXCEPTIONS_CAUGHT
public static final java.lang.String STAT_TRACKER_QUERIES_COMPLETED
public static final java.lang.String STAT_TRACKER_QUERY_DURATION
public static final java.lang.String STAT_TRACKER_ROWS_RETURNED
| Constructor Detail |
|---|
public SQLSearchRateJobClass()
| Method Detail |
|---|
public java.lang.String getJobName()
getJobName in class JobClasspublic java.lang.String getJobDescription()
getJobDescription in class JobClasspublic java.lang.String getJobCategoryName()
getJobCategoryName in class JobClasspublic ParameterList getParameterStubs()
getParameterStubs in class JobClass
public StatTracker[] getStatTrackerStubs(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval)
getStatTrackerStubs in class JobClassclientID - The client ID that should be used for the
returned stat trackers.threadID - The thread ID that should be used for the
returned stat trackers.collectionInterval - The collection interval that should be used for
the returned stat trackers.
public StatTracker[] getStatTrackers()
getStatTrackers in class JobClasspublic boolean providesParameterTest()
providesParameterTest in class JobClasstrue if this job provides a means of testing the job
parameters, or false if not.
public boolean testJobParameters(ParameterList parameters,
java.util.ArrayList outputMessages)
testJobParameters in class JobClassparameters - The job parameters to be tested.outputMessages - The lines of output that were generated as part of
the testing process. Each line of output should
be added to this list as a separate string, and
empty strings (but not null values)
are allowed to provide separation between
different messages. No formatting should be
provided for these messages, however, since they
may be displayed in either an HTML or plain text
interface.
true if the test completed successfully, or
false if not. Note that even if the test did not
complete successfully, the user will be presented with a warning
but will still be allowed to schedule the job using the provided
parameters. This is necessary because the parameters may still be
valid even if the server couldn't validate them at the time the
job was scheduled (e.g., if the server wasn't running or could not
be reached by the SLAMD server even though it could be by the
clients).
public void initializeClient(java.lang.String clientID,
ParameterList parameters)
initializeClient in class JobClassclientID - The client ID for the current client.parameters - The set of parameters that have been defined for this
job.
public void initializeThread(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
initializeThread in class JobClassclientID - The client ID for the current client.threadID - The thread ID for the current thread.collectionInterval - The length of time in seconds to use as the
statistics collection interval.parameters - The set of parameters that have been defined
for this job.public void runJob()
runJob in class JobClasspublic void destroy()
null.
destroy in class JobClasspublic java.lang.String getQueryVariableComponent()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||