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
103 };
104 
122  /* Index operations. */
126  int (*iqo_namei_list)(struct m0_op_idx *oi);
127 
128  /* Query operations. */
129  int (*iqo_get)(struct m0_op_idx *oi);
130  int (*iqo_put)(struct m0_op_idx *oi);
131  int (*iqo_del)(struct m0_op_idx *oi);
132  int (*iqo_next)(struct m0_op_idx *oi);
133 };
134 
137  int (*iso_init) (void *svc);
138  int (*iso_fini) (void *svc);
139 };
140 
148 };
149 
152 
159 };
160 
161 /* Configurations for Cassandra cluster. */
163  char *cc_cluster_ep; /* Contact point for a Cassandra cluster. */
164  char *cc_keyspace;
166 };
167 
184 
190 
196 
197 };
198 
199 /* BOB types */
200 extern const struct m0_bob_type oi_bobtype;
201 M0_BOB_DECLARE(M0_INTERNAL, m0_op_idx);
202 
203 M0_INTERNAL bool m0__idx_op_invariant(struct m0_op_idx *oi);
204 M0_INTERNAL void idx_op_ast_complete(struct m0_sm_group *grp,
205  struct m0_sm_ast *ast);
206 M0_INTERNAL void idx_op_ast_executed(struct m0_sm_group *grp,
207  struct m0_sm_ast *ast);
208 M0_INTERNAL void idx_op_ast_stable(struct m0_sm_group *grp,
209  struct m0_sm_ast *ast);
210 M0_INTERNAL void idx_op_ast_fail(struct m0_sm_group *grp,
211  struct m0_sm_ast *ast);
212 
213 
214 M0_INTERNAL int m0_idx_op_namei(struct m0_entity *entity,
215  struct m0_op **op,
216  enum m0_entity_opcode opcode);
217 
218 M0_INTERNAL void m0_idx_service_config(struct m0_client *m0c,
219  int svc_id, void *svc_conf);
220 M0_INTERNAL void m0_idx_service_register(int svc_id,
221  struct m0_idx_service_ops *sops,
222  struct m0_idx_query_ops *qops);
223 M0_INTERNAL void m0_idx_services_register(void);
224 
225 M0_INTERNAL void m0_idx_mock_register(void);
226 
227 #ifdef MOTR_IDX_STORE_CASS
228 M0_INTERNAL void m0_idx_cass_register(void);
229 #endif
230 
231 M0_INTERNAL void m0_idx_dix_register(void);
232 
233 #endif /* __MOTR_IDX_H__ */
234 
235 /*
236  * Local variables:
237  * c-indentation-style: "K&R"
238  * c-basic-offset: 8
239  * tab-width: 8
240  * fill-column: 80
241  * scroll-step: 1
242  * End:
243  */
244 /*
245  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
246  */
char * cc_cluster_ep
Definition: idx.h:163
struct m0_dix_ldesc kc_layout_ldesc
Definition: idx.h:189
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:603
int(* iqo_namei_list)(struct m0_op_idx *oi)
Definition: idx.h:126
M0_INTERNAL void m0_idx_services_register(void)
Definition: idx.c:683
static struct m0_sm_group * grp
Definition: bytecount.c:38
int(* iqo_namei_delete)(struct m0_op_idx *oi)
Definition: idx.h:124
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:132
char * cc_keyspace
Definition: idx.h:164
op
Definition: libdemo.c:64
struct m0_idx_query_ops * is_query_ops
Definition: idx.h:147
struct m0_idx_service_ops * is_svc_ops
Definition: idx.h:146
int(* iqo_namei_create)(struct m0_op_idx *oi)
Definition: idx.h:123
static struct m0_sm_ast ast[NR]
Definition: locality.c:44
int opcode
Definition: crate.c:301
void * isc_svc_inst
Definition: idx.h:158
int(* iqo_get)(struct m0_op_idx *oi)
Definition: idx.h:129
Definition: client.h:641
m0_op_idx_flags
Definition: idx.h:77
int(* iqo_del)(struct m0_op_idx *oi)
Definition: idx.h:131
int(* iqo_put)(struct m0_op_idx *oi)
Definition: idx.h:130
M0_INTERNAL void idx_op_ast_complete(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: idx.c:311
int(* iso_init)(void *svc)
Definition: idx.h:137
struct m0_idx_service * isc_service
Definition: idx.h:151
M0_INTERNAL void m0_idx_service_config(struct m0_client *m0c, int svc_id, void *svc_conf)
Definition: idx.c:654
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:293
struct m0_dix_ldesc kc_ldescr_ldesc
Definition: idx.h:195
bool kc_create_meta
Definition: idx.h:183
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:299
M0_INTERNAL void m0_idx_dix_register(void)
Definition: idx_dix.c:1553
int(* iso_fini)(void *svc)
Definition: idx.h:138
int(* iqo_namei_lookup)(struct m0_op_idx *oi)
Definition: idx.h:125
void * isc_svc_conf
Definition: idx.h:157
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:367
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:670
int cc_max_column_family_num
Definition: idx.h:165