Methods Summary |
---|
public int | doLogic()
getRunData().getIndexWriter().addDocument(doc);
return 1;
|
private void | log(int count)
if (logStep<0) {
// avoid sync although race possible here
logStep = getRunData().getConfig().get("doc.add.log.step",DEFAULT_ADD_DOC_LOG_STEP);
}
if (logStep>0 && (count%logStep)==0) {
System.out.println("--> processed (add) "+count+" docs");
}
|
public void | setParams(java.lang.String params)Set the params (docSize only)
super.setParams(params);
docSize = (int) Float.parseFloat(params);
|
public void | setup()
/*
* (non-Javadoc)
* @see PerfTask#setup()
*/
super.setup();
DocMaker docMaker = getRunData().getDocMaker();
if (docSize > 0) {
doc = docMaker.makeDocument(docSize);
} else {
doc = docMaker.makeDocument();
}
|
public boolean | supportsParams()
return true;
|
public void | tearDown()
DocMaker docMaker = getRunData().getDocMaker();
log(docMaker.getCount());
doc = null;
super.tearDown();
|