Merge "Add shell cmd blob_store idle-maintenance." into rvc-dev am: 29c8617d36 am: f379a1090c am: 6e836c6ba3

Change-Id: I8ef58dc29121fdb1794bb4c71caef66925394846
This commit is contained in:
Automerger Merge Worker
2020-03-05 22:51:59 +00:00
2 changed files with 16 additions and 3 deletions

View File

@@ -939,6 +939,12 @@ public class BlobStoreManagerService extends SystemService {
}
}
void runIdleMaintenance() {
synchronized (mBlobsLock) {
handleIdleMaintenanceLocked();
}
}
@GuardedBy("mBlobsLock")
private void dumpSessionsLocked(IndentingPrintWriter fout, DumpArgs dumpArgs) {
for (int i = 0, userCount = mSessions.size(); i < userCount; ++i) {
@@ -1408,9 +1414,7 @@ public class BlobStoreManagerService extends SystemService {
private class LocalService extends BlobStoreManagerInternal {
@Override
public void onIdleMaintenance() {
synchronized (mBlobsLock) {
handleIdleMaintenanceLocked();
}
runIdleMaintenance();
}
}

View File

@@ -44,6 +44,8 @@ class BlobStoreManagerShellCommand extends ShellCommand {
return runClearAllBlobs(pw);
case "delete-blob":
return runDeleteBlob(pw);
case "idle-maintenance":
return runIdleMaintenance(pw);
default:
return handleDefaultCommands(cmd);
}
@@ -84,6 +86,11 @@ class BlobStoreManagerShellCommand extends ShellCommand {
return 0;
}
private int runIdleMaintenance(PrintWriter pw) {
mService.runIdleMaintenance();
return 0;
}
@Override
public void onHelp() {
final PrintWriter pw = getOutPrintWriter();
@@ -112,6 +119,8 @@ class BlobStoreManagerShellCommand extends ShellCommand {
pw.println(" --expiry: Expiry time of the blob to delete, in milliseconds.");
pw.println(" --label: Label of the blob to delete.");
pw.println(" --tag: Tag of the blob to delete.");
pw.println("idle-maintenance");
pw.println(" Run idle maintenance which takes care of removing stale data.");
pw.println();
}