HDF5  1.12.0
H5HFprivate.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*-------------------------------------------------------------------------
15  *
16  * Created: H5HFprivate.h
17  * Feb 24 2006
18  * Quincey Koziol <koziol@ncsa.uiuc.edu>
19  *
20  * Purpose: Private header for library accessible fractal heap routines.
21  *
22  *-------------------------------------------------------------------------
23  */
24 
25 #ifndef _H5HFprivate_H
26 #define _H5HFprivate_H
27 
28 /* Private headers needed by this file */
29 #include "H5Fprivate.h" /* File access */
30 #include "H5Oprivate.h" /* Object headers */
31 
32 /**************************/
33 /* Library Private Macros */
34 /**************************/
35 
36 /* Limit heap ID length to 4096 + 1, due to # of bits required to store
37  * length of 'tiny' objects (12 bits)
38  */
39 #define H5HF_MAX_ID_LEN (4096 + 1)
40 
41 
42 /****************************/
43 /* Library Private Typedefs */
44 /****************************/
45 
46 /* Creation parameters for doubling-tables */
47 typedef struct H5HF_dtable_cparam_t {
48  unsigned width; /* Number of columns in the table (must be power of 2) */
49  size_t start_block_size; /* Starting block size for table (must be power of 2) */
50  size_t max_direct_size; /* Maximum size of a direct block (must be power of 2) */
51  unsigned max_index; /* Maximum ID/offset for table (integer log2 of actual value, ie. the # of bits required) */
52  unsigned start_root_rows; /* Starting number of rows for root indirect block */
53  /* 0 indicates to create the full indirect block for the root,
54  * right from the start. Doesn't have to be power of 2
55  */
57 
58 /* Fractal heap creation parameters */
59 typedef struct H5HF_create_t {
60  H5HF_dtable_cparam_t managed;/* Mapped object doubling-table creation parameters */
61  hbool_t checksum_dblocks; /* Whether the direct blocks should be checksummed */
62  uint32_t max_man_size; /* Max. size of object to manage in doubling table */
63  /* (i.e. min. size of object to store standalone) */
64  uint16_t id_len; /* Length of IDs to use for heap objects */
65  /* (0 - make ID just large enough to hold length & offset of object in the heap) */
66  /* (1 - make ID just large enough to allow 'huge' objects to be accessed directly) */
67  /* (n - make ID 'n' bytes in size) */
68  H5O_pline_t pline; /* I/O filter pipeline to apply to direct blocks & 'huge' objects */
70 
71 /* Fractal heap metadata statistics info */
72 typedef struct H5HF_stat_t {
73  /* 'Managed' object info */
74  hsize_t man_size; /* Size of 'managed' space in heap */
75  hsize_t man_alloc_size; /* Size of 'managed' space allocated in heap */
76  hsize_t man_iter_off; /* Offset of "new block" iterator in 'managed' heap space */
77  hsize_t man_free_space; /* Free space within 'managed' heap blocks */
78  hsize_t man_nobjs; /* Number of 'managed' objects in heap */
79 
80  /* 'Huge' object info */
81  hsize_t huge_size; /* Size of 'huge' objects in heap */
82  hsize_t huge_nobjs; /* Number of 'huge' objects in heap */
83 
84  /* 'Tiny' object info */
85  hsize_t tiny_size; /* Size of 'tiny' objects in heap */
86  hsize_t tiny_nobjs; /* Number of 'tiny' objects in heap */
88 
89 /* Fractal heap info (forward decl - defined in H5HFpkg.h) */
90 typedef struct H5HF_t H5HF_t;
91 
92 /* Typedef for 'op' operations */
93 typedef herr_t (*H5HF_operator_t)(const void *obj/*in*/, size_t obj_len,
94  void *op_data/*in,out*/);
95 
96 /*****************************/
97 /* Library-private Variables */
98 /*****************************/
99 
100 
101 /***************************************/
102 /* Library-private Function Prototypes */
103 /***************************************/
104 
105 /* General routines for fractal heap operations */
106 H5_DLL H5HF_t *H5HF_create(H5F_t *f, const H5HF_create_t *cparam);
107 H5_DLL H5HF_t *H5HF_open(H5F_t *f, haddr_t fh_addr);
108 H5_DLL herr_t H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p/*out*/);
109 H5_DLL herr_t H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr/*out*/);
110 H5_DLL herr_t H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id/*out*/);
111 H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, const void *id, size_t *obj_len_p/*out*/);
112 H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p/*out*/);
113 H5_DLL herr_t H5HF_read(H5HF_t *fh, const void *id, void *obj/*out*/);
114 H5_DLL herr_t H5HF_write(H5HF_t *fh, void *id, hbool_t *id_changed,
115  const void *obj);
116 H5_DLL herr_t H5HF_op(H5HF_t *fh, const void *id, H5HF_operator_t op, void *op_data);
117 H5_DLL herr_t H5HF_remove(H5HF_t *fh, const void *id);
120 
121 /* Statistics routines */
122 H5_DLL herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats);
123 H5_DLL herr_t H5HF_size(const H5HF_t *fh, hsize_t *heap_size/*out*/);
124 
125 /* Debugging routines */
126 H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, int indent, int fwidth);
127 #ifdef H5HF_DEBUGGING
128 H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth);
129 #endif /* H5HF_DEBUGGING */
130 
131 #endif /* _H5HFprivate_H */
132 
H5HF_create
H5_DLL H5HF_t * H5HF_create(H5F_t *f, const H5HF_create_t *cparam)
Definition: H5HF.c:155
H5HF_dtable_cparam_t::max_index
unsigned max_index
Definition: H5HFprivate.h:51
H5HF_close
H5_DLL herr_t H5HF_close(H5HF_t *fh)
Definition: H5HF.c:820
H5HF_stat_t::man_alloc_size
hsize_t man_alloc_size
Definition: H5HFprivate.h:75
H5HF_stat_t::tiny_size
hsize_t tiny_size
Definition: H5HFprivate.h:85
size
iblock size
Definition: H5EAcache.c:787
f
hdr f
Definition: H5EA.c:755
H5HF_dtable_cparam_t::start_block_size
size_t start_block_size
Definition: H5HFprivate.h:49
H5HF_operator_t
herr_t(* H5HF_operator_t)(const void *obj, size_t obj_len, void *op_data)
Definition: H5HFprivate.h:93
H5HF_stat_t::man_free_space
hsize_t man_free_space
Definition: H5HFprivate.h:77
uint32_t
uint32_t
Definition: H5overflow.txt:38
H5HF_insert
H5_DLL herr_t H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id)
Definition: H5HF.c:352
H5HF_create_t::max_man_size
uint32_t max_man_size
Definition: H5HFprivate.h:62
haddr_t
CATCH haddr_t
Definition: H5EAdblock.c:162
indent
*s *s indent
Definition: H5HLdbg.c:111
H5O_pline_t
Definition: H5Oprivate.h:701
H5HF_size
H5_DLL herr_t H5HF_size(const H5HF_t *fh, hsize_t *heap_size)
Definition: H5HFstat.c:126
H5HF_dtable_cparam_t
Definition: H5HFprivate.h:47
H5HF_create_t::checksum_dblocks
hbool_t checksum_dblocks
Definition: H5HFprivate.h:61
H5HF_dtable_cparam_t::width
unsigned width
Definition: H5HFprivate.h:48
H5HF_open
H5_DLL H5HF_t * H5HF_open(H5F_t *f, haddr_t fh_addr)
Definition: H5HF.c:223
H5HF_write
H5_DLL herr_t H5HF_write(H5HF_t *fh, void *id, hbool_t *id_changed, const void *obj)
H5HF_dtable_cparam_t
struct H5HF_dtable_cparam_t H5HF_dtable_cparam_t
H5HF_get_heap_addr
H5_DLL herr_t H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr)
Definition: H5HF.c:320
H5HF_get_obj_len
H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, const void *id, size_t *obj_len_p)
Definition: H5HF.c:418
uint16_t
uint16_t
Definition: H5overflow.txt:37
H5HF_stat_t::huge_nobjs
hsize_t huge_nobjs
Definition: H5HFprivate.h:82
FILE
Invalid arguments to routine Resource unavailable Internal File accessibility Low level I O Function entry exit Object atom Object cache Links B Tree node Symbol table Heap Object header Datatype Dataspace Dataset Data storage Property lists Attribute Data filters External file list References Virtual File Layer Virtual Object Layer Ternary Search Trees Reference Counted Strings Error API Skip Lists Free Space Manager Shared Object Header Messages Extensible Array Fixed Array Plugin for dynamically loaded library Page Buffering API Context Map No error Argument errors Resource errors File accessibility errors FILE
Definition: H5err.txt:88
H5HF_stat_t
Definition: H5HFprivate.h:72
H5Oprivate.h
H5HF_sects_debug
herr_t H5HF_sects_debug(H5F_t *f, haddr_t fh_addr, FILE *stream, int indent, int fwidth)
Definition: H5HFdbg.c:881
H5HF_stat_t::huge_size
hsize_t huge_size
Definition: H5HFprivate.h:81
H5HF_dtable_cparam_t::start_root_rows
unsigned start_root_rows
Definition: H5HFprivate.h:52
H5Fprivate.h
fwidth
*s *s fwidth
Definition: H5HLdbg.c:111
H5HF_get_obj_off
H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p)
Definition: H5HF.c:480
H5HF_stat_t::man_size
hsize_t man_size
Definition: H5HFprivate.h:74
H5HF_create_t::id_len
uint16_t id_len
Definition: H5HFprivate.h:64
H5HF_stat_t::man_nobjs
hsize_t man_nobjs
Definition: H5HFprivate.h:78
H5HF_get_id_len
H5_DLL herr_t H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p)
Definition: H5HF.c:289
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5HF_read
H5_DLL herr_t H5HF_read(H5HF_t *fh, const void *id, void *obj)
Definition: H5HF.c:542
H5HF_op
H5_DLL herr_t H5HF_op(H5HF_t *fh, const void *id, H5HF_operator_t op, void *op_data)
Definition: H5HF.c:690
H5F_t
Definition: H5Fpkg.h:374
H5HF_create_t
struct H5HF_create_t H5HF_create_t
H5HF_stat_t
struct H5HF_stat_t H5HF_stat_t
H5HF_create_t
Definition: H5HFprivate.h:59
herr_t
int herr_t
Definition: H5public.h:128
hbool_t
bool hbool_t
Definition: H5public.h:159
H5HF_stat_t::tiny_nobjs
hsize_t tiny_nobjs
Definition: H5HFprivate.h:86
H5HF_t
Definition: H5HFpkg.h:459
H5HF_create_t::managed
H5HF_dtable_cparam_t managed
Definition: H5HFprivate.h:60
H5HF_stat_t::man_iter_off
hsize_t man_iter_off
Definition: H5HFprivate.h:76
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5HF_id_print
H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, int indent, int fwidth)
Definition: H5HFdbg.c:114
H5HF_remove
H5_DLL herr_t H5HF_remove(H5HF_t *fh, const void *id)
Definition: H5HF.c:755
H5HF_dtable_cparam_t::max_direct_size
size_t max_direct_size
Definition: H5HFprivate.h:50
H5HF_create_t::pline
H5O_pline_t pline
Definition: H5HFprivate.h:68
H5HF_delete
H5_DLL herr_t H5HF_delete(H5F_t *f, haddr_t fh_addr)
Definition: H5HF.c:917
H5HF_stat_info
H5_DLL herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats)
Definition: H5HFstat.c:86