2
-*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
3
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
5
* Definitions required for Query Cache plugin
7
* Copyright (C) 2008 Mark Atwood, Toru Maesaka
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; version 2 of the License.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
#ifndef DRIZZLED_PLUGIN_QUERY_CACHE_H
24
#define DRIZZLED_PLUGIN_QUERY_CACHE_H
27
This is the API that a qcache plugin must implement.
28
it should implement each of these function pointers.
29
if a function pointer is NULL (not loaded), that's ok.
39
QueryCache(std::string name_arg): name(name_arg) {}
40
QueryCache(const char *name_arg): name(name_arg) {}
42
std::string getName() { return name; }
44
virtual ~QueryCache() {}
45
/* Lookup the cache and transmit the data back to the client */
46
virtual bool try_fetch_and_send(Session *session,
47
bool is_transactional)= 0;
49
virtual bool set(Session *session, bool is_transactional)= 0;
50
virtual bool invalidate_table(Session *session, bool is_transactional)= 0;
51
virtual bool invalidate_db(Session *session, const char *db_name,
52
bool transactional)= 0;
53
virtual bool flush(Session *session)= 0;
56
#endif /* DRIZZLED_PLUGIN_QUERY_CACHE_H */