summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/hashserv/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/hashserv/client.py')
-rw-r--r--bitbake/lib/hashserv/client.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/client.py b/bitbake/lib/hashserv/client.py
index 35a97687fb..e6dc417912 100644
--- a/bitbake/lib/hashserv/client.py
+++ b/bitbake/lib/hashserv/client.py
@@ -194,6 +194,34 @@ class AsyncClient(bb.asyncrpc.AsyncClient):
194 await self._set_mode(self.MODE_NORMAL) 194 await self._set_mode(self.MODE_NORMAL)
195 return (await self.invoke({"get-db-query-columns": {}}))["columns"] 195 return (await self.invoke({"get-db-query-columns": {}}))["columns"]
196 196
197 async def gc_status(self):
198 await self._set_mode(self.MODE_NORMAL)
199 return await self.invoke({"gc-status": {}})
200
201 async def gc_mark(self, mark, where):
202 """
203 Starts a new garbage collection operation identified by "mark". If
204 garbage collection is already in progress with "mark", the collection
205 is continued.
206
207 All unihash entries that match the "where" clause are marked to be
208 kept. In addition, any new entries added to the database after this
209 command will be automatically marked with "mark"
210 """
211 await self._set_mode(self.MODE_NORMAL)
212 return await self.invoke({"gc-mark": {"mark": mark, "where": where}})
213
214 async def gc_sweep(self, mark):
215 """
216 Finishes garbage collection for "mark". All unihash entries that have
217 not been marked will be deleted.
218
219 It is recommended to clean unused outhash entries after running this to
220 cleanup any dangling outhashes
221 """
222 await self._set_mode(self.MODE_NORMAL)
223 return await self.invoke({"gc-sweep": {"mark": mark}})
224
197 225
198class Client(bb.asyncrpc.Client): 226class Client(bb.asyncrpc.Client):
199 def __init__(self, username=None, password=None): 227 def __init__(self, username=None, password=None):
@@ -224,6 +252,9 @@ class Client(bb.asyncrpc.Client):
224 "become_user", 252 "become_user",
225 "get_db_usage", 253 "get_db_usage",
226 "get_db_query_columns", 254 "get_db_query_columns",
255 "gc_status",
256 "gc_mark",
257 "gc_sweep",
227 ) 258 )
228 259
229 def _get_async_client(self): 260 def _get_async_client(self):