~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/memory/heap_priv.h

  • Committer: Stewart Smith
  • Date: 2010-11-03 03:27:09 UTC
  • mto: (1902.1.1 build) (1910.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1903.
  • Revision ID: stewart@flamingspork.com-20101103032709-oyvfrc6eb8fzj0mr
fix docs warning: docs/unlock.rst:2: (WARNING/2) Title underline too short.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
16
/* This file is included in all heap-files */
17
 
#ifndef PLUGIN_HEAP_HEAP_PRIV_H
18
 
#define PLUGIN_HEAP_HEAP_PRIV_H
 
17
#ifndef PLUGIN_MEMORY_HEAP_PRIV_H
 
18
#define PLUGIN_MEMORY_HEAP_PRIV_H
19
19
 
20
20
#include "config.h"
21
21
#include <drizzled/base.h>
27
27
#include "drizzled/tree.h"
28
28
#include <list>
29
29
 
 
30
#include <boost/thread/mutex.hpp>
 
31
 
30
32
/*
31
33
  When allocating keys /rows in the internal block structure, do it
32
34
  within the following boundaries.
50
52
#define hp_find_hash(A,B) ((HASH_INFO*) hp_find_block((A),(B)))
51
53
 
52
54
        /* Find pos for record and update it in info->current_ptr */
53
 
#define hp_find_record(info,pos) (info)->current_ptr= hp_find_block(&(info)->s->recordspace.block,pos)
 
55
#define hp_find_record(info,pos) (info)->current_ptr= hp_find_block(&(info)->getShare()->recordspace.block,pos)
54
56
 
55
57
#define get_chunk_status(info,ptr) (ptr[(info)->offset_status])
56
58
 
62
64
  unsigned char *ptr_to_rec;
63
65
} HASH_INFO;
64
66
 
65
 
typedef struct {
66
 
  HA_KEYSEG *keyseg;
67
 
  uint32_t key_length;
68
 
  uint32_t search_flag;
69
 
} heap_rb_param;
70
 
 
71
67
        /* Prototypes for intern functions */
72
68
 
73
69
extern HP_SHARE *hp_find_named_heap(const char *name);
76
72
extern int hp_get_new_block(HP_BLOCK *info, size_t* alloc_length);
77
73
extern void hp_free(HP_SHARE *info);
78
74
extern unsigned char *hp_free_level(HP_BLOCK *block,uint32_t level,HP_PTRS *pos,
79
 
                           unsigned char *last_pos);
 
75
                                    unsigned char *last_pos);
80
76
extern int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
81
77
                        const unsigned char *record, unsigned char *recpos);
82
 
extern int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
83
 
                           const unsigned char *record, unsigned char *recpos);
84
 
extern int hp_rb_delete_key(HP_INFO *info,HP_KEYDEF *keyinfo,
85
 
                            const unsigned char *record,unsigned char *recpos,int flag);
86
78
extern int hp_delete_key(HP_INFO *info,HP_KEYDEF *keyinfo,
87
79
                         const unsigned char *record,unsigned char *recpos,int flag);
88
80
extern HASH_INFO *_heap_find_hash(HP_BLOCK *block,uint32_t pos);
98
90
                          const unsigned char *rec2,
99
91
                          bool diff_if_only_endspace_difference);
100
92
extern void hp_make_key(HP_KEYDEF *keydef,unsigned char *key,const unsigned char *rec);
101
 
extern uint32_t hp_rb_make_key(HP_KEYDEF *keydef, unsigned char *key,
102
 
                           const unsigned char *rec, unsigned char *recpos);
103
 
extern uint32_t hp_rb_key_length(HP_KEYDEF *keydef, const unsigned char *key);
104
 
extern uint32_t hp_rb_null_key_length(HP_KEYDEF *keydef, const unsigned char *key);
105
 
extern uint32_t hp_rb_var_key_length(HP_KEYDEF *keydef, const unsigned char *key);
106
93
extern bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const unsigned char *record);
107
94
extern int hp_close(HP_INFO *info);
108
95
extern void hp_clear(HP_SHARE *info);
109
 
extern uint32_t hp_rb_pack_key(HP_KEYDEF *keydef,
110
 
                               unsigned char *key, const unsigned char *old,
111
 
                               drizzled::key_part_map keypart_map);
112
96
 
113
97
   /* Chunkset management (alloc/free/encode/decode) functions */
114
98
 
115
99
extern unsigned char *hp_allocate_chunkset(HP_DATASPACE *info, uint32_t chunk_count);
116
 
extern int hp_reallocate_chunkset(HP_DATASPACE *info, uint32_t chunk_count, unsigned char* pos);
117
100
extern void hp_free_chunks(HP_DATASPACE *info, unsigned char *pos);
118
101
extern void hp_clear_dataspace(HP_DATASPACE *info);
119
102
 
120
103
extern uint32_t hp_get_encoded_data_length(HP_SHARE *info, const unsigned char *record, uint32_t *chunk_count);
121
104
extern void hp_copy_record_data_to_chunkset(HP_SHARE *info, const unsigned char *record, unsigned char *pos);
122
105
extern void hp_extract_record(HP_SHARE *info, unsigned char *record, const unsigned char *pos);
123
 
extern uint32_t hp_process_record_data_to_chunkset(HP_SHARE *info, const unsigned char *record, unsigned char *pos, uint32_t is_compare);
124
 
 
125
 
 
126
 
 
127
 
extern pthread_mutex_t THR_LOCK_heap;
128
 
 
129
 
#endif /* PLUGIN_HEAP_HEAP_PRIV_H */
 
106
extern bool hp_compare_record_data_to_chunkset(HP_SHARE *info, const unsigned char *record, unsigned char *pos);
 
107
 
 
108
extern boost::mutex THR_LOCK_heap;
 
109
 
 
110
#endif /* PLUGIN_MEMORY_HEAP_PRIV_H */