Changeset View
Changeset View
Standalone View
Standalone View
swh/graph/backend.py
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | def __enter__(self): | ||||
self.node2swhid = NodeToSwhidMap(self.graph_path + "." + NODE2SWHID_EXT) | self.node2swhid = NodeToSwhidMap(self.graph_path + "." + NODE2SWHID_EXT) | ||||
self.swhid2node = SwhidToNodeMap(self.graph_path + "." + SWHID2NODE_EXT) | self.swhid2node = SwhidToNodeMap(self.graph_path + "." + SWHID2NODE_EXT) | ||||
self.stream_proxy = JavaStreamProxy(self.entry) | self.stream_proxy = JavaStreamProxy(self.entry) | ||||
return self | return self | ||||
def __exit__(self, exc_type, exc_value, tb): | def __exit__(self, exc_type, exc_value, tb): | ||||
self.gateway.shutdown() | self.gateway.shutdown() | ||||
def get_graph(self): | |||||
return self.entry.get_graph() | |||||
def stats(self): | def stats(self): | ||||
return self.entry.stats() | return self.entry.stats() | ||||
def count(self, ttype, direction, edges_fmt, src): | def count(self, ttype, direction, edges_fmt, src): | ||||
method = getattr(self.entry, "count_" + ttype) | method = getattr(self.entry, "count_" + ttype) | ||||
return method(direction, edges_fmt, src) | return method(direction, edges_fmt, src) | ||||
async def simple_traversal(self, ttype, direction, edges_fmt, src, max_edges): | async def simple_traversal(self, ttype, direction, edges_fmt, src, max_edges): | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |