本文整理汇总了Java中org.voltdb.VoltTable.add方法的典型用法代码示例。如果您正苦于以下问题:Java VoltTable.add方法的具体用法?Java VoltTable.add怎么用?Java VoltTable.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.voltdb.VoltTable
的用法示例。
在下文中一共展示了VoltTable.add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: storeData
import org.voltdb.VoltTable; //导入方法依赖的package包/类
/**
* Store Data from MapOutput table into reduceInput table
* ReduceInput table is the result of all incoming mapOutput table from other partitions
* @see edu.brown.hstore.txns.AbstractTransaction#storeData(int, org.voltdb.VoltTable)
*/
@Override
public synchronized Status storeData(int partition, VoltTable vt) {
VoltTable input = this.getReduceInputByPartition(partition);
assert(input != null);
if (debug.val)
LOG.debug(String.format("StoreData into Partition #%d: RowCount=%d ",
partition, vt.getRowCount()));
if (debug.val)
LOG.debug(String.format("<StoreData, change to ReduceInputTable> to Partition:%d>\n %s",partition,vt));
while (vt.advanceRow()) {
VoltTableRow row = vt.fetchRow(vt.getActiveRowIndex());
assert(row != null);
input.add(row);
}
vt.resetRowPosition();
return Status.OK;
}
示例2: combineTables
import org.voltdb.VoltTable; //导入方法依赖的package包/类
/**
* Combine multiple VoltTables into a single table
*
* @param vts
* @return
*/
public static VoltTable combineTables(final VoltTable... vts) {
assert (vts.length > 0);
ColumnInfo cols[] = new ColumnInfo[vts[0].getColumnCount()];
for (int i = 0; i < cols.length; i++) {
cols[i] = new ColumnInfo(vts[0].getColumnName(i), vts[0].getColumnType(i));
} // FOR
VoltTable ret = new VoltTable(cols);
for (VoltTable vt : vts) {
assert (vt.getColumnCount() == ret.getColumnCount());
vt.resetRowPosition();
while (vt.advanceRow()) {
ret.add(vt.cloneRow());
} // WHILE
} // FOR
return (ret);
}
示例3: makeCustomerName
import org.voltdb.VoltTable; //导入方法依赖的package包/类
private void makeCustomerName(VoltTable table) {
// Customer Name! Booyah! Shaq Attaq!
VoltTable batch = new VoltTable(table);
if (debug.val)
LOG.debug(String.format("Loading replicated CUSTOMER_NAME table [tuples=%d]", table.getRowCount()));
try {
for (int i = 0, cnt = table.getRowCount(); i < cnt; i++) {
if (this.stop) return;
batch.add(table.fetchRow(i));
if (batch.getRowCount() == replicated_batch_size) {
if (debug.val)
LOG.debug(String.format("Loading replicated CUSTOMER_NAME table [tuples=%d/%d]", i, cnt));
loadVoltTable("CUSTOMER_NAME", batch);
batch.clearRowData();
}
} // FOR
if (batch.getRowCount() > 0) {
loadVoltTable("CUSTOMER_NAME", batch);
batch.clearRowData();
}
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
table.clearRowData();
}
}
示例4: createSnapshotTargetsResults
import org.voltdb.VoltTable; //导入方法依赖的package包/类
private DependencySet createSnapshotTargetsResults(Map<Integer, List<VoltTable>> dependencies) {
{
LOG.trace("Aggregating create snapshot target results");
assert (dependencies.size() > 0);
List<VoltTable> dep = dependencies.get(DEP_createSnapshotTargets);
VoltTable result = null;
for (VoltTable table : dep) {
/**
* XXX Ning: There are two different tables here. We have to
* detect which table we are looking at in order to create the
* result table with the proper schema. Maybe we should make the
* result table consistent?
*/
if (result == null) {
if (table.getColumnType(2).equals(VoltType.INTEGER))
result = constructPartitionResultsTable();
else
result = constructNodeResultsTable();
}
while (table.advanceRow()) {
// this will add the active row of table
result.add(table);
}
}
LOG.trace("createSnapshotTargetsResults : " + "\n" + result);
return new DependencySet(DEP_createSnapshotTargetsResults, result);
}
}
示例5: saveTestResults
import org.voltdb.VoltTable; //导入方法依赖的package包/类
private DependencySet saveTestResults(Map<Integer, List<VoltTable>> dependencies) {
{
LOG.trace("Aggregating save feasiblity results");
assert (dependencies.size() > 0);
List<VoltTable> dep = dependencies.get(DEP_saveTest);
VoltTable result = constructNodeResultsTable();
for (VoltTable table : dep) {
while (table.advanceRow()) {
// this will add the active row of table
result.add(table);
}
}
return new DependencySet(DEP_saveTestResults, result);
}
}
示例6: createTrimmedResultSet
import org.voltdb.VoltTable; //导入方法依赖的package包/类
private JDBC4ResultSet createTrimmedResultSet(VoltTable input) throws SQLException
{
VoltTable result = input;
if (maxRows > 0 && input.getRowCount() > maxRows) {
VoltTable trimmed = new VoltTable(input.getTableSchema());
input.resetRowPosition();
for (int i = 0; i < maxRows; i++) {
input.advanceRow();
trimmed.add(input.cloneRow());
}
result = trimmed;
}
return new JDBC4ResultSet(this, result);
}