ESDM
Middleware for Earth System Data
clovis_internal.h
1 /* This file is part of ESDM.
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with ESDM. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Original author: Huang Hua <hua.huang@seagate.com>
17  * Original creation date: 13-Oct-2017
18  */
19 #ifndef CLOVIS_INTERNAL_H
20 #define CLOVIS_INTERNAL_H
21 
22 #include "clovis/clovis.h"
23 #include "clovis/clovis_idx.h"
24 #include "lib/memory.h"
25 
36  int (*esdm_backend_t_init) (char *conf, esdm_backend_t * eb);
37 
42 
43  /* object operations start here */
57  int n_dims,
58  int *dims_size,
59  esdm_type_t type,
60  char *md1,
61  char *md2,
62  char **out_object_id,
63  char **out_mero_metadata);
64 
71  const char *object_id, void **obj_handle);
72 
77  void *obj_handle,
78  uint64_t start,
79  uint64_t count, void *data);
80 
85  void *obj_handle,
86  uint64_t start, uint64_t count, void *data);
87 
91  int (*esdm_backend_t_obj_close) (esdm_backend_t * eb, void *obj_handle);
92 
96  int (*mapping_insert) (esdm_backend_t * backend, struct m0_fid *index_fid,
97  const char *name, const char *value);
101  int (*mapping_get) (esdm_backend_t * backend, struct m0_fid *index_fid,
102  const char *name, char **value);
103  int (*esdm_backend_t_mkfs)(esdm_backend_t *backend, int enforce_format);
104 };
105 
106 typedef struct {
107  esdm_backend_t ebm_base;
108 
109  /* Mero Clovis */
110  struct m0_clovis *ebm_clovis_instance;
111  struct m0_clovis_container ebm_clovis_container;
112  struct m0_clovis_config ebm_clovis_conf;
113 
114  struct m0_fid ebm_last_fid;
115  struct m0_mutex ebm_mutex;
116 
117  /* for test */
118  struct esdm_backend_t_xxxops ebm_ops;
120 
121 extern esdm_backend_t_clovis_t esdm_backend_t_clovis;
122 extern struct m0_fid index_cdname_to_object;
123 extern struct m0_fid index_object_last_pos;
124 
125 
126 #endif
Definition: clovis_internal.h:106
Definition: clovis_internal.h:26
int(* esdm_backend_t_obj_open)(esdm_backend_t *eb, const char *object_id, void **obj_handle)
Definition: clovis_internal.h:70
int(* esdm_backend_t_init)(char *conf, esdm_backend_t *eb)
Definition: clovis_internal.h:36
int(* esdm_backend_t_fini)(esdm_backend_t *eb)
Definition: clovis_internal.h:41
int(* esdm_backend_t_obj_close)(esdm_backend_t *eb, void *obj_handle)
Definition: clovis_internal.h:91
int(* esdm_backend_t_obj_write)(esdm_backend_t *eb, void *obj_handle, uint64_t start, uint64_t count, void *data)
Definition: clovis_internal.h:76
int(* esdm_backend_t_obj_alloc)(esdm_backend_t *eb, int n_dims, int *dims_size, esdm_type_t type, char *md1, char *md2, char **out_object_id, char **out_mero_metadata)
Definition: clovis_internal.h:56
int(* esdm_backend_t_obj_read)(esdm_backend_t *eb, void *obj_handle, uint64_t start, uint64_t count, void *data)
Definition: clovis_internal.h:84
Definition: esdm-datatypes-internal.h:197