Skip to content

Commit

Permalink
move uses of invokePrivileged to invokePrivilegedAndLogError
Browse files Browse the repository at this point in the history
  • Loading branch information
kartva committed Nov 29, 2023
1 parent 4773f4e commit 89de19a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public EventLogFileHandler(EventLog eventLog, String metricsLocation) {
}

public void writeTmpFile(List<Event> dataEntries, long epoch) {
Util.invokePrivileged(() -> writeTmpFileWithPrivilege(dataEntries, epoch));
Util.invokePrivilegedAndLogError(() -> writeTmpFileWithPrivilege(dataEntries, epoch));
}

/**
Expand Down Expand Up @@ -93,7 +93,7 @@ public void writeTmpFileWithPrivilege(List<Event> dataEntries, long epoch) {
}

public void renameFromTmp(long epoch) {
Util.invokePrivileged(() -> renameFromTmpWithPrivilege(epoch));
Util.invokePrivilegedAndLogError(() -> renameFromTmpWithPrivilege(epoch));
}

public void renameFromTmpWithPrivilege(long epoch) {
Expand Down Expand Up @@ -161,7 +161,7 @@ private void readInternal(Path pathToFile, int bufferSize, EventDispatcher proce
}

public void deleteAllFiles() {
Util.invokePrivileged(this::deleteAllFilesWithPrivilege);
Util.invokePrivilegedAndLogError(this::deleteAllFilesWithPrivilege);
}

public void deleteAllFilesWithPrivilege() {
Expand Down Expand Up @@ -197,6 +197,6 @@ public void deleteFiles(List<String> filesToDelete) {
}

public void removeFilesWithPrivilege(File file) {
Util.invokePrivileged(() -> PerformanceAnalyzerMetrics.removeMetrics(file));
Util.invokePrivilegedAndLogError(() -> PerformanceAnalyzerMetrics.removeMetrics(file));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class Disks {
};

static {
Util.invokePrivileged(() -> listDisks());
Util.invokePrivilegedAndLogError(() -> listDisks());
oldkvTimestamp = System.currentTimeMillis();
kvTimestamp = oldkvTimestamp;
}
Expand Down

0 comments on commit 89de19a

Please sign in to comment.