ESDM
Middleware for Earth System Data
wos.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  */
17 #ifndef ESDM_BACKENDS_WOS_H
18 #define ESDM_BACKENDS_WOS_H
19 
20 #include <backends-data/dynamic-perf-model/lat-thr.h>
21 #include <esdm-internal.h>
22 
23 #include "wrapper/wos_wrapper.h"
24 
25 // Internal functions used by this backend.
26 typedef struct {
27  esdm_config_backend_t *config;
28  const char *target;
30  t_WosClusterPtr *wos_cluster; // Pointer to WOS cluster
31  t_WosPolicy *wos_policy; // Policy
32  t_WosObjPtr *wos_meta_obj; // Used for internal purposes to store metadata info
33  t_WosOID **oid_list; // List of object ids
34  uint64_t *size_list; // List of object sizes
37 
52 int wos_get_param(const char *conf, char **output, const char *param);
53 
54 int wos_get_host(const char *conf, char **host);
55 
56 int wos_get_policy(const char *conf, char **policy);
57 
58 void wos_delete_oid_list(esdm_backend_t_wos_t *ebm);
59 
60 int wos_object_list_encode(t_WosOID **oid_list, char **out_object_id);
61 
62 int esdm_backend_t_wos_init(const char *conf, esdm_backend_t *eb);
63 
64 int esdm_backend_t_wos_fini(esdm_backend_t *eb);
65 
66 int esdm_backend_t_wos_alloc(esdm_backend_t *eb, int n_dims, int *dims_size, esdm_type_t type, char **out_object_id, char **out_wos_metadata);
67 
68 int esdm_backend_t_wos_open(esdm_backend_t *eb, char *object_id, void **obj_handle);
69 
70 int esdm_backend_t_wos_delete(esdm_backend_t *eb, void *obj_handle);
71 
72 int esdm_backend_t_wos_write(esdm_backend_t *eb, void *obj_handle, uint64_t start, uint64_t count, esdm_type_t type, void *data);
73 
74 int esdm_backend_t_wos_read(esdm_backend_t *eb, void *obj_handle, uint64_t start, uint64_t count, esdm_type_t type, void *data);
75 
76 int esdm_backend_t_wos_close(esdm_backend_t *eb, void *obj_handle);
77 
78 int wos_backend_performance_check(esdm_backend_t *eb, int data_size, float *out_time);
79 
80 int wos_backend_performance_estimate(esdm_backend_t *eb, esdm_fragment_t *fragment, float *out_time);
81 
82 int esdm_backend_t_wos_fragment_retrieve(esdm_backend_t *backend, esdm_fragment_t *fragment, json_t *metadata);
83 
84 int esdm_backend_t_wos_fragment_update(esdm_backend_t *backend, esdm_fragment_t *fragment);
85 
86 int esdm_backend_t_wos_fragment_delete(esdm_backend_t *backend, esdm_fragment_t *fragment, json_t *metadata);
87 
88 int esdm_backend_t_wos_fragment_mkfs(esdm_backend_t *backend, int enforce_format);
89 
90 esdm_backend_t *wos_backend_init(esdm_config_backend_t *config);
91 
92 extern esdm_backend_t_wos_t esdm_backend_t_wos;
93 
94 #endif
Internal ESDM functionality, not to be used by backends and plugins.
Definition: esdm-datatypes-internal.h:197
Definition: esdm-datatypes-internal.h:252
Definition: lat-thr.h:23
Definition: esdm-datatypes-internal.h:78
Definition: wos_wrapper.h:24
Definition: wos_wrapper.h:40
Definition: wos_wrapper.h:56
Definition: wos_wrapper.h:48
Definition: wos.h:26
int wos_get_param(const char *conf, char **output, const char *param)
Definition: wos.c:47