Skip to content

Commit

Permalink
Remove the use of GlobalKey
Browse files Browse the repository at this point in the history
We no longer support syncing tables without primary key, so this can be
removed. However the management of tombstones did somewhat rely on this,
so a more primitive approach where we just make a linear search for
potential tombstone that must be revived. This is  of course slow, but
since this in on the local_only branch, tombstones are only used in some
copy operation.
  • Loading branch information
jedelbo committed Aug 30, 2024
1 parent b61ebdb commit 09e2541
Show file tree
Hide file tree
Showing 17 changed files with 95 additions and 830 deletions.
2 changes: 0 additions & 2 deletions src/realm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ set(REALM_SOURCES
mixed.cpp
obj.cpp
object_converter.cpp
global_key.cpp
query_engine.cpp
query_expression.cpp
query_value.cpp
Expand Down Expand Up @@ -157,7 +156,6 @@ set(REALM_INSTALL_HEADERS
error_codes.h
error_codes.hpp
exceptions.hpp
global_key.hpp
group.hpp
group_writer.hpp
handover_defs.hpp
Expand Down
1 change: 0 additions & 1 deletion src/realm/cluster_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,6 @@ void ClusterTree::erase(ObjKey k, CascadeState& state)
}
}
}
m_owner->free_local_id_after_hash_collision(k);
m_owner->erase_from_search_indexes(k);

size_t root_size = m_root->erase(ClusterNode::RowKey(k), state);
Expand Down
176 changes: 0 additions & 176 deletions src/realm/global_key.cpp

This file was deleted.

160 changes: 0 additions & 160 deletions src/realm/global_key.hpp

This file was deleted.

5 changes: 0 additions & 5 deletions src/realm/obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ Obj::Obj(TableRef table, MemRef mem, ObjKey key, size_t row_ndx)
m_storage_version = get_alloc().get_storage_version();
}

GlobalKey Obj::get_object_id() const
{
return m_table->get_object_id(m_key);
}

ObjLink Obj::get_link() const
{
return ObjLink(m_table->get_key(), m_key);
Expand Down
2 changes: 0 additions & 2 deletions src/realm/obj.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class ClusterTree;
class TableView;
class CascadeState;
class ObjList;
struct GlobalKey;

template <class>
class Lst;
Expand Down Expand Up @@ -100,7 +99,6 @@ class Obj {
{
return m_key;
}
GlobalKey get_object_id() const;
ObjLink get_link() const;

/// Check if the object is still alive
Expand Down
Loading

0 comments on commit 09e2541

Please sign in to comment.