MCPcopy Create free account
hub / github.com/activeloopai/deeplake / tuple_update

Method tuple_update

cpp/deeplake_pg/table_am.cpp:1096–1133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1094}
1095
1096TM_Result deeplake_table_am_routine::tuple_update(Relation rel,
1097 ItemPointer otid,
1098 TupleTableSlot* slot,
1099 CommandId cid,
1100 Snapshot snapshot,
1101 Snapshot crosscheck,
1102 bool wait,
1103 TM_FailureData* tmfd,
1104 LockTupleMode* lockmode,
1105 TU_UpdateIndexes* update_indexes)
1106{
1107 const auto table_id = RelationGetRelid(rel);
1108
1109 // Convert slot to HeapTuple
1110 HeapTuple tuple = ExecFetchSlotHeapTuple(slot, true, nullptr);
1111 if (tuple == nullptr) {
1112 ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Failed to fetch tuple from slot")));
1113 }
1114
1115 // Update the tuple in our storage
1116 try {
1117 if (!table_storage::instance().update_tuple(table_id, otid, tuple)) {
1118 ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Failed to update tuple")));
1119 }
1120 } catch (const std::exception& e) {
1121 ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Failed to update tuple: %s", e.what())));
1122 }
1123
1124 // Report to statistics collector
1125 // Deeplake has no HOT updates (columnar storage), so hot_update = false
1126 // newpage_update also false for columnar storage simplification
1127 pgstat_count_heap_update(rel, false, false);
1128
1129 // Increment version to notify other backends
1130 table_version_tracker::increment_version(table_id);
1131
1132 return TM_Ok;
1133}
1134
1135void deeplake_table_am_routine::relation_set_new_node(
1136 Relation rel, const RelFileLocator* newrnode, char persistence, TransactionId* freezeXid, MultiXactId* minmulti)

Callers

nothing calls this directly

Calls 2

update_tupleMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected