Lines Matching defs:qstate

65 on_mp_write_session_destroy(struct query_state *qstate)
69 finalize_comm_element(&qstate->request);
70 finalize_comm_element(&qstate->response);
72 if (qstate->mdata != NULL) {
73 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
75 (cache_mp_write_session)qstate->mdata);
76 configuration_unlock_entry(qstate->config_entry,
91 on_mp_write_session_request_read1(struct query_state *qstate)
97 if (qstate->kevent_watermark == 0)
98 qstate->kevent_watermark = sizeof(size_t);
100 init_comm_element(&qstate->request,
103 &qstate->request);
105 result = qstate->read_func(qstate,
126 qstate->kevent_watermark = c_mp_ws_request->entry_length;
127 qstate->process_func = on_mp_write_session_request_read2;
134 on_mp_write_session_request_read2(struct query_state *qstate)
140 c_mp_ws_request = get_cache_mp_write_session_request(&qstate->request);
142 result = qstate->read_func(qstate, c_mp_ws_request->entry,
145 if (result < 0 || (size_t)result != qstate->kevent_watermark) {
152 qstate->kevent_watermark = 0;
153 qstate->process_func = on_mp_write_session_request_process;
160 on_mp_write_session_request_process(struct query_state *qstate)
169 init_comm_element(&qstate->response, CET_MP_WRITE_SESSION_RESPONSE);
171 &qstate->response);
172 c_mp_ws_request = get_cache_mp_write_session_request(&qstate->request);
174 qstate->config_entry = configuration_find_entry(
176 if (qstate->config_entry == NULL) {
185 if (qstate->config_entry->enabled == 0) {
194 if (qstate->config_entry->perform_actual_lookups != 0) {
203 if (check_query_eids(qstate) != 0) {
215 asprintf(&dec_cache_entry_name, "%s%s", qstate->eid_str,
216 qstate->config_entry->mp_cache_params.cep.entry_name);
225 c_entry = register_new_mp_cache_entry(qstate,
231 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
236 qstate->mdata = ws;
237 qstate->destroy_func = on_mp_write_session_destroy;
239 if ((qstate->config_entry->mp_query_timeout.tv_sec != 0) ||
240 (qstate->config_entry->mp_query_timeout.tv_usec != 0))
241 memcpy(&qstate->timeout,
242 &qstate->config_entry->mp_query_timeout,
245 configuration_unlock_entry(qstate->config_entry, CELT_MULTIPART);
248 qstate->process_func = on_mp_write_session_response_write1;
249 qstate->kevent_watermark = sizeof(int);
250 qstate->kevent_filter = EVFILT_WRITE;
257 on_mp_write_session_response_write1(struct query_state *qstate)
264 &qstate->response);
265 result = qstate->write_func(qstate, &c_mp_ws_response->error_code,
275 qstate->kevent_watermark = sizeof(int);
276 qstate->process_func = on_mp_write_session_mapper;
277 qstate->kevent_filter = EVFILT_READ;
279 qstate->kevent_watermark = 0;
280 qstate->process_func = NULL;
292 on_mp_write_session_mapper(struct query_state *qstate)
298 if (qstate->kevent_watermark == 0) {
299 qstate->kevent_watermark = sizeof(int);
301 result = qstate->read_func(qstate, &elem_type, sizeof(int));
311 qstate->kevent_watermark = sizeof(size_t);
312 qstate->process_func =
316 qstate->kevent_watermark = 0;
317 qstate->process_func =
321 qstate->kevent_watermark = 0;
322 qstate->process_func =
326 qstate->kevent_watermark = 0;
327 qstate->process_func = NULL;
347 on_mp_write_session_write_request_read1(struct query_state *qstate)
353 init_comm_element(&qstate->request,
356 &qstate->request);
358 result = qstate->read_func(qstate, &write_request->data_size,
378 qstate->kevent_watermark = write_request->data_size;
379 qstate->process_func = on_mp_write_session_write_request_read2;
385 on_mp_write_session_write_request_read2(struct query_state *qstate)
392 &qstate->request);
394 result = qstate->read_func(qstate, write_request->data,
397 if (result < 0 || (size_t)result != qstate->kevent_watermark) {
404 qstate->kevent_watermark = 0;
405 qstate->process_func = on_mp_write_session_write_request_process;
411 on_mp_write_session_write_request_process(struct query_state *qstate)
417 init_comm_element(&qstate->response,
420 &qstate->response);
422 &qstate->request);
424 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
426 (cache_mp_write_session)qstate->mdata,
429 configuration_unlock_entry(qstate->config_entry, CELT_MULTIPART);
431 qstate->kevent_watermark = sizeof(int);
432 qstate->process_func = on_mp_write_session_write_response_write1;
433 qstate->kevent_filter = EVFILT_WRITE;
440 on_mp_write_session_write_response_write1(struct query_state *qstate)
447 &qstate->response);
448 result = qstate->write_func(qstate, &write_response->error_code,
458 finalize_comm_element(&qstate->request);
459 finalize_comm_element(&qstate->response);
461 qstate->kevent_watermark = sizeof(int);
462 qstate->process_func = on_mp_write_session_mapper;
463 qstate->kevent_filter = EVFILT_READ;
465 qstate->kevent_watermark = 0;
466 qstate->process_func = 0;
478 on_mp_write_session_abandon_notification(struct query_state *qstate)
481 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
482 abandon_cache_mp_write_session((cache_mp_write_session)qstate->mdata);
483 configuration_unlock_entry(qstate->config_entry, CELT_MULTIPART);
484 qstate->mdata = INVALID_CACHE_MP_WRITE_SESSION;
486 qstate->kevent_watermark = 0;
487 qstate->process_func = NULL;
497 on_mp_write_session_close_notification(struct query_state *qstate)
500 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
501 close_cache_mp_write_session((cache_mp_write_session)qstate->mdata);
502 configuration_unlock_entry(qstate->config_entry, CELT_MULTIPART);
503 qstate->mdata = INVALID_CACHE_MP_WRITE_SESSION;
505 qstate->kevent_watermark = 0;
506 qstate->process_func = NULL;
511 cache_entry register_new_mp_cache_entry(struct query_state *qstate,
519 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
522 en_bkp = qstate->config_entry->mp_cache_params.cep.entry_name;
523 qstate->config_entry->mp_cache_params.cep.entry_name =
526 &qstate->config_entry->mp_cache_params);
527 qstate->config_entry->mp_cache_params.cep.entry_name = en_bkp;
535 configuration_entry_add_mp_cache_entry(qstate->config_entry,
538 configuration_unlock_entry(qstate->config_entry,