本文整理汇总了Java中org.voltdb.VoltTable.getTimestampAsTimestamp方法的典型用法代码示例。如果您正苦于以下问题:Java VoltTable.getTimestampAsTimestamp方法的具体用法?Java VoltTable.getTimestampAsTimestamp怎么用?Java VoltTable.getTimestampAsTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.voltdb.VoltTable
的用法示例。
在下文中一共展示了VoltTable.getTimestampAsTimestamp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadItems
import org.voltdb.VoltTable; //导入方法依赖的package包/类
private final void loadItems(VoltTable vt, ItemStatus status) {
int ctr = 0;
while (vt.advanceRow()) {
int col = 0;
ItemId i_id = new ItemId(vt.getLong(col++));
double i_current_price = vt.getDouble(col++);
TimestampType i_end_date = vt.getTimestampAsTimestamp(col++);
int i_num_bids = (int)vt.getLong(col++);
ItemStatus i_status = ItemStatus.get(vt.getLong(col++));
assert(i_status == status);
ItemInfo itemInfo = new ItemInfo(i_id, i_current_price, i_end_date, i_num_bids);
this.addItemToProperQueue(itemInfo, false);
ctr++;
} // WHILE
if (debug.val)
LOG.debug(String.format("Loaded %d records from %s",
ctr, AuctionMarkConstants.TABLENAME_ITEM));
}
示例2: processItemRecord
import org.voltdb.VoltTable; //导入方法依赖的package包/类
/**
* For the given VoltTable that contains ITEM records, process the current
* row of that table and update the benchmark profile based on item information
* stored in that row.
* @param vt
* @return
*/
public ItemId processItemRecord(VoltTable vt) {
ItemId itemId = new ItemId(vt.getLong("i_id"));
TimestampType endDate = vt.getTimestampAsTimestamp("i_end_date");
short numBids = (short)vt.getLong("i_num_bids");
double currentPrice = vt.getDouble("i_current_price");
ItemInfo itemInfo = new ItemInfo(itemId, currentPrice, endDate, numBids);
if (vt.hasColumn("ip_id")) itemInfo.status = ItemStatus.CLOSED;
if (vt.hasColumn("i_status")) itemInfo.status = ItemStatus.get(vt.getLong("i_status"));
UserId sellerId = new UserId(vt.getLong("i_u_id"));
assert (itemId.getSellerId().equals(sellerId));
ItemStatus qtype = profile.addItemToProperQueue(itemInfo, false);
this.updated.put(qtype);
return (itemId);
}
示例3: loadConfigProfile
import org.voltdb.VoltTable; //导入方法依赖的package包/类
private final void loadConfigProfile(VoltTable vt) {
boolean adv = vt.advanceRow();
assert(adv);
int col = 0;
this.scale_factor = vt.getDouble(col++);
this.benchmarkStartTime = vt.getTimestampAsTimestamp(col++);
JSONUtil.fromJSONString(this.users_per_item_count, vt.getString(col++));
if (debug.val)
LOG.debug(String.format("Loaded %s data", AuctionMarkConstants.TABLENAME_CONFIG_PROFILE));
}