1
0
Fork 0

removed old CRUD methods

This commit is contained in:
Jan Steemann 2014-05-22 12:17:51 +02:00
parent da1aaf1315
commit de14fa5944
7 changed files with 31 additions and 902 deletions

View File

@ -274,7 +274,7 @@ int Syncer::applyCollectionDumpMarker (TRI_transaction_collection_t* trxCollecti
if (shaped != 0) {
TRI_doc_mptr_t mptr;
int res = primary->read(trxCollection, key, &mptr, false);
int res = primary->readDocument(trxCollection, key, &mptr, false);
if (res == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) {
// insert
@ -305,7 +305,7 @@ int Syncer::applyCollectionDumpMarker (TRI_transaction_collection_t* trxCollecti
}
if (res == TRI_ERROR_NO_ERROR) {
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_EDGE, shaped, &edge, false, false, true);
res = primary->insertDocument(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_EDGE, shaped, &edge, false, false, true);
}
}
else {
@ -314,13 +314,13 @@ int Syncer::applyCollectionDumpMarker (TRI_transaction_collection_t* trxCollecti
res = TRI_ERROR_ARANGO_COLLECTION_TYPE_INVALID;
}
else {
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_DOCUMENT, shaped, 0, false, false, true);
res = primary->insertDocument(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_DOCUMENT, shaped, 0, false, false, true);
}
}
}
else {
// update
res = primary->update(trxCollection, key, rid, &mptr, shaped, &_policy, false, false);
res = primary->updateDocument(trxCollection, key, rid, &mptr, shaped, &_policy, false, false);
}
TRI_FreeShapedJson(zone, shaped);
@ -338,7 +338,7 @@ int Syncer::applyCollectionDumpMarker (TRI_transaction_collection_t* trxCollecti
// {"type":2402,"key":"592063"}
TRI_primary_collection_t* primary = trxCollection->_collection->_collection;
int res = primary->remove(trxCollection, key, rid, &_policy, false, false);
int res = primary->removeDocument(trxCollection, key, rid, &_policy, false, false);
if (res != TRI_ERROR_NO_ERROR) {
if (res == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) {

View File

@ -2459,7 +2459,7 @@ int RestReplicationHandler::applyCollectionDumpMarker (CollectionNameResolver co
if (shaped != 0) {
TRI_doc_mptr_t mptr;
int res = primary->read(trxCollection, key, &mptr, false);
int res = primary->readDocument(trxCollection, key, &mptr, false);
if (res == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) {
// insert
@ -2489,7 +2489,7 @@ int RestReplicationHandler::applyCollectionDumpMarker (CollectionNameResolver co
}
if (res == TRI_ERROR_NO_ERROR) {
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_EDGE, shaped, &edge, false, false, true);
res = primary->insertDocument(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_EDGE, shaped, &edge, false, false, true);
}
}
else {
@ -2498,7 +2498,7 @@ int RestReplicationHandler::applyCollectionDumpMarker (CollectionNameResolver co
res = TRI_ERROR_ARANGO_COLLECTION_TYPE_INVALID;
}
else {
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_DOCUMENT, shaped, 0, false, false, true);
res = primary->insertDocument(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_DOCUMENT, shaped, 0, false, false, true);
}
}
}
@ -2508,7 +2508,7 @@ int RestReplicationHandler::applyCollectionDumpMarker (CollectionNameResolver co
// init the update policy
TRI_doc_update_policy_t policy;
TRI_InitUpdatePolicy(&policy, TRI_DOC_UPDATE_LAST_WRITE, 0, 0);
res = primary->update(trxCollection, key, rid, &mptr, shaped, &policy, false, false);
res = primary->updateDocument(trxCollection, key, rid, &mptr, shaped, &policy, false, false);
}
TRI_FreeShapedJson(zone, shaped);
@ -2529,7 +2529,7 @@ int RestReplicationHandler::applyCollectionDumpMarker (CollectionNameResolver co
TRI_InitUpdatePolicy(&policy, TRI_DOC_UPDATE_LAST_WRITE, 0, 0);
TRI_primary_collection_t* primary = trxCollection->_collection->_collection;
int res = primary->remove(trxCollection, key, rid, &policy, false, false);
int res = primary->removeDocument(trxCollection, key, rid, &policy, false, false);
if (res != TRI_ERROR_NO_ERROR) {
if (res == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) {

View File

@ -538,10 +538,10 @@ namespace triagens {
TRI_primary_collection_t* primary = primaryCollection(trxCollection);
int res = primary->read(trxCollection,
(TRI_voc_key_t) key.c_str(),
mptr,
! isLocked(trxCollection, TRI_TRANSACTION_READ));
int res = primary->readDocument(trxCollection,
(TRI_voc_key_t) key.c_str(),
mptr,
! isLocked(trxCollection, TRI_TRANSACTION_READ));
return res;
}
@ -880,12 +880,12 @@ namespace triagens {
bool lock = ! isLocked(trxCollection, TRI_TRANSACTION_WRITE);
int res = primary->insertDocument(trxCollection,
markerType,
key,
rid,
mptr,
static_cast<TRI_document_edge_t const*>(data),
markerType,
shaped,
static_cast<TRI_document_edge_t const*>(data),
lock,
forceSync,
false);

File diff suppressed because it is too large Load Diff

View File

@ -331,14 +331,8 @@ typedef struct TRI_primary_collection_s {
// WAL-based CRUD methods
int (*updateDocument) (struct TRI_transaction_collection_s*, TRI_voc_key_t, TRI_voc_rid_t, TRI_doc_mptr_t*, TRI_shaped_json_t const*, struct TRI_doc_update_policy_s const*, bool, bool);
int (*removeDocument) (struct TRI_transaction_collection_s*, TRI_voc_key_t, TRI_voc_rid_t, struct TRI_doc_update_policy_s const*, bool, bool);
int (*insertDocument) (struct TRI_transaction_collection_s*, TRI_df_marker_type_e, TRI_voc_key_t, TRI_voc_rid_t, TRI_doc_mptr_t*, struct TRI_document_edge_s const*, TRI_shaped_json_t const*, bool, bool, bool);
// old non-WAL-based CRUD methods
int (*insert) (struct TRI_transaction_collection_s*, const TRI_voc_key_t, TRI_voc_rid_t, TRI_doc_mptr_t*, TRI_df_marker_type_e, TRI_shaped_json_t const*, void const*, const bool, const bool, const bool);
int (*read) (struct TRI_transaction_collection_s*, const TRI_voc_key_t, TRI_doc_mptr_t*, const bool);
int (*update) (struct TRI_transaction_collection_s*, const TRI_voc_key_t, TRI_voc_rid_t, TRI_doc_mptr_t*, TRI_shaped_json_t const*, struct TRI_doc_update_policy_s const*, const bool, const bool);
int (*remove) (struct TRI_transaction_collection_s*, const TRI_voc_key_t, TRI_voc_rid_t, struct TRI_doc_update_policy_s const*, const bool, const bool);
int (*insertDocument) (struct TRI_transaction_collection_s*, TRI_voc_key_t, TRI_voc_rid_t, TRI_doc_mptr_t*, TRI_df_marker_type_e, TRI_shaped_json_t const*, struct TRI_document_edge_s const*, bool, bool, bool);
int (*readDocument) (struct TRI_transaction_collection_s*, const TRI_voc_key_t, TRI_doc_mptr_t*, bool);
TRI_doc_collection_info_t* (*figures) (struct TRI_primary_collection_s* collection);
TRI_voc_size_t (*size) (struct TRI_primary_collection_s* collection);

View File

@ -521,7 +521,7 @@ static int LogEvent (TRI_replication_logger_t* logger,
return TRI_ERROR_ARANGO_SHAPER_FAILED;
}
res = primary->insert(logger->_trxCollection,
res = primary->insertDocument(logger->_trxCollection,
NULL,
0,
&mptr,

View File

@ -500,7 +500,7 @@ static int InsertTrxCallback (TRI_transaction_collection_t* trxCollection,
return TRI_ERROR_OUT_OF_MEMORY;
}
res = primary->insert(trxCollection,
res = primary->insertDocument(trxCollection,
coordinator->_key,
0,
&coordinator->_mptr,
@ -529,7 +529,7 @@ static int RemoveTrxCallback (TRI_transaction_collection_t* trxCollection,
primary = (TRI_primary_collection_t*) trxCollection->_collection->_collection;
coordinator = static_cast<trx_coordinator_t*>(data);
res = primary->remove(trxCollection, coordinator->_key, 0, NULL, false, true);
res = primary->removeDocument(trxCollection, coordinator->_key, 0, NULL, false, true);
return res;
}