Skip to content

Commit 0e533a7

Browse files
authored
Remove typed_print (#7868)
* remove typed_print * fix compress all builder
1 parent 3e32e5f commit 0e533a7

File tree

15 files changed

+5
-288
lines changed

15 files changed

+5
-288
lines changed

evergreen/config.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,19 +1863,18 @@ buildvariants:
18631863
- name: finalize_coverage_data
18641864

18651865
- name: macos-array-compression
1866-
display_name: "MacOS 11 arm64 (Compress Arrays)"
1867-
run_on: macos-1100-arm64
1866+
display_name: "MacOS 14 arm64 (Compress Arrays)"
1867+
run_on: macos-14-arm64
18681868
expansions:
1869-
cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
1870-
cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
1869+
cmake_bindir: "/opt/homebrew/bin"
18711870
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
1871+
cmake_build_tool_options: "-sdk macosx"
18721872
cmake_generator: Xcode
18731873
max_jobs: $(sysctl -n hw.logicalcpu)
1874-
xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
1874+
xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
18751875
extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64
18761876
compress: On
18771877
cmake_build_type: Debug
1878-
coveralls_flag_name: "macos-arm64"
18791878
tasks:
18801879
- name: compile_test
18811880

src/realm/array.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,40 +1080,6 @@ bool QueryStateFindAll<IntegerColumn>::match(size_t index) noexcept
10801080
return (m_limit > m_match_count);
10811081
}
10821082

