|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.yahoo.ycsb.Workload
public abstract class Workload
One experiment scenario. One object of this type will be instantiated and shared among all client threads. This class should be constructed using a no-argument constructor, so we can load it dynamically. Any argument-based initialization should be done by init(). If you extend this class, you should support the "insertstart" property. This allows the load phase to proceed from multiple clients on different machines, in case the client is the bottleneck. For example, if we want to load 1 million records from 2 machines, the first machine should have insertstart=0 and the second insertstart=500000. Additionally, the "insertcount" property, which is interpreted by Client, can be used to tell each instance of the client how many inserts to do. In the example above, both clients should have insertcount=500000.
Field Summary | |
---|---|
static java.lang.String |
INSERT_START_PROPERTY
|
static java.lang.String |
INSERT_START_PROPERTY_DEFAULT
|
Constructor Summary | |
---|---|
Workload()
|
Method Summary | |
---|---|
void |
cleanup()
Cleanup the scenario. |
abstract boolean |
doInsert(DB db,
java.lang.Object threadstate)
Do one insert operation. |
abstract boolean |
doTransaction(DB db,
java.lang.Object threadstate)
Do one transaction operation. |
void |
init(java.util.Properties p)
Initialize the scenario. |
java.lang.Object |
initThread(java.util.Properties p,
int mythreadid,
int threadcount)
Initialize any state for a particular client thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String INSERT_START_PROPERTY
public static final java.lang.String INSERT_START_PROPERTY_DEFAULT
Constructor Detail |
---|
public Workload()
Method Detail |
---|
public void init(java.util.Properties p) throws WorkloadException
WorkloadException
public java.lang.Object initThread(java.util.Properties p, int mythreadid, int threadcount) throws WorkloadException
WorkloadException
public void cleanup() throws WorkloadException
WorkloadException
public abstract boolean doInsert(DB db, java.lang.Object threadstate)
public abstract boolean doTransaction(DB db, java.lang.Object threadstate)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |