def _graph_index_page_rec(self, page): print(" \"node{:s}\" [".format(h(page.logical_page_number))) print(" label = \"{:s}\"".format(self._format_index_page(page))) print(" shape = \"record\"") print(" ];") key_count = page.key_count for i in xrange(key_count + 1): child_page_number = page.get_child(i) if not is_index_page_number_valid(child_page_number): continue child_page = self._cim.logical_index_store.get_page(child_page_number) self._graph_index_page_rec(child_page) for i in xrange(key_count): child_page_number = page.get_child(i) if not is_index_page_number_valid(child_page_number): continue print(" \"node{num:s}\":child_{i:s} -> \"node{child:s}\"".format( num=h(page.logical_page_number), i=h(i), child=h(child_page_number))) # last entry has two links, to both less and greater children nodes final_child_index = page.get_child(key_count) if is_index_page_number_valid(final_child_index): print(" \"node{num:s}\":child_{i:s} -> \"node{child:s}\"".format( num=h(page.logical_page_number), i=h(key_count - 1), child=h(final_child_index)))
def _printPageRec(self, page): for i in range(page.key_count): key = page.get_key(i) print(key.human_format) keyCount = page.key_count for i in range(keyCount + 1): childIndex = page.get_child(i) if not is_index_page_number_valid(childIndex): continue i = self._cim.logical_index_store self._printPageRec(i.get_page(childIndex))