public abstract class PsApplication
extends java.lang.Object
PsTableGroup initialization and shutdown, as well as worker thread
spawning, registering, and de-registering. An application using this class
should extend from it and implement initialize() and
runWorkerThread(int). The application can then be started by
calling run(PsConfig).| Constructor and Description |
|---|
PsApplication() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
initialize()
This method is called after
PsTableGroup is initialized and
before any worker threads are spawned. |
void |
run(PsConfig config)
This method runs the application.
|
abstract void |
runWorkerThread(int threadId)
This method executes the code for a single worker thread.
|
public abstract void initialize()
PsTableGroup is initialized and
before any worker threads are spawned. Initialization tasks such as
table creation and data loading should be done here. Initializing
PsTableGroup is not required.public abstract void runWorkerThread(int threadId)
threadId - the local thread ID to run.public void run(PsConfig config)
initialize(), and finally spawns
numLocalWorkerThreads threads, each of which runs a single
instance of runWorkerThread(int). This method returns after all
worker threads have completed and PsTableGroup has been shut
down.config - the config object.