| 1 | /* |
| 2 | * replica_ping_ce.c |
| 3 | * |
| 4 | * Copyright (C) 2017-2018 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 "transaction/replica_ping.h" |
| 28 | |
| 29 | #include <stdbool.h> |
| 30 | |
| 31 | #include "fault.h" |
| 32 | #include "msg.h" |
| 33 | #include "node.h" |
| 34 | |
| 35 | #include "base/datamodel.h" |
| 36 | #include "base/transaction.h" |
| 37 | #include "fabric/fabric.h" |
| 38 | #include "transaction/rw_request.h" |
| 39 | |
| 40 | |
| 41 | //========================================================== |
| 42 | // Public API. |
| 43 | // |
| 44 | |
| 45 | bool |
| 46 | repl_ping_check(as_transaction* tr) |
| 47 | { |
| 48 | if (as_transaction_is_linearized_read(tr)) { |
| 49 | cf_warning(AS_RW, "linearized read is an enterprise feature" ); |
| 50 | tr->result_code = AS_ERR_ENTERPRISE_ONLY; |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | return true; |
| 55 | } |
| 56 | |
| 57 | void |
| 58 | repl_ping_make_message(rw_request* rw, as_transaction* tr) |
| 59 | { |
| 60 | cf_crash(AS_RW, "CE code called repl_ping_make_message()" ); |
| 61 | } |
| 62 | |
| 63 | void |
| 64 | repl_ping_setup_rw(rw_request* rw, as_transaction* tr, |
| 65 | repl_ping_done_cb repl_ping_cb, timeout_done_cb timeout_cb) |
| 66 | { |
| 67 | cf_crash(AS_RW, "CE code called repl_ping_setup_rw()" ); |
| 68 | } |
| 69 | |
| 70 | void |
| 71 | repl_ping_reset_rw(rw_request* rw, as_transaction* tr, repl_ping_done_cb cb) |
| 72 | { |
| 73 | cf_crash(AS_RW, "CE code called repl_ping_reset_rw()" ); |
| 74 | } |
| 75 | |
| 76 | void |
| 77 | repl_ping_handle_op(cf_node node, msg* m) |
| 78 | { |
| 79 | cf_warning(AS_RW, "CE code called repl_ping_handle_op()" ); |
| 80 | as_fabric_msg_put(m); |
| 81 | } |
| 82 | |
| 83 | void |
| 84 | repl_ping_handle_ack(cf_node node, msg* m) |
| 85 | { |
| 86 | cf_warning(AS_RW, "CE code called repl_ping_handle_ack()" ); |
| 87 | as_fabric_msg_put(m); |
| 88 | } |
| 89 | |