ECP-VELOC Components
User documentation for all components
redset_lofi.h
Go to the documentation of this file.
1 #ifndef REDSET_LOFI_H
2 #define REDSET_LOFI_H
3 
4 /* structure to track an ordered set of files and operate on
5  * them as one logical, continuous file */
6 typedef struct {
7  int numfiles; /* number of files in list */
8  off_t bytes; /* number of bytes summed across all files */
9  int* fds; /* file descriptor for each file */
10  const char** filenames; /* name of each file */
11  unsigned long* filesizes; /* size of each file */
12 } redset_lofi;
13 
14 /* encode file info into kvtree */
15 int redset_lofi_encode_kvtree(kvtree* hash, int num, const char** files);
16 
17 /* encode a map of source file to destination file,
18  * can be passed to open to look at destination rather than source for each data file */
19 int redset_lofi_encode_map(kvtree* hash, int num, const char** src_files, const char** dst_files);
20 
21 /* check whether files in kvtree exist and match expected properties */
22 int redset_lofi_check_mapped(const kvtree* hash, const kvtree* map);
23 
24 /* check whether files in kvtree exist and match expected properties */
25 int redset_lofi_check(const kvtree* hash);
26 
27 /* given a hash that defines a set of files, open our logical file for reading */
28 int redset_lofi_open_mapped(const kvtree* hash, const kvtree* map, int flags, mode_t mode, redset_lofi* rsf);
29 
30 /* given a hash that defines a set of files, open our logical file for reading */
31 int redset_lofi_open(const kvtree* hash, int flags, mode_t mode, redset_lofi* rsf);
32 
33 /* return file size of our logical file */
34 unsigned long redset_lofi_bytes(redset_lofi* rsf);
35 
36 /* read from logical file */
37 int redset_lofi_pread(redset_lofi* rsf, void* buf, size_t count, off_t offset);
38 
39 /* write to logical file */
40 int redset_lofi_pwrite(redset_lofi* rsf, void* buf, size_t count, off_t offset);
41 
42 /* given a hash that defines a set of files, close our logical */
44 
45 /* given a hash that defines a set of files, apply metadata recorded to each file */
46 int redset_lofi_apply_meta_mapped(kvtree* hash, const kvtree* map);
47 
48 /* given a hash that defines a set of files, apply metadata recorded to each file */
49 int redset_lofi_apply_meta(kvtree* hash);
50 
51 #endif /* REDSET_LOFI_H */
redset_lofi_pwrite
int redset_lofi_pwrite(redset_lofi *rsf, void *buf, size_t count, off_t offset)
redset_lofi_check_mapped
int redset_lofi_check_mapped(const kvtree *hash, const kvtree *map)
redset_lofi::filesizes
unsigned long * filesizes
Definition: redset_lofi.h:11
redset_lofi::filenames
const char ** filenames
Definition: redset_lofi.h:10
redset_lofi_encode_kvtree
int redset_lofi_encode_kvtree(kvtree *hash, int num, const char **files)
redset_lofi::numfiles
int numfiles
Definition: redset_lofi.h:7
redset_lofi
Definition: redset_lofi.h:6
redset_lofi_check
int redset_lofi_check(const kvtree *hash)
redset_lofi_open_mapped
int redset_lofi_open_mapped(const kvtree *hash, const kvtree *map, int flags, mode_t mode, redset_lofi *rsf)
redset_lofi_apply_meta_mapped
int redset_lofi_apply_meta_mapped(kvtree *hash, const kvtree *map)
redset_lofi::bytes
off_t bytes
Definition: redset_lofi.h:8
redset_lofi_close
int redset_lofi_close(redset_lofi *rsf)
redset_lofi_pread
int redset_lofi_pread(redset_lofi *rsf, void *buf, size_t count, off_t offset)
redset_lofi::fds
int * fds
Definition: redset_lofi.h:9
redset_lofi_bytes
unsigned long redset_lofi_bytes(redset_lofi *rsf)
redset_lofi_open
int redset_lofi_open(const kvtree *hash, int flags, mode_t mode, redset_lofi *rsf)
redset_lofi_encode_map
int redset_lofi_encode_map(kvtree *hash, int num, const char **src_files, const char **dst_files)
redset_lofi_apply_meta
int redset_lofi_apply_meta(kvtree *hash)