mirror of https://gitee.com/bigwinds/arangodb
move functionality into engine
This commit is contained in:
parent
434fad5691
commit
ab21b0b1ff
|
@ -66,6 +66,14 @@ class MMFilesTransactionState final : public TransactionState {
|
|||
|
||||
/// @brief add a WAL operation for a transaction collection
|
||||
int addOperation(TRI_voc_rid_t, MMFilesDocumentOperation&, MMFilesWalMarker const* marker, bool&);
|
||||
|
||||
/// @brief get the transaction id for usage in a marker
|
||||
TRI_voc_tid_t idForMarker() {
|
||||
if (isSingleOperation()) {
|
||||
return 0;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
|
||||
private:
|
||||
/// @brief whether or not a marker needs to be written
|
||||
|
|
|
@ -104,14 +104,6 @@ class TransactionState {
|
|||
/// TODO: implement this in base class
|
||||
virtual bool hasFailedOperations() const = 0;
|
||||
|
||||
/// @brief get the transaction id for usage in a marker
|
||||
TRI_voc_tid_t idForMarker() {
|
||||
if (isSingleOperation()) {
|
||||
return 0;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
|
||||
protected:
|
||||
/// @brief find a collection in the transaction's list of collections
|
||||
TransactionCollection* findCollection(TRI_voc_cid_t cid, size_t& position) const;
|
||||
|
|
|
@ -2070,7 +2070,7 @@ int LogicalCollection::insert(Transaction* trx, VPackSlice const slice,
|
|||
// create marker
|
||||
MMFilesCrudMarker insertMarker(
|
||||
TRI_DF_MARKER_VPACK_DOCUMENT,
|
||||
trx->state()->idForMarker(), newSlice);
|
||||
static_cast<MMFilesTransactionState*>(trx->state())->idForMarker(), newSlice);
|
||||
|
||||
MMFilesWalMarker const* marker;
|
||||
if (options.recoveryMarker == nullptr) {
|
||||
|
@ -2266,7 +2266,7 @@ int LogicalCollection::update(Transaction* trx, VPackSlice const newSlice,
|
|||
// create marker
|
||||
MMFilesCrudMarker updateMarker(
|
||||
TRI_DF_MARKER_VPACK_DOCUMENT,
|
||||
trx->state()->idForMarker(), builder->slice());
|
||||
static_cast<MMFilesTransactionState*>(trx->state())->idForMarker(), builder->slice());
|
||||
|
||||
MMFilesWalMarker const* marker;
|
||||
if (options.recoveryMarker == nullptr) {
|
||||
|
@ -2428,7 +2428,7 @@ int LogicalCollection::replace(Transaction* trx, VPackSlice const newSlice,
|
|||
// create marker
|
||||
MMFilesCrudMarker replaceMarker(
|
||||
TRI_DF_MARKER_VPACK_DOCUMENT,
|
||||
trx->state()->idForMarker(), builder->slice());
|
||||
static_cast<MMFilesTransactionState*>(trx->state())->idForMarker(), builder->slice());
|
||||
|
||||
MMFilesWalMarker const* marker;
|
||||
if (options.recoveryMarker == nullptr) {
|
||||
|
@ -2525,7 +2525,7 @@ int LogicalCollection::remove(arangodb::Transaction* trx,
|
|||
|
||||
// create marker
|
||||
MMFilesCrudMarker removeMarker(
|
||||
TRI_DF_MARKER_VPACK_REMOVE, trx->state()->idForMarker(),
|
||||
TRI_DF_MARKER_VPACK_REMOVE, static_cast<MMFilesTransactionState*>(trx->state())->idForMarker(),
|
||||
builder->slice());
|
||||
|
||||
MMFilesWalMarker const* marker;
|
||||
|
@ -2656,7 +2656,7 @@ int LogicalCollection::remove(arangodb::Transaction* trx,
|
|||
|
||||
// create marker
|
||||
MMFilesCrudMarker removeMarker(
|
||||
TRI_DF_MARKER_VPACK_REMOVE, trx->state()->idForMarker(),
|
||||
TRI_DF_MARKER_VPACK_REMOVE, static_cast<MMFilesTransactionState*>(trx->state())->idForMarker(),
|
||||
builder->slice());
|
||||
|
||||
MMFilesWalMarker const* marker = &removeMarker;
|
||||
|
|
Loading…
Reference in New Issue