MCPcopy Create free account
hub / github.com/apache/brpc / pipelineRequest

Method pipelineRequest

src/brpc/couchbase.cpp:2425–2488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2423}
2424
2425bool CouchbaseOperations::pipelineRequest(operation_type op_type,
2426 const std::string& key,
2427 const std::string& value,
2428 std::string collection_name) {
2429 if (!pipeline_active) {
2430 DEBUG_PRINT("Pipeline not active. Call beginPipeline() first.");
2431 return false;
2432 }
2433
2434 switch (op_type) {
2435 case GET:
2436 if (pipeline_request_couchbase_req.getRequest(
2437 key, collection_name, channel_, server_address_,
2438 selected_bucket_) == false) {
2439 return false;
2440 }
2441 pipeline_operations_queue.push(GET);
2442 break;
2443 case UPSERT:
2444 if (pipeline_request_couchbase_req.upsertRequest(
2445 key, value, 0, 0, 0, collection_name, channel_, server_address_,
2446 selected_bucket_) == false) {
2447 return false;
2448 }
2449 pipeline_operations_queue.push(UPSERT);
2450 break;
2451 case ADD:
2452 if (pipeline_request_couchbase_req.addRequest(
2453 key, value, 0, 0, 0, collection_name, channel_, server_address_,
2454 selected_bucket_) == false) {
2455 return false;
2456 }
2457 pipeline_operations_queue.push(ADD);
2458 break;
2459 case APPEND:
2460 if (pipeline_request_couchbase_req.appendRequest(
2461 key, value, 0, 0, 0, collection_name, channel_, server_address_,
2462 selected_bucket_) == false) {
2463 return false;
2464 }
2465 pipeline_operations_queue.push(APPEND);
2466 break;
2467 case PREPEND:
2468 if (pipeline_request_couchbase_req.prependRequest(
2469 key, value, 0, 0, 0, collection_name, channel_, server_address_,
2470 selected_bucket_) == false) {
2471 return false;
2472 }
2473 pipeline_operations_queue.push(PREPEND);
2474 break;
2475 case DELETE:
2476 if (pipeline_request_couchbase_req.deleteRequest(
2477 key, collection_name, channel_, server_address_,
2478 selected_bucket_) == false) {
2479 return false;
2480 }
2481 pipeline_operations_queue.push(DELETE);
2482 break;

Callers 1

performOperationsFunction · 0.80

Calls 7

getRequestMethod · 0.80
upsertRequestMethod · 0.80
addRequestMethod · 0.80
appendRequestMethod · 0.80
prependRequestMethod · 0.80
deleteRequestMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected