drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
query_cache.h
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2008 Sun Microsystems, Toru Maesaka
5 * Copyright (C) 2010 Djellel Eddine Difallah
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#pragma once
22
23#include <drizzled/plugin.h>
24#include <drizzled/plugin/plugin.h>
25#include <drizzled/sql_list.h>
26#include <drizzled/visibility.h>
27
28namespace drizzled {
29namespace plugin {
30
31/*
32 This is the API that a qcache plugin must implement.
33*/
34
35class DRIZZLED_API QueryCache : public Plugin
36{
37public:
38 explicit QueryCache(const std::string& name)
39 : Plugin(name, "QueryCache")
40 {}
41
42 /* these are the Query Cache interface functions */
43
44 /* Lookup the cache and transmit the data back to the client */
45 virtual bool doIsCached(Session*)= 0;
46 /* Lookup the cache and transmit the data back to the client */
47 virtual bool doSendCachedResultset(Session*)= 0;
48 /* Send the current Resultset to the cache */
49 virtual bool doSetResultset(Session*)= 0;
50 /* initiate a new Resultset (header) */
51 virtual bool doPrepareResultset(Session*)= 0;
52 /* push a record to the current Resultset */
53 virtual bool doInsertRecord(Session*, List<Item>&)= 0;
54
55 static bool addPlugin(QueryCache&);
56 static void removePlugin(QueryCache&);
57
58 /* These are the functions called by the rest of the Drizzle server */
59 static bool isCached(Session*);
60 static bool sendCachedResultset(Session*);
61 static bool prepareResultset(Session*);
62 static bool setResultset(Session*);
63 static bool insertRecord(Session*, List<Item>&);
64};
65
66} /* namespace plugin */
67} /* namespace drizzled */
TODO: Rename this file - func.h is stupid.
Visibility Control Macros.
#define DRIZZLED_API
Definition visibility.h:38