if (trace.val) LOG.trace(String.format("%s: Loading %d new rows - TOTAL %d [bytes=%d/%d]",
tableName.toUpperCase(), rowCount, rowTotal, byteCount, byteTotal));
// Load up this dirty mess...
ClientResponse cr = null;
if (m_noUploading == false) {
boolean locked = m_hstoreConf.client.blocking_loader;
if (locked) m_loaderBlock.lock();
try {
int tries = 3;
String procName = VoltSystemProcedure.procCallName(LoadMultipartitionTable.class);
while (tries-- > 0) {
try {
cr = m_voltClient.callProcedure(procName, tableName, vt);
} catch (ProcCallException ex) {
// If this thing was rejected, then we'll allow us to try again.
cr = ex.getClientResponse();
if (cr.getStatus() == Status.ABORT_REJECT && tries > 0) {
if (debug.val)
LOG.warn(String.format("Loading data for %s was rejected. Going to try again\n%s",
tableName, cr.toString()));
continue;
}
// Anything else needs to be thrown out of here
throw ex;
}
break;
} // WHILE
} catch (Throwable ex) {
throw new RuntimeException("Error when trying load data for '" + tableName + "'", ex);
} finally {
if (locked) m_loaderBlock.unlock();
} // SYNCH
assert(cr != null);
assert(cr.getStatus() == Status.OK);
if (trace.val) LOG.trace(String.format("Load %s: txn #%d / %s / %d",
tableName, cr.getTransactionId(), cr.getStatus(), cr.getClientHandle()));
} else {
cr = m_dummyResponse;
}
if (cr.getStatus() != Status.OK) {
LOG.warn(String.format("Failed to load %d rows for '%s': %s",
rowCount, tableName, cr.getStatusString()), cr.getException());
return (cr);
}
m_tableTuples.put(tableName, rowCount);
m_tableBytes.put(tableName, byteCount);
// Keep track of table stats
if (m_tableStats && cr.getStatus() == Status.OK) {
final CatalogContext catalogContext = this.getCatalogContext();
assert(catalogContext != null);
final Table catalog_tbl = catalogContext.getTableByName(tableName);
assert(catalog_tbl != null) : "Invalid table name '" + tableName + "'";