Skip to content
Snippets Groups Projects
Verified Commit 42d5c2c2 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

MAINT: clean up imports

parent 2e3a4f17
No related branches found
No related tags found
2 merge requests!42Release 0.2.0,!28F async execute
Pipeline #24968 passed
Pipeline: caosdb-cppinttest

#24970

    This commit is part of merge request !42. Comments created here will be created in the context of that merge request.
    Showing with 90 additions and 101 deletions
    ......@@ -55,10 +55,10 @@
    #include "caosdb/file_transmission/file_writer.h" // for FileWriter
    #include "caosdb/handler_interface.h" // for HandlerTag, Handl...
    #include <cstdint> // for uint64_t
    #include <grpcpp/impl/codegen/async_stream.h> // for ClientAsyncReader
    #include <grpcpp/impl/codegen/client_context.h> // for ClientContext
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include <grpcpp/impl/codegen/status.h> // for Status
    #include <grpcpp/client_context.h> // for ClientContext
    #include <grpcpp/completion_queue.h> // for CompletionQueue
    #include <grpcpp/support/async_stream.h> // for ClientAsyncReader
    #include <grpcpp/support/status.h> // for Status
    #include <memory> // for unique_ptr
    namespace caosdb::transaction {
    ......
    ......@@ -52,9 +52,9 @@
    #include "caosdb/entity/v1/main.grpc.pb.h" // for FileTransmissionS...
    #include "caosdb/entity/v1/main.pb.h" // for FileDownloadResponse
    #include "caosdb/handler_interface.h" // for HandlerTag, Handl...
    #include "caosdb/unary_rpc_handler.h"
    #include <grpcpp/impl/codegen/async_unary_call.h> // for ClientAsyncRespons...
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include "caosdb/unary_rpc_handler.h" // for UnaryRpcHandler
    #include <grpcpp/completion_queue.h> // for CompletionQueue
    #include <grpcpp/support/async_unary_call.h> // for ClientAsyncResponseReader
    #include <memory> // for unique_ptr
    namespace caosdb::transaction {
    ......
    ......@@ -55,10 +55,10 @@
    #include "caosdb/file_transmission/file_reader.h" // for FileReader
    #include "caosdb/handler_interface.h" // for HandlerTag, Handl...
    #include <cstdint> // for uint64_t
    #include <grpcpp/impl/codegen/async_stream.h> // for ClientAsyncWriter
    #include <grpcpp/impl/codegen/client_context.h> // for ClientContext
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include <grpcpp/impl/codegen/status.h> // for Status
    #include <grpcpp/client_context.h> // for ClientContext
    #include <grpcpp/completion_queue.h> // for CompletionQueue
    #include <grpcpp/support/async_stream.h> // for ClientAsyncReader
    #include <grpcpp/support/status.h> // for Status
    #include <memory> // for unique_ptr
    namespace caosdb::transaction {
    ......
    ......@@ -3,8 +3,8 @@
    #include "caosdb/entity/v1/main.pb.h" // for FileDownloadResponse
    #include "caosdb/handler_interface.h" // for HandlerTag
    #include "caosdb/unary_rpc_handler.h" // for HandlerTag, Handl...
    #include <grpcpp/impl/codegen/async_unary_call.h> // for ClientAsyncRespons...
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include <grpcpp/completion_queue.h> // for CompletionQueue
    #include <grpcpp/support/async_unary_call.h> // for ClientAsyncResponseReader
    #include <memory> // for unique_ptr
    namespace caosdb::transaction {
    ......
    ......@@ -51,9 +51,9 @@
    #include "caosdb/handler_interface.h" // for HandlerTag, Handl...
    #include "caosdb/transaction_status.h" // for TransactionStatus
    #include <grpcpp/impl/codegen/client_context.h> // for ClientContext
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include <grpcpp/impl/codegen/status.h> // for Status
    #include <grpcpp/client_context.h> // for ClientContext
    #include <grpcpp/completion_queue.h> // for CompletionQueue
    #include <grpcpp/support/status.h> // for Status
    namespace caosdb::transaction {
    ......
    ......@@ -52,18 +52,18 @@
    #include "caosdb/status_code.h" // for GENERIC_RPC_E...
    #include "caosdb/transaction_status.h" // for TransactionStatus
    #include <exception> // IWYU pragma: keep
    // IWYU pragma: no_include <bits/exception.h>
    #include <filesystem> // for operator<<, path
    #include <google/protobuf/arena.h> // for Arena
    #include <grpcpp/impl/codegen/async_stream.h> // for ClientAsyncRe...
    #include <grpcpp/impl/codegen/client_context.h> // for ClientContext
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include <grpcpp/impl/codegen/status.h> // for Status
    #include <grpcpp/impl/codegen/status_code_enum.h> // for OK, UNAUTHENT...
    #include <grpcpp/client_context.h> // for ClientContext
    #include <grpcpp/completion_queue.h> // for CompletionQueue
    #include <grpcpp/support/async_stream.h> // for ClientAsyncReader
    #include <grpcpp/support/status.h> // for Status
    #include <grpcpp/support/status_code_enum.h> // for OK
    #include <stdexcept> // for runtime_error
    #include <string> // for string, opera...
    #include <utility> // for move
    // IWYU pragma: no_include <bits/exception.h>
    //
    namespace caosdb::transaction {
    using caosdb::StatusCode;
    using caosdb::utility::get_arena;
    ......
    ......@@ -48,8 +48,6 @@
    */
    #include "caosdb/file_transmission/register_file_upload_handler.h"
    #include "caosdb/logging.h" // for CAOSDB_LOG_TRACE
    #include <grpcpp/impl/codegen/async_unary_call.h> // for ClientAsyncRes...
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    namespace caosdb::transaction {
    ......
    ......@@ -54,17 +54,13 @@
    #include <algorithm> // for min
    #include <cstdint> // for uint64_t
    #include <exception> // IWYU pragma: keep
    // IWYU pragma: no_include <bits/exception.h>
    #include <filesystem> // for operator<<, path
    #include <google/protobuf/arena.h> // for Arena
    #include <grpcpp/impl/codegen/async_stream.h> // for ClientAsyncWr...
    #include <grpcpp/impl/codegen/call_op_set.h> // for WriteOptions
    #include <grpcpp/impl/codegen/client_context.h> // for ClientContext
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include <grpcpp/impl/codegen/status.h> // for Status
    #include <grpcpp/impl/codegen/status_code_enum.h> // for OK, UNAUTHENT...
    #include <grpcpp/support/status_code_enum.h> // for OK
    #include <string> // for basic_string
    #include <utility> // for move
    // IWYU pragma: no_include <bits/exception.h>
    namespace caosdb::transaction {
    using caosdb::StatusCode;
    ......
    ......@@ -28,7 +28,6 @@
    #include "caosdb/status_code.h" // for StatusCode
    #include "caosdb/transaction_handler.h" // for EntityTransactionHandler
    #include <algorithm> // for max
    #include <chrono> // for chrono_literals
    #include <exception> // IWYU pragma: keep
    #include <filesystem> // for operator<<, path
    #include <future> // for async, future
    ......@@ -38,7 +37,6 @@
    #include <memory> // for unique_ptr
    #include <random> // for mt19937, rand...
    #include <system_error> // for std::system_error
    #include <thread> // for sleep
    #include <utility> // for move, pair
    // IWYU pragma: no_include <bits/exception.h>
    // IWYU pragma: no_include <cxxabi.h>
    ......@@ -423,9 +421,9 @@ auto Transaction::WaitForIt() const noexcept -> TransactionStatus {
    return this->status;
    }
    // NOLINTNEXTLINE
    auto Transaction::ProcessCalls() -> TransactionStatus {
    CAOSDB_LOG_TRACE_ENTER_AND_LEAVE(logger_name, "Transaction::ProcessCalls()")
    CAOSDB_LOG_TRACE_ENTER_AND_LEAVE(logger_name, "Transaction::ProcessCalls()") {
    TRANSACTION_SYNCRONIZED_BLOCK
    if (this->status.GetCode() != StatusCode::EXECUTING) {
    CAOSDB_LOG_ERROR(logger_name)
    << "Transaction::ProcessCalls() was called, TransactionStatus was: "
    ......@@ -433,13 +431,15 @@ auto Transaction::ProcessCalls() -> TransactionStatus {
    return status;
    }
    handler_->Start();
    }
    gpr_timespec deadline;
    deadline.tv_sec = 1;
    deadline.tv_nsec = 0;
    deadline.clock_type = gpr_clock_type::GPR_TIMESPAN;
    TransactionStatus result = TransactionStatus::EXECUTING();
    handler_->Start();
    void *tag = nullptr;
    bool ok = false;
    ......@@ -486,22 +486,20 @@ Transaction::~Transaction() {
    void Transaction::Cancel() {
    CAOSDB_LOG_TRACE_ENTER_AND_LEAVE(logger_name, "Transaction::Cancel()")
    TRANSACTION_SYNCRONIZED_BLOCK
    if (this->status.GetCode() > 0) {
    // Prevent canceling before the queue even started.
    // Temporary fix for a bug in GRPC.
    // Fix is in the making:
    // https://github.com/grpc/grpc/pull/30004
    using namespace std::chrono_literals;
    std::this_thread::sleep_for(5ms);
    if (this->status.GetCode() == StatusCode::CANCELLED) {
    return;
    }
    this->status = TransactionStatus::CANCELLED();
    {
    TRANSACTION_SYNCRONIZED_BLOCK
    if (handler_ != nullptr) {
    handler_->Cancel();
    }
    this->status = TransactionStatus::CANCELLED();
    completion_queue.Shutdown();
    // drain the queue
    ......@@ -510,6 +508,7 @@ void Transaction::Cancel() {
    while (completion_queue.Next(&ignoredTag, &ok)) {
    ;
    }
    }
    if (transaction_future.valid()) {
    transaction_future.wait();
    ......
    ......@@ -2,8 +2,6 @@
    #include "caosdb/logging.h" // for CAOSDB_LOG_TRACE
    #include <exception> // IWYU pragma: keep
    // IWYU pragma: no_include <bits/exception.h>
    #include <grpcpp/impl/codegen/async_unary_call.h> // for ClientAsyncRes...
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    namespace caosdb::transaction {
    ......
    ......@@ -49,12 +49,10 @@
    #include "caosdb/unary_rpc_handler.h"
    #include "caosdb/logging.h" // for CAOSDB_LOG_TRACE
    #include "caosdb/status_code.h" // for GENERIC_RPC_E...
    // IWYU pragma: no_include <bits/exception.h>
    #include <exception> // IWYU pragma: keep
    #include <grpcpp/impl/codegen/client_context.h> // for ClientContext
    #include <grpcpp/impl/codegen/status.h> // for Status
    #include <grpcpp/impl/codegen/status_code_enum.h> // for OK, UNAUTHENT...
    #include <grpcpp/support/status_code_enum.h> // for OK
    #include <string> // for string, opera...
    // IWYU pragma: no_include <bits/exception.h>
    namespace caosdb::transaction {
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment