Couchbase C++ SDK 1.0.6 (rev. b5b5145)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
retry_reason.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright 2020-Present Couchbase, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
21
22#ifdef COUCHBASE_CXX_CLIENT_DOXYGEN
23namespace fmt
24{
25}
26#endif
27
34template<>
35struct fmt::formatter<couchbase::retry_reason> {
36 template<typename ParseContext>
37 constexpr auto parse(ParseContext& ctx)
38 {
39 return ctx.begin();
40 }
41
42 template<typename FormatContext>
43 auto format(couchbase::retry_reason reason, FormatContext& ctx) const
44 {
45 string_view name = "unknown";
46 switch (reason) {
48 name = "do_not_retry";
49 break;
51 name = "unknown";
52 break;
54 name = "socket_not_available";
55 break;
57 name = "service_not_available";
58 break;
60 name = "node_not_available";
61 break;
63 name = "kv_not_my_vbucket";
64 break;
66 name = "kv_collection_outdated";
67 break;
69 name = "kv_error_map_retry_indicated";
70 break;
72 name = "kv_locked";
73 break;
75 name = "kv_temporary_failure";
76 break;
78 name = "kv_sync_write_in_progress";
79 break;
81 name = "kv_sync_write_re_commit_in_progress";
82 break;
84 name = "service_response_code_indicated";
85 break;
87 name = "socket_closed_while_in_flight";
88 break;
90 name = "circuit_breaker_open";
91 break;
93 name = "query_prepared_statement_failure";
94 break;
96 name = "query_index_not_found";
97 break;
99 name = "analytics_temporary_failure";
100 break;
102 name = "search_too_many_requests";
103 break;
105 name = "views_temporary_failure";
106 break;
108 name = "views_no_active_partition";
109 break;
110 }
111 return format_to(ctx.out(), "{}", name);
112 }
113};
Represents a single item from the result of scan()
Definition allow_querying_search_index_options.hxx:28
retry_reason
Enumeration of possible retry reasons for operations.
Definition retry_reason.hxx:28
@ key_value_sync_write_in_progress
Definition retry_reason.hxx:74
@ key_value_locked
Definition retry_reason.hxx:70
@ views_no_active_partition
Definition retry_reason.hxx:101
@ key_value_temporary_failure
Definition retry_reason.hxx:72
@ service_not_available
The service on a node (i.e.
Definition retry_reason.hxx:48
@ key_value_sync_write_re_commit_in_progress
Definition retry_reason.hxx:76
@ node_not_available
The node where the operation is supposed to be dispatched to is not available.
Definition retry_reason.hxx:53
@ socket_not_available
The socket is not available into which the operation should’ve been written.
Definition retry_reason.hxx:43
@ search_too_many_requests
Definition retry_reason.hxx:97
@ service_response_code_indicated
Definition retry_reason.hxx:78
@ key_value_error_map_retry_indicated
An unknown response was returned and the consulted KV error map indicated a retry.
Definition retry_reason.hxx:68
@ key_value_not_my_vbucket
A not my vbucket response has been received.
Definition retry_reason.hxx:58
@ socket_closed_while_in_flight
While an operation was in-flight, the underlying socket has been closed.
Definition retry_reason.hxx:83
@ unknown
All unexpected/unknown retry errors must not be retried to avoid accidental data loss and non-determi...
Definition retry_reason.hxx:38
@ query_prepared_statement_failure
Definition retry_reason.hxx:91
@ key_value_collection_outdated
A KV response has been received which signals an outdated collection.
Definition retry_reason.hxx:63
@ do_not_retry
default value, e.g.
Definition retry_reason.hxx:32
@ circuit_breaker_open
The circuit breaker is open for the given socket/endpoint and as a result the operation is not sent i...
Definition retry_reason.hxx:89
@ analytics_temporary_failure
Definition retry_reason.hxx:95
@ query_index_not_found
Definition retry_reason.hxx:93
@ views_temporary_failure
Definition retry_reason.hxx:99
Definition cas.hxx:24
auto format(couchbase::retry_reason reason, FormatContext &ctx) const
Definition retry_reason.hxx:43
constexpr auto parse(ParseContext &ctx)
Definition retry_reason.hxx:37