void BackupRestore::cback(int result, restore_callback_t *cb) { if (result<0) { /** * Error. temporary or permanent? */ if (asynchErrorHandler(cb->connection, m_ndb)) { cb->retries++; tuple_a(cb); } else { ndbout_c("Restore: Failed to restore data " "due to a unrecoverable error. Exiting..."); delete m_ndb; delete cb->tup; exit(-1); } } else { /** * OK! close transaction */ m_ndb->closeTransaction(cb->connection); delete cb->tup; m_transactions--; } }
void BackupRestore::cback(int result, restore_callback_t *cb) { m_transactions--; if (result < 0) { /** * Error. temporary or permanent? */ if (errorHandler(cb)) tuple_a(cb); // retry else { err << "Restore: Failed to restore data due to a unrecoverable error. Exiting..." << endl; exitHandler(); } } else { /** * OK! close transaction */ m_ndb->closeTransaction(cb->connection); cb->connection= 0; cb->next= m_free_callback; m_free_callback= cb; m_dataCount++; } }
void BackupRestore::tuple(const TupleS & tup, Uint32 fragId) { if (!m_restore) { delete &tup; return; } restore_callback_t * cb = m_free_callback; if (cb) { m_free_callback = cb->next; cb->retries = 0; cb->fragId = fragId; cb->tup = &tup; tuple_a(cb); } if (m_free_callback == 0) { // send-poll all transactions // close transaction is done in callback m_ndb->sendPollNdb(3000, 1); } }
void BackupRestore::tuple(const TupleS & tup, Uint32 fragmentId) { if (!m_restore) return; while (m_free_callback == 0) { assert(m_transactions == m_parallelism); // send-poll all transactions // close transaction is done in callback m_ndb->sendPollNdb(3000, 1); } restore_callback_t * cb = m_free_callback; if (cb == 0) assert(false); m_free_callback = cb->next; cb->retries = 0; cb->fragId = fragmentId; cb->tup = tup; // must do copy! tuple_a(cb); }