Instead of lengthy blurbs, switch to single-line, machine-readable standardized (https://spdx.dev) license identifiers. The Linux kernel switched long ago, so there is strong precedent. Three cases are handled: AGPL-only, Apache-only, and dual licensed. For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0), reasoning that our changes are extensive enough to apply our license. The changes we applied mechanically with a script, except to licenses/README.md. Closes #9937
74 lines
2.3 KiB
C++
74 lines
2.3 KiB
C++
/*
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2015-present ScyllaDB
|
|
*
|
|
* Modified by ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0)
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "cql3/abstract_marker.hh"
|
|
#include "operation.hh"
|
|
#include "update_parameters.hh"
|
|
#include "constants.hh"
|
|
|
|
namespace cql3 {
|
|
|
|
/**
|
|
* Static helper methods and classes for maps.
|
|
*/
|
|
class maps {
|
|
private:
|
|
maps() = delete;
|
|
public:
|
|
static lw_shared_ptr<column_specification> key_spec_of(const column_specification& column);
|
|
static lw_shared_ptr<column_specification> value_spec_of(const column_specification& column);
|
|
|
|
class setter : public operation {
|
|
public:
|
|
setter(const column_definition& column, expr::expression e)
|
|
: operation(column, std::move(e)) {
|
|
}
|
|
|
|
virtual void execute(mutation& m, const clustering_key_prefix& row_key, const update_parameters& params) override;
|
|
static void execute(mutation& m, const clustering_key_prefix& row_key, const update_parameters& params, const column_definition& column, const expr::constant& value);
|
|
};
|
|
|
|
class setter_by_key : public operation {
|
|
expr::expression _k;
|
|
public:
|
|
setter_by_key(const column_definition& column, expr::expression k, expr::expression e)
|
|
: operation(column, std::move(e)), _k(std::move(k)) {
|
|
}
|
|
virtual void fill_prepare_context(prepare_context& ctx) override;
|
|
virtual void execute(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params) override;
|
|
};
|
|
|
|
class putter : public operation {
|
|
public:
|
|
putter(const column_definition& column, expr::expression e)
|
|
: operation(column, std::move(e)) {
|
|
}
|
|
virtual void execute(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params) override;
|
|
};
|
|
|
|
static void do_put(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params,
|
|
const expr::constant& value, const column_definition& column);
|
|
|
|
class discarder_by_key : public operation {
|
|
public:
|
|
discarder_by_key(const column_definition& column, expr::expression k)
|
|
: operation(column, std::move(k)) {
|
|
}
|
|
virtual void execute(mutation& m, const clustering_key_prefix& prefix, const update_parameters& params) override;
|
|
};
|
|
};
|
|
|
|
}
|