| 1435 | } |
| 1436 | |
| 1437 | Status ClientRequestState::RestartFetch() { |
| 1438 | // No result caching for this query. Restart is invalid. |
| 1439 | if (result_cache_max_size_ <= 0) { |
| 1440 | return Status(ErrorMsg(TErrorCode::RECOVERABLE_ERROR, |
| 1441 | "Restarting of fetch requires enabling of query result caching.")); |
| 1442 | } |
| 1443 | // The cache overflowed on a previous fetch. |
| 1444 | if (result_cache_.get() == NULL) { |
| 1445 | stringstream ss; |
| 1446 | ss << "The query result cache exceeded its limit of " << result_cache_max_size_ |
| 1447 | << " rows. Restarting the fetch is not possible."; |
| 1448 | return Status(ErrorMsg(TErrorCode::RECOVERABLE_ERROR, ss.str())); |
| 1449 | } |
| 1450 | // Reset fetch state to start over. |
| 1451 | eos_.Store(false); |
| 1452 | num_rows_fetched_ = 0; |
| 1453 | return Status::OK(); |
| 1454 | } |
| 1455 | |
| 1456 | void ClientRequestState::UpdateNonErrorExecState(ExecState new_state) { |
| 1457 | lock_guard<mutex> l(lock_); |