use of org.voltdb.VoltProcedure.VoltAbortException in project voltdb by VoltDB.
the class Site method loadTable.
@Override
public byte[] loadTable(long txnId, long spHandle, long uniqueId, String clusterName, String databaseName, String tableName, VoltTable data, boolean returnUniqueViolations, boolean shouldDRStream, boolean undo) throws VoltAbortException {
Cluster cluster = m_context.cluster;
if (cluster == null) {
throw new VoltAbortException("cluster '" + clusterName + "' does not exist");
}
Database db = cluster.getDatabases().get(databaseName);
if (db == null) {
throw new VoltAbortException("database '" + databaseName + "' does not exist in cluster " + clusterName);
}
Table table = db.getTables().getIgnoreCase(tableName);
if (table == null) {
throw new VoltAbortException("table '" + tableName + "' does not exist in database " + clusterName + "." + databaseName);
}
return loadTable(txnId, spHandle, uniqueId, table.getRelativeIndex(), data, returnUniqueViolations, shouldDRStream, undo);
}
use of org.voltdb.VoltProcedure.VoltAbortException in project voltdb by VoltDB.
the class TRURTruncateTable method run.
public VoltTable[] run(long p, byte shouldRollback) {
voltQueueSQL(truncate);
voltQueueSQL(count);
voltQueueSQL(scancount);
VoltTable[] results = voltExecuteSQL(true);
VoltTable data = results[1];
VoltTableRow row = data.fetchRow(0);
long optCount = row.getLong(0);
if (optCount != 0) {
throw new VoltAbortException("after truncate (opt) count not zero");
}
data = results[2];
row = data.fetchRow(0);
long scanCount = row.getLong(0);
if (scanCount != 0) {
throw new VoltAbortException("after truncate (scan) count not zero");
}
if (shouldRollback != 0) {
throw new VoltAbortException("EXPECTED ROLLBACK");
}
return results;
}
Aggregations