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
{
50
INDEX_CMD_COUNT
= 10,
51
MAX_VAL_SIZE
= 500
52
};
53
54
struct
index_cmd
{
55
int
ic_cmd
;
56
struct
m0_fid_arr
ic_fids
;
57
struct
m0_bufvec
ic_keys
;
58
struct
m0_bufvec
ic_vals
;
59
int
ic_cnt
;
60
int
ic_len
;
61
char
*
ic_filename
;
62
};
63
64
struct
index_ctx
65
{
66
struct
index_cmd
ictx_cmd
[
INDEX_CMD_COUNT
];
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
*/
index_usage
void index_usage(void)
Definition:
index.c:336
DRP
Definition:
index.h:38
fid.h
GET
Definition:
index.h:43
index_cmd
Definition:
index.h:54
CRT
Definition:
index.h:37
INDEX_CMD_COUNT
Definition:
index.h:50
is_str
bool is_str
Definition:
cmd_main.c:64
index_ctx
Definition:
index.h:64
GENF
Definition:
index.h:45
index_cmd::ic_keys
struct m0_bufvec ic_keys
Definition:
index.h:57
index_cmd::ic_cnt
int ic_cnt
Definition:
index.h:59
index_cmd::ic_len
int ic_len
Definition:
index.h:60
index_fini
void index_fini(void)
Definition:
index.c:331
m0_fid_arr
Definition:
fid.h:43
index_ctx::ictx_nr
int ictx_nr
Definition:
index.h:67
index_ctx::ictx_cmd
struct index_cmd ictx_cmd[INDEX_CMD_COUNT]
Definition:
index.h:66
GENV
Definition:
index.h:46
params
Definition:
common.h:34
LKP
Definition:
index.h:40
MAX_VAL_SIZE
Definition:
index.h:51
NXT
Definition:
index.h:44
LST
Definition:
index.h:39
index_cmd::ic_filename
char * ic_filename
Definition:
index.h:61
DEL
Definition:
index.h:42
PUT
Definition:
index.h:41
index_init
int index_init(struct params *params)
Definition:
index.c:316
index_cmd::ic_cmd
int ic_cmd
Definition:
index.h:55
index_cmd::ic_vals
struct m0_bufvec ic_vals
Definition:
index.h:58
common.h
index_cmd::ic_fids
struct m0_fid_arr ic_fids
Definition:
index.h:56
m0_bufvec
Definition:
vec.h:145
vec.h
index_execute
int index_execute(int argc, char **argv)
Definition:
index.c:300
motr
m0kv
index.h
Generated on Thu Apr 14 2022 14:02:58 for Motr by
1.8.14