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/
68 lines
1.9 KiB
C++
68 lines
1.9 KiB
C++
/*
|
|
* Copyright (C) 2015-present ScyllaDB
|
|
*
|
|
* Modified by ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: (LicenseRef-ScyllaDB-Source-Available-1.0 and Apache-2.0)
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "cql3/update_parameters.hh"
|
|
#include "cql3/operation.hh"
|
|
#include "cql3/values.hh"
|
|
#include "mutation/mutation.hh"
|
|
#include <seastar/core/shared_ptr.hh>
|
|
|
|
namespace service::broadcast_tables {
|
|
class update_query;
|
|
}
|
|
|
|
namespace cql3 {
|
|
|
|
/**
|
|
* Static helper methods and classes for constants.
|
|
*/
|
|
class constants {
|
|
public:
|
|
#if 0
|
|
private static final Logger logger = LoggerFactory.getLogger(Constants.class);
|
|
#endif
|
|
public:
|
|
class setter : public operation_skip_if_unset {
|
|
public:
|
|
using operation_skip_if_unset::operation_skip_if_unset;
|
|
|
|
virtual void execute(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params) override;
|
|
|
|
static void execute(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params, const column_definition& column, cql3::raw_value_view value);
|
|
|
|
virtual expr::expression prepare_new_value_for_broadcast_tables() const override;
|
|
};
|
|
|
|
struct adder final : operation_skip_if_unset {
|
|
using operation_skip_if_unset::operation_skip_if_unset;
|
|
|
|
virtual void execute(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params) override;
|
|
};
|
|
|
|
struct subtracter final : operation_skip_if_unset {
|
|
using operation_skip_if_unset::operation_skip_if_unset;
|
|
|
|
virtual void execute(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params) override;
|
|
};
|
|
|
|
class deleter : public operation_no_unset_support {
|
|
public:
|
|
deleter(const column_definition& column)
|
|
: operation_no_unset_support(column, std::nullopt)
|
|
{ }
|
|
|
|
virtual void execute(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params) override;
|
|
};
|
|
};
|
|
|
|
}
|