Search in sources :

Example 1 with TableDependencyPair

use of org.voltdb.DependencyPair.TableDependencyPair in project voltdb by VoltDB.

the class SwapTablesCore method executePlanFragment.

@Override
public DependencyPair executePlanFragment(Map<Integer, List<VoltTable>> dependencies, long fragmentId, ParameterSet params, SystemProcedureExecutionContext context) {
    VoltTable dummy = new VoltTable(STATUS_SCHEMA);
    dummy.addRow(STATUS_OK);
    if (fragmentId == SysProcFragmentId.PF_swapTables) {
        // issue the callback once on each node
        if (context.isLowestSiteId()) {
            VoltDB.instance().swapTables((String) params.getParam(0), (String) params.getParam(1));
        }
        return new TableDependencyPair(DEP_swapTables, dummy);
    } else if (fragmentId == SysProcFragmentId.PF_swapTablesAggregate) {
        return new TableDependencyPair(DEP_swapTablesAggregate, VoltTableUtil.unionTables(dependencies.get(DEP_swapTables)));
    }
    assert false;
    return null;
}
Also used : TableDependencyPair(org.voltdb.DependencyPair.TableDependencyPair) VoltTable(org.voltdb.VoltTable)

Aggregations

TableDependencyPair (org.voltdb.DependencyPair.TableDependencyPair)1 VoltTable (org.voltdb.VoltTable)1