Files
scylladb/service/paxos/cas_request.hh
Avi Kivity f3eade2f62 treewide: relicense to ScyllaDB-Source-Available-1.0
Drop the AGPL license in favor of a source-available license.
See the blog post [1] for details.

[1] https://www.scylladb.com/2024/12/18/why-were-moving-to-a-source-available-license/
2024-12-18 17:45:13 +02:00

41 lines
1.0 KiB
C++

/*
* Copyright (C) 2021-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
#include <optional>
#include "timestamp.hh"
#include <seastar/core/sharded.hh>
class mutation;
namespace query {
class result;
class partition_slice;
} // namespace query
namespace service {
// An instance of this class is passed as an argument to storage_proxy::cas().
// The apply() method, which must be defined by the implementation. It can
// either return a mutation that will be used as a value for paxos 'propose'
// stage or it can return an empty option in which case an empty mutation will
// be used
class cas_request {
public:
virtual ~cas_request() = default;
// it is safe to dereference and use the qr foreign pointer, the result was
// created by a foreign shard but no longer used by it.
virtual std::optional<mutation> apply(seastar::foreign_ptr<seastar::lw_shared_ptr<query::result>> qr,
const query::partition_slice& slice, api::timestamp_type ts) = 0;
};
} // namespace service