1083-
void Array::typed_print(std::string prefix) const
1084-
{
1085-
std::cout << "Generic Array " << header_to_string(get_header()) << " @ " << m_ref;
1086-
if (!is_attached()) {
1087-
std::cout << " Unattached";
1088-
return;
1089-
}
1090-
if (size() == 0) {
1091-
std::cout << " Empty" << std::endl;
1092-
return;
1093-
}
1094-
std::cout << " size = " << size() << " {";
1095-
if (has_refs()) {
1096-
std::cout << std::endl;
1097-
for (unsigned n = 0; n < size(); ++n) {
1098-
auto pref = prefix + " " + to_string(n) + ":\t";
1099-
RefOrTagged rot = get_as_ref_or_tagged(n);
1100-
if (rot.is_ref() && rot.get_as_ref()) {
1101-
Array a(m_alloc);
1102-
a.init_from_ref(rot.get_as_ref());
1103-
std::cout << pref;
1104-
a.typed_print(pref);
1105-
}
1106-
else if (rot.is_tagged()) {
1107-
std::cout << pref << rot.get_as_int() << std::endl;
1108-
}
1109-
}
1110-
std::cout << prefix << "}" << std::endl;
1111-
}
1112-
else {
1113-
std::cout << " Leaf of unknown type }" << std::endl;
1114-
}
1115-
}
1116-
11171083
ref_type ArrayPayload::typed_write(ref_type ref, _impl::ArrayWriterBase& out, Allocator& alloc)
11181084
{
11191085
Array arr(alloc);

src/realm/array.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,6 @@ class Array : public Node, public ArrayParent {
506506
/// log2. Possible results {0, 1, 2, 4, 8, 16, 32, 64}
507507
static uint8_t bit_width(int64_t value);
508508

509-
void typed_print(std::string prefix) const;
510-
511509
protected:
512510
friend class NodeTree;
513511
void copy_on_write();

src/realm/bplustree.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -867,37 +867,6 @@ ref_type BPlusTreeBase::typed_write(ref_type ref, _impl::ArrayWriterBase& out, A
867867
return written_node.write(out);
868868
}
869869

870-
void BPlusTreeBase::typed_print(std::string prefix, Allocator& alloc, ref_type root, ColumnType col_type)
871-
{
872-
char* header = alloc.translate(root);
873-
Array a(alloc);
874-
a.init_from_ref(root);
875-
if (NodeHeader::get_is_inner_bptree_node_from_header(header)) {
876-
std::cout << "{" << std::endl;
877-
REALM_ASSERT(a.has_refs());
878-
for (unsigned j = 0; j < a.size(); ++j) {
879-
auto pref = prefix + " " + std::to_string(j) + ":\t";
880-
RefOrTagged rot = a.get_as_ref_or_tagged(j);
881-
if (rot.is_ref() && rot.get_as_ref()) {
882-
if (j == 0) {
883-
std::cout << pref << "BPTree offsets as ArrayUnsigned as ";
884-
Array a(alloc);
885-
a.init_from_ref(rot.get_as_ref());
886-
a.typed_print(prefix);
887-
}
888-
else {
889-
std::cout << pref << "Subtree beeing ";
890-
BPlusTreeBase::typed_print(pref, alloc, rot.get_as_ref(), col_type);
891-
}
892-
}
893-
}
894-
}
895-
else {
896-
std::cout << "BPTree Leaf[" << col_type << "] as ";
897-
a.typed_print(prefix);
898-
}
899-
}
900-
901870
size_t BPlusTreeBase::size_from_header(const char* header)
902871
{
903872
auto node_size = Array::get_size_from_header(header);

src/realm/bplustree.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ class BPlusTreeBase {
219219
}
220220

221221
static ref_type typed_write(ref_type, _impl::ArrayWriterBase&, Allocator&, TypedWriteFunc);
222-
static void typed_print(std::string prefix, Allocator& alloc, ref_type root, ColumnType col_type);
223-
224222

225223
protected:
226224
template <class U>

src/realm/cluster.cpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,76 +1713,4 @@ ref_type Cluster::typed_write(ref_type ref, _impl::ArrayWriterBase& out) const
17131713
}
17141714
return written_cluster.write(out);
17151715
}
1716-
1717-
void Cluster::typed_print(std::string prefix) const
1718-
{
1719-
REALM_ASSERT_DEBUG(!get_is_inner_bptree_node_from_header(get_header()));
1720-
std::cout << "Cluster of size " << size() << " " << header_to_string(get_header()) << std::endl;
1721-
const auto table = get_owning_table();
1722-
for (unsigned j = 0; j < size(); ++j) {
1723-
RefOrTagged rot = get_as_ref_or_tagged(j);
1724-
auto pref = prefix + " " + std::to_string(j) + ":\t";
1725-
if (rot.is_ref() && rot.get_as_ref()) {
1726-
if (j == 0) {
1727-
std::cout << pref << "Keys as ArrayUnsigned as ";
1728-
Array a(m_alloc);
1729-
a.init_from_ref(rot.get_as_ref());
1730-
a.typed_print(pref);
1731-
}
1732-
else {
1733-
auto col_key = table->m_leaf_ndx2colkey[j - 1];
1734-
auto col_type = col_key.get_type();
1735-
auto col_attr = col_key.get_attrs();
1736-
std::string attr_string;
1737-
if (col_attr.test(col_attr_Dictionary))
1738-
attr_string = "Dict:";
1739-
if (col_attr.test(col_attr_List))
1740-
attr_string = "List:";
1741-
if (col_attr.test(col_attr_Set))
1742-
attr_string = "Set:";
1743-
if (col_attr.test(col_attr_Nullable))
1744-
attr_string += "Null:";
1745-
std::cout << pref << "Column[" << attr_string << col_type << "] as ";
1746-
// special cases for the types we want to compress
1747-
if (col_attr.test(col_attr_List) || col_attr.test(col_attr_Set)) {
1748-
// That is a single bplustree
1749-
// propagation of nullable missing here?
1750-
// handling of mixed missing here?
1751-
BPlusTreeBase::typed_print(pref, m_alloc, rot.get_as_ref(), col_type);
1752-
}
1753-
else if (col_attr.test(col_attr_Dictionary)) {
1754-
Array dict_top(m_alloc);
1755-
dict_top.init_from_ref(rot.get_as_ref());
1756-
if (dict_top.size() == 0) {
1757-
std::cout << "{ empty }" << std::endl;
1758-
continue;
1759-
}
1760-
std::cout << "{" << std::endl;
1761-
auto ref0 = dict_top.get_as_ref(0);
1762-
if (ref0) {
1763-
auto p = pref + " 0:\t";
1764-
std::cout << p;
1765-
BPlusTreeBase::typed_print(p, m_alloc, ref0, col_type);
1766-
}
1767-
if (dict_top.size() == 1) {
1768-
continue; // is this really possible? or should all dicts have both trees?
1769-
}
1770-
auto ref1 = dict_top.get_as_ref(1);
1771-
if (ref1) {
1772-
auto p = pref + " 1:\t";
1773-
std::cout << p;
1774-
BPlusTreeBase::typed_print(p, m_alloc, dict_top.get_as_ref(1), col_type);
1775-
}
1776-
}
1777-
else {
1778-
// handle all other cases as generic arrays
1779-
Array a(m_alloc);
1780-
a.init_from_ref(rot.get_as_ref());
1781-
a.typed_print(pref);
1782-
}
1783-
}
1784-
}
1785-
}
1786-
}
1787-
17881716
} // namespace realm

src/realm/cluster.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,6 @@ class ClusterNode : public Array {
214214
}
215215
virtual ref_type typed_write(ref_type ref, _impl::ArrayWriterBase& out) const = 0;
216216

