1
0
Fork 0

move functionality into engine

This commit is contained in:
jsteemann 2017-02-09 14:50:41 +01:00
parent 434fad5691
commit ab21b0b1ff
3 changed files with 13 additions and 13 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;