FileDocCategorySizeDatePackage
RepSelectByPrefTask.javaAPI DocApache Lucene 2.2.02666Sat Jun 16 22:20:58 BST 2007org.apache.lucene.benchmark.byTask.tasks

RepSelectByPrefTask

public class RepSelectByPrefTask extends RepSumByPrefTask
Report by-name-prefix statistics with no aggregations.
Other side effects: None.

Fields Summary
Constructors Summary
public RepSelectByPrefTask(org.apache.lucene.benchmark.byTask.PerfRunData runData)

    super(runData);
  
Methods Summary
public intdoLogic()

    Report rp = reportSelectByPrefix(getRunData().getPoints().taskStats());
    
    System.out.println();
    System.out.println("------------> Report Select By Prefix ("+prefix+") ("+
        rp.getSize()+" about "+rp.getReported()+" out of "+rp.getOutOf()+")");
    System.out.println(rp.getText());
    System.out.println();

    return 0;
  
protected org.apache.lucene.benchmark.byTask.stats.ReportreportSelectByPrefix(java.util.List taskStats)

    String longestOp = longestOp(taskStats.iterator());
    boolean first = true;
    StringBuffer sb = new StringBuffer();
    sb.append(tableTitle(longestOp));
    sb.append(newline);
    int reported = 0;
    for (Iterator it = taskStats.iterator(); it.hasNext();) {
      TaskStats stat = (TaskStats) it.next();
      if (stat.getElapsed()>=0 && stat.getTask().getName().startsWith(prefix)) { // only ended tasks with proper name
        reported++;
        if (!first) {
          sb.append(newline);
        }
        first = false;
        String line = taskReportLine(longestOp,stat);
        if (taskStats.size()>2 && reported%2==0) {
          line = line.replaceAll("   "," - ");
        }
        sb.append(line);
      }
    }
    String reptxt = (reported==0 ? "No Matching Entries Were Found!" : sb.toString());
    return new Report(reptxt,reported,reported, taskStats.size());