217-
virtual void typed_print(std::string prefix) const
218-
{
219-
static_cast<void>(get_owning_table());
220-
std::cout << "ClusterNode as ";
221-
Array::typed_print(prefix);
222-
}
223-
224217
protected:
225218
#if REALM_MAX_BPNODE_SIZE > 256
226219
static constexpr int node_shift_factor = 8;
@@ -329,7 +322,6 @@ class Cluster : public ClusterNode {
329322
void verify() const;
330323
void dump_objects(int64_t key_offset, std::string lead) const override;
331324
virtual ref_type typed_write(ref_type ref, _impl::ArrayWriterBase& out) const override;
332-
virtual void typed_print(std::string prefix) const override;
333325
static void remove_backlinks(const Table* origin_table, ObjKey origin_key, ColKey col,
334326
const std::vector<ObjKey>& keys, CascadeState& state);
335327
static void remove_backlinks(const Table* origin_table, ObjKey origin_key, ColKey col,

src/realm/cluster_tree.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -165,43 +165,6 @@ class ClusterNodeInner : public ClusterNode {
165165
return written_node.write(out);
166166
}
167167

168-
virtual void typed_print(std::string prefix) const override
169-
{
170-
REALM_ASSERT(get_is_inner_bptree_node_from_header(get_header()));
171-
REALM_ASSERT(has_refs());
172-
std::cout << "ClusterNodeInner " << header_to_string(get_header()) << std::endl;
173-
for (unsigned j = 0; j < size(); ++j) {
174-
RefOrTagged rot = get_as_ref_or_tagged(j);
175-
auto pref = prefix + " " + std::to_string(j) + ":\t";
176-
if (rot.is_ref() && rot.get_as_ref()) {
177-
if (j == 0) {
178-
std::cout << pref << "Keys as ArrayUnsigned as ";
179-
Array a(m_alloc);
180-
a.init_from_ref(rot.get_as_ref());
181-
a.typed_print(pref);
182-
}
183-
else {
184-
auto header = m_alloc.translate(rot.get_as_ref());
185-
MemRef m(header, rot.get_as_ref(), m_alloc);
186-
if (get_is_inner_bptree_node_from_header(header)) {
187-
ClusterNodeInner a(m_alloc, m_tree_top);
188-
a.init(m);
189-
std::cout << pref;
190-
a.typed_print(pref);
191-
}
192-
else {
193-
Cluster a(j, m_alloc, m_tree_top);
194-
a.init(m);
195-
std::cout << pref;
196-
a.typed_print(pref);
197-
}
198-
}
199-
}
200-
// just ignore entries, which are not refs.
201-
}
202-
Array::typed_print(prefix);
203-
}
204-
205168
private:
206169
static constexpr size_t s_key_ref_index = 0;
207170
static constexpr size_t s_sub_tree_depth_index = 1;

src/realm/cluster_tree.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,6 @@ class ClusterTree {
196196
return m_root->typed_write(ref, out);
197197
}
198198

199-
void typed_print(std::string prefix) const
200-
{
201-
if (m_root) {
202-
std::cout << prefix << "ClusterTree as ";
203-
m_root->typed_print(prefix);
204-
}
205-
else {
206-
std::cout << "Emtpy ClusterTree" << std::endl;
207-
}
208-
}
209-
210199
protected:
211200
friend class Obj;
212201
friend class Cluster;

src/realm/group.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -960,48 +960,6 @@ ref_type Group::typed_write_tables(_impl::ArrayWriterBase& out) const
960960
}
961961
return dest.write(out);
962962
}
963-
void Group::table_typed_print(std::string prefix, ref_type ref) const
964-
{
965-
REALM_ASSERT(m_top.get_as_ref(1) == ref);
966-
Array a(m_alloc);
967-
a.init_from_ref(ref);
968-
REALM_ASSERT(a.has_refs());
969-
for (unsigned j = 0; j < a.size(); ++j) {
970-
auto pref = prefix + " " + to_string(j) + ":\t";
971-
RefOrTagged rot = a.get_as_ref_or_tagged(j);
972-
if (rot.is_tagged() || rot.get_as_ref() == 0)
973-
continue;
974-
auto table_accessor = do_get_table(j);
975-
REALM_ASSERT(table_accessor);
976-
table_accessor->typed_print(pref, rot.get_as_ref());
977-
}
978-
}
979-
void Group::typed_print(std::string prefix) const
980-
{
981-
std::cout << "Group top array" << std::endl;
982-
for (unsigned j = 0; j < m_top.size(); ++j) {
983-
auto pref = prefix + " " + to_string(j) + ":\t";
984-
RefOrTagged rot = m_top.get_as_ref_or_tagged(j);
985-
if (rot.is_ref() && rot.get_as_ref()) {
986-
if (j == 1) {
987-
// Tables
988-
std::cout << pref << "All Tables" << std::endl;
989-
table_typed_print(pref, rot.get_as_ref());
990-
}
991-
else {
992-
Array a(m_alloc);
993-
a.init_from_ref(rot.get_as_ref());
994-
std::cout << pref;
995-
a.typed_print(pref);
996-
}
997-
}
998-
else {
999-
std::cout << pref << rot.get_as_int() << std::endl;
1000-
}
1001-
}
1002-
std::cout << "}" << std::endl;
1003-
}
1004-
1005963

1006964
ref_type Group::DefaultTableWriter::write_names(_impl::OutputStream& out)
1007965
{

0 commit comments

Comments
 (0)