79 #include <NdbCondition.h>
84 #define NULL_HASH 0xFF
85 #define POOL_HASH_TABLE_SIZE 32
86 #define MAX_NDB_OBJECTS 240
91 Uint16 next_free_object;
92 Uint16 prev_free_object;
93 Uint16 next_db_object;
94 Uint16 prev_db_object;
98 Uint32 max_ndb_objects = 240,
99 Uint32 no_conn_obj = 4,
100 Uint32 init_no_ndb_objects = 8);
101 static void drop_instance();
102 Ndb* get_ndb_object(Uint32 &hint_id,
103 const char* a_catalog_name,
104 const char* a_schema_name);
105 void return_ndb_object(
Ndb* returned_object, Uint32
id);
107 bool init(Uint32 initial_no_of_ndb_objects = 8);
109 static bool initPoolMutex();
111 Uint32 max_no_of_ndb_objects, Uint32 no_conn_objects);
124 void add_free_list(Uint32
id);
125 void remove_free_list(Uint32
id);
126 Ndb* get_free_list(Uint32 &
id, Uint32 hash_entry);
128 void add_db_hash(Uint32
id);
129 void remove_db_hash(Uint32
id, Uint32 hash_entry);
130 Ndb* get_db_hash(Uint32 &
id,
132 const char* a_catalog_name,
133 const char* a_schema_name);
135 bool allocate_ndb(Uint32 &
id,
136 const char* a_catalog_name,
137 const char* a_schema_name);
138 Ndb* get_hint_ndb(Uint32
id, Uint32 hash_entry);
139 Ndb* wait_free_ndb(Uint32 &
id);
140 Uint32 compute_hash(
const char *a_schema_name);
141 void add_wait_list(Uint32
id);
142 void remove_wait_list();
143 void switch_condition_queue();
145 static NdbMutex *pool_mutex;
149 POOL_STRUCT *m_pool_reference;
153 Uint32 m_no_of_conn_objects;
155 Uint16 m_no_of_objects;
156 Uint16 m_max_ndb_objects;
159 Uint16 m_first_not_in_use;
162 Uint16 m_input_queue;
163 Uint16 m_output_queue;
164 Uint16 m_signal_count;