* @param seller_ids - Seller Ids
* @param bid_ids - ItemBid Ids
* @return
*/
public VoltTable run(TimestampType benchmarkTimes[], TimestampType startTime, TimestampType endTime) {
final TimestampType currentTime = AuctionMarkProfile.getScaledTimestamp(benchmarkTimes[0], benchmarkTimes[1], new TimestampType());
final boolean debug = LOG.isDebugEnabled();
if (debug) {
LOG.debug(String.format("startTime=%s, endTime=%s, currentTime=%s",
startTime, endTime, currentTime));
}
final VoltTable ret = new VoltTable(RESULT_COLS);
int closed_ctr = 0;
int waiting_ctr = 0;
int round = 10;
while (round-- > 0) {
voltQueueSQL(getDueItems, startTime, endTime);
final VoltTable[] dueItemsTable = voltExecuteSQL();
assert (1 == dueItemsTable.length);
if (dueItemsTable[0].getRowCount() == 0) break;
if (debug)
LOG.debug(String.format("Round #%02d - Due Items %d / %d\n%s\n",
round, dueItemsTable[0].getRowCount(), (closed_ctr+waiting_ctr), dueItemsTable[0]));
boolean with_bids[] = new boolean[dueItemsTable[0].getRowCount()];
Object output_rows[][] = new Object[with_bids.length][];
int i = 0;
while (dueItemsTable[0].advanceRow()) {
long itemId = dueItemsTable[0].getLong(0);
long sellerId = dueItemsTable[0].getLong(1);
double currentPrice = dueItemsTable[0].getDouble(2);
long numBids = dueItemsTable[0].getLong(3);
TimestampType endDate = dueItemsTable[0].getTimestampAsTimestamp(4);
ItemStatus itemStatus = ItemStatus.get(dueItemsTable[0].getLong(5));
if (debug)
LOG.debug(String.format("Getting max bid for itemId=%d / sellerId=%d", itemId, sellerId));
assert(itemStatus == ItemStatus.OPEN);