1 | /* |
2 | * flat_ce.c |
3 | * |
4 | * Copyright (C) 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 "storage/flat.h" |
28 | |
29 | #include <stdbool.h> |
30 | #include <stddef.h> |
31 | #include <stdint.h> |
32 | |
33 | #include "fault.h" |
34 | |
35 | #include "base/datamodel.h" |
36 | #include "storage/storage.h" |
37 | |
38 | |
39 | //========================================================== |
40 | // Public API. |
41 | // |
42 | |
43 | as_flat_record* |
44 | as_flat_compress_bins_and_pack_record(const as_storage_rd* rd, |
45 | uint32_t max_orig_sz, uint32_t* flat_sz) |
46 | { |
47 | return NULL; |
48 | } |
49 | |
50 | uint32_t |
51 | as_flat_orig_pickle_size(const as_remote_record* rr, uint32_t pickle_sz) |
52 | { |
53 | return pickle_sz; |
54 | } |
55 | |
56 | bool |
57 | as_flat_decompress_bins(const as_flat_comp_meta *cm, as_storage_rd *rd) |
58 | { |
59 | return true; |
60 | } |
61 | |
62 | bool |
63 | as_flat_decompress_buffer(const as_flat_comp_meta* cm, uint32_t max_orig_sz, |
64 | const uint8_t** at, const uint8_t** end) |
65 | { |
66 | return true; |
67 | } |
68 | |
69 | |
70 | //========================================================== |
71 | // Private API - for enterprise separation only. |
72 | // |
73 | |
74 | uint8_t* |
75 | flatten_compression_meta(const as_flat_comp_meta* cm, as_flat_record* flat, |
76 | uint8_t* buf) |
77 | { |
78 | flat->is_compressed = 0; |
79 | |
80 | return buf; |
81 | } |
82 | |
83 | const uint8_t* |
84 | unflatten_compression_meta(const as_flat_record* flat, const uint8_t* at, |
85 | const uint8_t* end, as_flat_comp_meta* cm) |
86 | { |
87 | if (flat->is_compressed == 0) { |
88 | return at; |
89 | } |
90 | |
91 | cf_warning_digest(AS_FLAT, &flat->keyd, |
92 | "community edition skipped compressed record " ); |
93 | |
94 | return NULL; |
95 | } |
96 | |