CUBRID Engine  latest
extendible_hash.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * extendible_hash.h: Extendible hashing module (interface)
22  */
23 
24 #ifndef _EXTENDIBLE_HASH_H_
25 #define _EXTENDIBLE_HASH_H_
26 
27 #ident "$Id$"
28 
29 #include "config.h"
30 
31 #include "error_manager.h"
32 #include "storage_common.h"
33 #include "file_manager.h"
34 #include "oid.h"
35 
36 extern EH_SEARCH ehash_search (THREAD_ENTRY * thread_p, EHID * ehid, void *key, OID * value_ptr);
37 extern void *ehash_insert (THREAD_ENTRY * thread_p, EHID * ehid, void *key, OID * value_ptr);
38 extern void *ehash_delete (THREAD_ENTRY * thread_p, EHID * ehid, void *key);
39 
40 /* TODO: check not use */
41 #if 0
42 /* Utility functions */
43 extern int eh_size (EHID * ehid, int *num_bucket_pages, int *num_dir_pages);
44 extern int eh_count (EHID * ehid);
45 extern int eh_depth (EHID * ehid);
46 extern int eh_capacity (THREAD_ENTRY * thread_p, EHID * ehid, int *num_recs, int *avg_reclength, int *num_bucket_pages,
47  int *num_dir_pages, int *dir_depth, int *avg_freespace_per_page, int *avg_overhead_per_page);
48 #endif
49 
50 extern int ehash_map (THREAD_ENTRY * thread_p, EHID * ehid,
51  int (*fun) (THREAD_ENTRY * thread_p, void *, void *, void *args), void *args);
52 
53 /* For debugging purposes only */
54 extern void ehash_dump (THREAD_ENTRY * thread_p, EHID * ehid);
55 #if defined (ENABLE_UNUSED_FUNCTION)
56 extern void ehash_print_bucket (THREAD_ENTRY * thread_p, EHID * ehid, int offset);
57 #endif
58 
59 /* Recovery functions */
60 int ehash_rv_init_bucket_redo (THREAD_ENTRY * thread_p, LOG_RCV * recv);
61 int ehash_rv_init_dir_redo (THREAD_ENTRY * thread_p, LOG_RCV * recv);
62 int ehash_rv_insert_redo (THREAD_ENTRY * thread_p, LOG_RCV * recv);
63 int ehash_rv_insert_undo (THREAD_ENTRY * thread_p, LOG_RCV * recv);
64 int ehash_rv_delete_redo (THREAD_ENTRY * thread_p, LOG_RCV * recv);
65 int ehash_rv_delete_undo (THREAD_ENTRY * thread_p, LOG_RCV * recv);
66 int ehash_rv_increment (THREAD_ENTRY * thread_p, LOG_RCV * recv);
67 int ehash_rv_connect_bucket_redo (THREAD_ENTRY * thread_p, LOG_RCV * recv);
69 
70 #endif /* _EXTENDIBLE_HASH_H_ */
int ehash_rv_insert_redo(THREAD_ENTRY *thread_p, LOG_RCV *recv)
void * ehash_insert(THREAD_ENTRY *thread_p, EHID *ehid, void *key, OID *value_ptr)
int ehash_rv_init_dir_new_page_redo(THREAD_ENTRY *thread_p, LOG_RCV *recv)
int ehash_rv_delete_undo(THREAD_ENTRY *thread_p, LOG_RCV *recv)
int ehash_map(THREAD_ENTRY *thread_p, EHID *ehid, int(*fun)(THREAD_ENTRY *thread_p, void *, void *, void *args), void *args)
void THREAD_ENTRY
int ehash_rv_insert_undo(THREAD_ENTRY *thread_p, LOG_RCV *recv)
void ehash_dump(THREAD_ENTRY *thread_p, EHID *ehid)
void * ehash_delete(THREAD_ENTRY *thread_p, EHID *ehid, void *key)
int ehash_rv_init_bucket_redo(THREAD_ENTRY *thread_p, LOG_RCV *recv)
int ehash_rv_init_dir_redo(THREAD_ENTRY *thread_p, LOG_RCV *recv)
EH_SEARCH ehash_search(THREAD_ENTRY *thread_p, EHID *ehid, void *key, OID *value_ptr)
int ehash_rv_delete_redo(THREAD_ENTRY *thread_p, LOG_RCV *recv)
EH_SEARCH
int ehash_rv_increment(THREAD_ENTRY *thread_p, LOG_RCV *recv)
int ehash_rv_connect_bucket_redo(THREAD_ENTRY *thread_p, LOG_RCV *recv)