1/*
2 * cfg_ce.c
3 *
4 * Copyright (C) 2016-2019 Aerospike, Inc.
5 *
6 * Portions may be licensed to Aerospike, Inc. under one or more contributor
7 * license agreements.
8 *
9 * This program is free software: you can redistribute it and/or modify it under
10 * the terms of the GNU Affero General Public License as published by the Free
11 * Software Foundation, either version 3 of the License, or (at your option) any
12 * later version.
13 *
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see http://www.gnu.org/licenses/
21 */
22
23//==========================================================
24// Includes.
25//
26
27#include "base/cfg.h"
28
29#include <stdbool.h>
30#include <stdint.h>
31
32#include "fault.h"
33
34#include "base/datamodel.h"
35
36
37//==========================================================
38// Forward declarations.
39//
40
41void post_process_namespace(as_namespace* ns);
42
43
44//==========================================================
45// Public API.
46//
47
48void
49as_config_init_namespace(as_namespace* ns)
50{
51}
52
53bool
54as_config_error_enterprise_only()
55{
56 return true;
57}
58
59bool
60as_config_error_enterprise_feature_only(const char* name)
61{
62 cf_crash(AS_CFG, "community edition checking enterprise feature");
63 return true;
64}
65
66// TODO - until we have an info split.
67bool
68as_info_error_enterprise_only()
69{
70 return true;
71}
72
73
74//==========================================================
75// Private API - for enterprise separation only.
76//
77
78void
79cfg_enterprise_only(const cfg_line* p_line)
80{
81 cf_crash_nostack(AS_CFG, "line %d :: '%s' is enterprise-only",
82 p_line->num, p_line->name_tok);
83}
84
85
86void
87cfg_post_process()
88{
89 // So far, no other context handled.
90
91 for (uint32_t ns_ix = 0; ns_ix < g_config.n_namespaces; ns_ix++) {
92 post_process_namespace(g_config.namespaces[ns_ix]);
93 }
94}
95
96
97//==========================================================
98// Local helpers.
99//
100
101void
102post_process_namespace(as_namespace* ns)
103{
104 if (ns->conflict_resolution_policy ==
105 AS_NAMESPACE_CONFLICT_RESOLUTION_POLICY_UNDEF) {
106 ns->conflict_resolution_policy =
107 AS_NAMESPACE_CONFLICT_RESOLUTION_POLICY_GENERATION;
108 }
109}
110