MCPcopy Create free account
hub / github.com/PyTables/PyTables / flush_nodes

Method flush_nodes

tables/file.py:500–517  ·  view source on GitHub ↗

Flush all nodes.

(self)

Source from the content-addressed store, hash-verified

498 node._f_close()
499
500 def flush_nodes(self) -> None:
501 """Flush all nodes."""
502 # Only iter on the nodes in the registry since nodes in the cache
503 # should always have an entry in the registry
504 closed_keys = []
505 for path, node in list(self.registry.items()):
506 if not node._v_isopen:
507 closed_keys.append(path)
508 elif "/_i_" not in path: # Indexes are not necessary to be flushed
509 if isinstance(node, Leaf):
510 node.flush()
511
512 for path in closed_keys:
513 # self.cache.pop(path, None)
514 if path in self.cache:
515 warnings.warn("closed node the cache: ``%s``" % path)
516 self.cache.pop(path, None)
517 self.registry.pop(path)
518
519 @staticmethod
520 def _close_nodes(

Callers 1

flushMethod · 0.80

Calls 4

popMethod · 0.80
itemsMethod · 0.45
appendMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected