My Project
ha_ndb_index_stat.h
00001 /*
00002    Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
00003 
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; version 2 of the License.
00007 
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011    GNU General Public License for more details.
00012 
00013    You should have received a copy of the GNU General Public License
00014    along with this program; if not, write to the Free Software
00015    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
00016 */
00017 
00018 /* provides declarations only to index_stat.cc */
00019 
00020 extern struct st_ndb_status g_ndb_status;
00021 
00022 extern pthread_mutex_t ndbcluster_mutex;
00023 
00024 extern pthread_t ndb_index_stat_thread;
00025 extern pthread_cond_t COND_ndb_index_stat_thread;
00026 extern pthread_mutex_t LOCK_ndb_index_stat_thread;
00027 
00028 /* protect entry lists where needed */
00029 extern pthread_mutex_t ndb_index_stat_list_mutex;
00030 
00031 /* protect and signal changes in stats entries */
00032 extern pthread_mutex_t ndb_index_stat_stat_mutex;
00033 extern pthread_cond_t ndb_index_stat_stat_cond;
00034 
00035 /* these have to live in ha_ndbcluster.cc */
00036 extern bool ndb_index_stat_get_enable(THD *thd);
00037 extern long g_ndb_status_index_stat_cache_query;
00038 extern long g_ndb_status_index_stat_cache_clean;
00039 
00040 void 
00041 compute_index_bounds(NdbIndexScanOperation::IndexBound & bound,
00042                      const KEY *key_info,
00043                      const key_range *start_key, const key_range *end_key,
00044                      int from);
00045 
00046 /* error codes local to ha_ndb */
00047 
00048 /* stats thread is not open for requests (should not happen) */
00049 #define Ndb_index_stat_error_NOT_ALLOW          9001
00050 
00051 /* stats entry for existing index not found (should not happen) */
00052 #define Ndb_index_stat_error_NOT_FOUND          9002
00053 
00054 /* request on stats entry with recent error was ignored */
00055 #define Ndb_index_stat_error_HAS_ERROR          9003
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines