| 125 | } |
| 126 | |
| 127 | Status SharedJdbcConnection::FetchBatch(extdatasource::TGetNextResult* result) { |
| 128 | // Fast path: another thread already exhausted the stream. |
| 129 | if (eos_.load(std::memory_order_acquire)) { |
| 130 | result->__set_eos(true); |
| 131 | return Status::OK(); |
| 132 | } |
| 133 | |
| 134 | extdatasource::TGetNextParams params; |
| 135 | params.__set_scan_handle(scan_handle_); |
| 136 | |
| 137 | // Multiple threads may call GetNext() concurrently. Serialization is provided by |
| 138 | // the Java-side fetchLock in JdbcRecordIterator::fetchBatch(), so only one thread |
| 139 | // holds the JDBC cursor at a time. Batch conversion happens in parallel in C++. |
| 140 | RETURN_IF_ERROR(executor_.GetNext(params, result)); |
| 141 | if (result->eos) eos_.store(true, std::memory_order_release); |
| 142 | return StatusFromThrift(result->status); |
| 143 | } |
| 144 | |
| 145 | Status SharedJdbcConnection::Close(const extdatasource::TCloseParams& params, |
| 146 | extdatasource::TCloseResult* result) { |
no test coverage detected