Motr  M0
index.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_M0INDEX_H__
26 #define __MOTR_M0INDEX_H__
27 #include "lib/vec.h"
28 #include "fid/fid.h"
29 #include "common.h"
36 enum {
37  CRT, /* Create index. */
38  DRP, /* Drop index. */
39  LST, /* List index. */
40  LKP, /* Lookup index. */
41  PUT, /* Put record. */
42  DEL, /* Delete record. */
43  GET, /* Get record. */
44  NXT, /* Next record. */
45  GENF, /* Generate FID-file. */
46  GENV /* Generate VAL-file. */
47 };
48 
49 enum {
52 };
53 
54 struct index_cmd {
55  int ic_cmd;
59  int ic_cnt;
60  int ic_len;
61  char *ic_filename;
62 };
63 
64 struct index_ctx
65 {
67  int ictx_nr;
68 };
69 
70 extern bool is_str;
71 
72 int index_execute(int argc, char** argv);
73 int index_init(struct params *params);
74 void index_fini(void);
75 void index_usage(void);
76 
78 #endif /* __MOTR_M0INDEX_H__ */
79 
80 /*
81  * Local variables:
82  * c-indentation-style: "K&R"
83  * c-basic-offset: 8
84  * tab-width: 8
85  * fill-column: 80
86  * scroll-step: 1
87  * End:
88  */
89 /*
90  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
91  */
void index_usage(void)
Definition: index.c:336
Definition: index.h:38
Definition: index.h:43
Definition: index.h:37
bool is_str
Definition: cmd_main.c:64
Definition: index.h:45
struct m0_bufvec ic_keys
Definition: index.h:57
int ic_cnt
Definition: index.h:59
int ic_len
Definition: index.h:60
void index_fini(void)
Definition: index.c:331
Definition: fid.h:43
int ictx_nr
Definition: index.h:67
struct index_cmd ictx_cmd[INDEX_CMD_COUNT]
Definition: index.h:66
Definition: index.h:46
Definition: common.h:34
Definition: index.h:40
Definition: index.h:44
Definition: index.h:39
char * ic_filename
Definition: index.h:61
Definition: index.h:42
Definition: index.h:41
int index_init(struct params *params)
Definition: index.c:316
int ic_cmd
Definition: index.h:55
struct m0_bufvec ic_vals
Definition: index.h:58
struct m0_fid_arr ic_fids
Definition: index.h:56
Definition: vec.h:145
int index_execute(int argc, char **argv)
Definition: index.c:300