37 #include "mongo/base/status.h" 38 #include "mongo/base/string_data.h" 39 #include "mongo/bson/timestamp.h" 46 class IndexDescriptor;
47 class JournalListener;
48 class OperationContext;
50 class SortedDataInterface;
51 class SnapshotManager;
87 const IndexDescriptor*
desc) = 0;
100 const IndexDescriptor* desc,
140 const IndexDescriptor* desc) = 0;
154 const IndexDescriptor* desc,
160 virtual int64_t
getIdentSize(OperationContext* opCtx, StringData ident) = 0;
164 virtual Status dropIdent(OperationContext* opCtx, StringData ident) = 0;
168 const IndexDescriptor* desc){};
179 return Status(ErrorCodes::CommandNotSupported,
180 "The current storage engine doesn't support backup mode");
232 virtual bool hasIdent(OperationContext* opCtx, StringData ident)
const = 0;
234 virtual std::vector<std::string>
getAllIdents(OperationContext* opCtx)
const = 0;
303 fassertFailed(50664);
virtual bool supportsReadConcernSnapshot() const
See StorageEngine::supportsReadConcernSnapshot
Definition: kv_engine.h:328
virtual Status dropIdent(OperationContext *opCtx, StringData ident)=0
virtual boost::optional< Timestamp > getLastStableCheckpointTimestamp() const
See StorageEngine::getLastStableCheckpointTimestamp
Definition: kv_engine.h:316
Definition: kv_engine.h:53
virtual void setStableTimestamp(Timestamp stableTimestamp)
See StorageEngine::setStableTimestamp
Definition: kv_engine.h:263
virtual void cleanShutdown()=0
This method will be called before there is a clean shutdown.
Collection *const const NamespaceString & ns
Definition: collection_info_cache_impl.cpp:53
virtual bool supportsRecoverToStableTimestamp() const
See StorageEngine::supportsRecoverToStableTimestamp
Definition: kv_engine.h:295
Definition: collection_options.h:57
virtual Status okToRename(OperationContext *opCtx, StringData fromNS, StringData toNS, StringData ident, const RecordStore *originalRecordStore) const
Definition: kv_engine.h:224
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
virtual Timestamp getAllCommittedTimestamp() const =0
See StorageEngine::getAllCommittedTimestamp
OperationContext Database StringData BSONObj CollectionOptions::ParseKind bool const BSONObj &idIndex Status
Definition: database_impl.cpp:956
virtual Status createGroupedRecordStore(OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options, KVPrefix prefix)
Create a RecordStore that MongoDB considers eligible to share space in an underlying table with other...
Definition: kv_engine.h:129
virtual StatusWith< Timestamp > recoverToStableTimestamp(OperationContext *opCtx)
See StorageEngine::recoverToStableTimestamp
Definition: kv_engine.h:302
virtual bool supportsCappedCollections() const
This must not change over the lifetime of the engine.
Definition: kv_engine.h:213
virtual void alterIdentMetadata(OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)
Definition: kv_engine.h:166
virtual void setInitialDataTimestamp(Timestamp initialDataTimestamp)
See StorageEngine::setInitialDataTimestamp
Definition: kv_engine.h:268
virtual bool hasIdent(OperationContext *opCtx, StringData ident) const =0
virtual SnapshotManager * getSnapshotManager() const
Return the SnapshotManager for this KVEngine or NULL if not supported.
Definition: kv_engine.h:250
virtual int flushAllFiles(OperationContext *opCtx, bool sync)
Definition: kv_engine.h:171
virtual boost::optional< Timestamp > getRecoveryTimestamp() const
See StorageEngine::getRecoveryTimestamp
Definition: kv_engine.h:309
This class allows for the storageEngine to alert the rest of the system about journaled write progres...
Definition: journal_listener.h:48
static const KVPrefix kNotPrefixed
Definition: kv_prefix.h:47
virtual Status createRecordStore(OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options)=0
The create and drop methods on KVEngine are not transactional.
virtual Status createSortedDataInterface(OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)=0
Definition: index_key_validate.h:40
A RecoveryUnit is responsible for ensuring that data is persisted.
Definition: recovery_unit.h:51
virtual Status createGroupedSortedDataInterface(OperationContext *opCtx, StringData ident, const IndexDescriptor *desc, KVPrefix prefix)
Create a SortedDataInterface that MongoDB considers eligible to share space in an underlying table wi...
Definition: kv_engine.h:152
virtual std::unique_ptr< RecordStore > getRecordStore(OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options)=0
Having multiple out for the same ns is a rules violation; Calling on a non-created ident is invalid a...
virtual bool isEphemeral() const =0
Returns true if the KVEngine is ephemeral – that is, it is NOT persistent and all data is lost after...
virtual SortedDataInterface * getSortedDataInterface(OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)=0
virtual bool supportsDBLocking() const
This must not change over the lifetime of the engine.
Definition: kv_engine.h:206
An abstraction used for storing documents in a collection or entries in an index. ...
Definition: record_store.h:282
virtual int64_t getIdentSize(OperationContext *opCtx, StringData ident)=0
virtual void endBackup(OperationContext *opCtx)
See StorageEngine::endBackup for details.
Definition: kv_engine.h:186
virtual bool isCacheUnderPressure(OperationContext *opCtx) const
See StorageEngine::isCacheUnderPressure()
Definition: kv_engine.h:283
virtual bool isDurable() const =0
virtual bool supportsDocLocking() const =0
This must not change over the lifetime of the engine.
virtual void replicationBatchIsComplete() const
See StorageEngine::replicationBatchIsComplete()
Definition: kv_engine.h:335
virtual void setOldestTimestampFromStable()
See StorageEngine::setOldestTimestampFromStable
Definition: kv_engine.h:273
OperationContext Database StringData BSONObj options
Definition: database_impl.cpp:949
virtual Status repairIdent(OperationContext *opCtx, StringData ident)=0
virtual void setCachePressureForTest(int pressure)
See 'StorageEngine::setCachePressureForTest()'.
Definition: kv_engine.h:290
A KVPrefix may be prepended to the keys of entries in an underlying KV store.
Definition: kv_prefix.h:44
virtual void setJournalListener(JournalListener *jl)=0
Sets a new JournalListener, which is used to alert the rest of the system about journaled write progr...
Manages snapshots that can be read from at a later time.
Definition: snapshot_manager.h:47
virtual std::vector< std::string > getAllIdents(OperationContext *opCtx) const =0
virtual ~KVEngine()
The destructor will never be called from mongod, but may be called from tests.
Definition: kv_engine.h:342
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
virtual Status beginBackup(OperationContext *opCtx)
See StorageEngine::beginBackup for details.
Definition: kv_engine.h:178
virtual bool supportsDirectoryPerDB() const =0
Returns true if storage engine supports –directoryperdb.
virtual void setOldestTimestamp(Timestamp newOldestTimestamp)
See StorageEngine::setOldestTimestamp
Definition: kv_engine.h:278
virtual std::unique_ptr< RecordStore > getGroupedRecordStore(OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options, KVPrefix prefix)
Get a RecordStore that may share an underlying table with other RecordStores.
Definition: kv_engine.h:76
OperationContext const IndexDescriptor * desc
Definition: index_catalog_impl.cpp:97
virtual RecoveryUnit * newRecoveryUnit()=0
This interface is a work in progress.
Definition: sorted_data_interface.h:64
virtual SortedDataInterface * getGroupedSortedDataInterface(OperationContext *opCtx, StringData ident, const IndexDescriptor *desc, KVPrefix prefix)
Get a SortedDataInterface that may share an underlying table with other SortedDataInterface.
Definition: kv_engine.h:98