Motr  M0
idx.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2016-2020 Seagate Technology LLC and/or its Affiliates
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  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_IDX_H__
26 #define __MOTR_IDX_H__
27 
28 #include "motr/client.h" /* m0_entity_opcode */
29 #include "dix/layout.h" /* m0_dix_ldesc */
30 
54 struct m0_op_idx;
55 
74 };
75 
82  M0_OIF_OVERWRITE = 1 << 0,
92  M0_OIF_SYNC_WAIT = 1 << 2,
102  M0_OIF_CROW = 1 << 4,
108  M0_OIF_NO_DTM = 1 << 5
109 };
110 
128  /* Index operations. */
132  int (*iqo_namei_list)(struct m0_op_idx *oi);
133 
134  /* Query operations. */
135  int (*iqo_get)(struct m0_op_idx *oi);
136  int (*iqo_put)(struct m0_op_idx *oi);
137  int (*iqo_del)(struct m0_op_idx *oi);
138  int (*iqo_next)(struct m0_op_idx *oi);
139 };
140 
143  int (*iso_init) (void *svc);
144  int (*iso_fini) (void *svc);
145 };
146 
154 };
155 
158 
165 };
166 
167 /* Configurations for Cassandra cluster. */
169  char *cc_cluster_ep; /* Contact point for a Cassandra cluster. */
170  char *cc_keyspace;
172 };
173 
190 
196 
202 
203 };
204 
205 /* BOB types */
206 extern const struct m0_bob_type oi_bobtype;
207 M0_BOB_DECLARE(M0_INTERNAL, m0_op_idx);
208 
209 M0_INTERNAL bool m0__idx_op_invariant(struct m0_op_idx *oi);
210 M0_INTERNAL void idx_op_ast_complete(struct m0_sm_group *grp,
211  struct m0_sm_ast *ast);
212 M0_INTERNAL void idx_op_ast_executed(struct m0_sm_group *grp,
213  struct m0_sm_ast *ast);
214 M0_INTERNAL void idx_op_ast_stable(struct m0_sm_group *grp,
215  struct m0_sm_ast *ast);
216 M0_INTERNAL void idx_op_ast_fail(struct m0_sm_group *grp,
217  struct m0_sm_ast *ast);
218 
219 
220 M0_INTERNAL int m0_idx_op_namei(struct m0_entity *entity,
221  struct m0_op **op,
222  enum m0_entity_opcode opcode);
223 
224 M0_INTERNAL void m0_idx_service_config(struct m0_client *m0c,
225  int svc_id, void *svc_conf);
226 M0_INTERNAL void m0_idx_service_register(int svc_id,
227  struct m0_idx_service_ops *sops,
228  struct m0_idx_query_ops *qops);
229 M0_INTERNAL void m0_idx_services_register(void);
230 
231 M0_INTERNAL void m0_idx_mock_register(void);
232 
233 #ifdef MOTR_IDX_STORE_CASS
234 M0_INTERNAL void m0_idx_cass_register(void);
235 #endif
236 
237 M0_INTERNAL void m0_idx_dix_register(void);
238 
239 #endif /* __MOTR_IDX_H__ */
240 
241 /*
242  * Local variables:
243  * c-indentation-style: "K&R"
244  * c-basic-offset: 8
245  * tab-width: 8
246  * fill-column: 80
247  * scroll-step: 1
248  * End:
249  */
250 /*
251  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
252  */
char * cc_cluster_ep
Definition: idx.h:169
struct m0_dix_ldesc kc_layout_ldesc
Definition: idx.h:195
m0_entity_opcode
Definition: client.h:523
M0_INTERNAL int m0_idx_op_namei(struct m0_entity *entity, struct m0_op **op, enum m0_entity_opcode opcode)
Definition: idx.c:604
int(* iqo_namei_list)(struct m0_op_idx *oi)
Definition: idx.h:132
M0_INTERNAL void m0_idx_services_register(void)
Definition: idx.c:684
static struct m0_sm_group * grp
Definition: bytecount.c:38
int(* iqo_namei_delete)(struct m0_op_idx *oi)
Definition: idx.h:130
M0_INTERNAL bool m0__idx_op_invariant(struct m0_op_idx *oi)
Definition: idx.c:74
Definition: idx.h:70
static struct m0_clovis * m0c
Definition: main.c:25
M0_INTERNAL void m0_idx_mock_register(void)
Definition: idx_mock.c:768
Definition: sm.h:504
int(* iqo_next)(struct m0_op_idx *oi)
Definition: idx.h:138
char * cc_keyspace
Definition: idx.h:170
op
Definition: libdemo.c:64
struct m0_idx_query_ops * is_query_ops
Definition: idx.h:153
struct m0_idx_service_ops * is_svc_ops
Definition: idx.h:152
int(* iqo_namei_create)(struct m0_op_idx *oi)
Definition: idx.h:129
static struct m0_sm_ast ast[NR]
Definition: locality.c:44
int opcode
Definition: crate.c:301
void * isc_svc_inst
Definition: idx.h:164
int(* iqo_get)(struct m0_op_idx *oi)
Definition: idx.h:135
Definition: client.h:647
m0_op_idx_flags
Definition: idx.h:77
int(* iqo_del)(struct m0_op_idx *oi)
Definition: idx.h:137
int(* iqo_put)(struct m0_op_idx *oi)
Definition: idx.h:136
M0_INTERNAL void idx_op_ast_complete(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: idx.c:312
int(* iso_init)(void *svc)
Definition: idx.h:143
struct m0_idx_service * isc_service
Definition: idx.h:157
M0_INTERNAL void m0_idx_service_config(struct m0_client *m0c, int svc_id, void *svc_conf)
Definition: idx.c:655
m0_idx_service_type
Definition: idx.h:57
const struct m0_bob_type oi_bobtype
Definition: idx.c:44
M0_INTERNAL void idx_op_ast_stable(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: idx.c:294
struct m0_dix_ldesc kc_ldescr_ldesc
Definition: idx.h:201
bool kc_create_meta
Definition: idx.h:189
static struct m0_net_test_service svc
Definition: service.c:34
M0_INTERNAL void m0_idx_cass_register(void)
Definition: idx_cass.c:1198
M0_INTERNAL void idx_op_ast_executed(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: idx.c:300
M0_INTERNAL void m0_idx_dix_register(void)
Definition: idx_dix.c:1562
int(* iso_fini)(void *svc)
Definition: idx.h:144
int(* iqo_namei_lookup)(struct m0_op_idx *oi)
Definition: idx.h:131
void * isc_svc_conf
Definition: idx.h:163
M0_BOB_DECLARE(M0_INTERNAL, m0_op_idx)
M0_INTERNAL void idx_op_ast_fail(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: idx.c:368
M0_INTERNAL void m0_idx_service_register(int svc_id, struct m0_idx_service_ops *sops, struct m0_idx_query_ops *qops)
Definition: idx.c:671
int cc_max_column_family_num
Definition: idx.h:171