2009-01-31 23:27:25 +01:00
|
|
|
// reci.h
|
2010-02-09 22:48:21 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 10gen Inc.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-01-31 23:27:25 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2010-02-05 00:06:04 +01:00
|
|
|
#include "diskloc.h"
|
2009-01-31 23:27:25 +01:00
|
|
|
|
|
|
|
namespace mongo {
|
|
|
|
|
2010-04-10 22:14:46 +02:00
|
|
|
// #define VIRT virtual
|
|
|
|
#define VIRT
|
|
|
|
|
2009-02-05 22:17:46 +01:00
|
|
|
/* Subclass this and implement your real storage interface.
|
|
|
|
*/
|
2009-01-31 23:27:25 +01:00
|
|
|
class RecStoreInterface {
|
|
|
|
public:
|
2010-04-10 22:14:46 +02:00
|
|
|
//VIRT ~RecStoreInterface() {}
|
2009-12-22 21:22:37 +01:00
|
|
|
|
2009-03-20 20:39:22 +01:00
|
|
|
/* Get a pointer to the data at diskloc d. Pointer guaranteed to stay in
|
|
|
|
scope through the current database operation's life.
|
|
|
|
*/
|
2010-04-10 22:14:46 +02:00
|
|
|
//VIRT char* get(DiskLoc d, unsigned len) = 0;
|
2009-01-31 23:27:25 +01:00
|
|
|
|
2009-12-22 21:22:37 +01:00
|
|
|
/* indicate that the diskloc specified has been updated. note that as-is today, the modification may come AFTER this
|
2009-03-20 20:39:22 +01:00
|
|
|
call -- we handle that currently -- until the dblock finishes.
|
2009-03-13 16:56:28 +01:00
|
|
|
*/
|
2010-04-10 22:14:46 +02:00
|
|
|
//VIRT void modified(DiskLoc d) = 0;
|
2009-02-03 00:18:22 +01:00
|
|
|
|
2009-01-31 23:27:25 +01:00
|
|
|
/* insert specified data as a record */
|
2010-04-10 22:14:46 +02:00
|
|
|
//VIRT DiskLoc insert(const char *ns, const void *obuf, int len, bool god) = 0;
|
2009-01-31 23:27:25 +01:00
|
|
|
|
2010-04-10 22:14:46 +02:00
|
|
|
//VIRT void deleteRecord(const char *ns, DiskLoc d) { massert( 10379 , "not implemented RecStoreInterface::deleteRecord", false); }
|
2009-09-24 20:21:40 +02:00
|
|
|
|
2009-03-17 22:02:21 +01:00
|
|
|
/* drop the collection */
|
2010-04-10 22:14:46 +02:00
|
|
|
//VIRT void drop(const char *ns) = 0;
|
2009-03-20 20:39:22 +01:00
|
|
|
|
2009-07-29 21:53:14 +02:00
|
|
|
/* rename collection */
|
2010-04-10 22:14:46 +02:00
|
|
|
//VIRT void rename(const char *fromNs, const char *toNs) = 0;
|
2009-07-29 21:53:14 +02:00
|
|
|
|
2009-03-24 17:53:13 +01:00
|
|
|
/* close datafiles associated with the db specified. */
|
2010-04-10 22:14:46 +02:00
|
|
|
//VIRT void closeFiles(string dbname, string path) = 0;
|
2009-03-24 17:53:13 +01:00
|
|
|
|
2009-03-20 20:39:22 +01:00
|
|
|
/* todo add:
|
|
|
|
closeFiles(dbname)
|
|
|
|
eraseFiles(dbname)
|
|
|
|
*/
|
2009-01-31 23:27:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|