Skip to content

Commit

Permalink
Fix rename mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
chimp1984 committed Oct 2, 2020
1 parent 4785d9a commit 207d098
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static void flushAllDataToDisk(ResultHandler completeHandler) {
// For Priority.HIGH data we want to write to disk in any case to be on the safe side if we might have missed
// a requestPersistence call after an important state update. Those are usually rather small data stores.
// Otherwise we only persist if requestPersistence was called since the last persist call.
if (persistenceManager.SOURCE.flushAtShutDown || persistenceManager.persistenceRequested) {
if (persistenceManager.source.flushAtShutDown || persistenceManager.persistenceRequested) {
// We don't know from which thread we are called so we map back to user thread when calling persistNow
UserThread.execute(() -> {
// We always get our completeHandler called even if exceptions happen. In case a file write fails
Expand Down Expand Up @@ -160,7 +160,7 @@ public enum Source {
private File storageFile;
private T persistable;
private String fileName;
private Source SOURCE = SOURCE.PRIVATE_LOW_PRIO;
private Source source = Source.PRIVATE_LOW_PRIO;
private Path usedTempFilePath;
private volatile boolean persistenceRequested;
@Nullable
Expand All @@ -185,14 +185,14 @@ public PersistenceManager(@Named(Config.STORAGE_DIR) File dir,
// API
///////////////////////////////////////////////////////////////////////////////////////////

public void initialize(T persistable, Source SOURCE) {
this.initialize(persistable, persistable.getDefaultStorageFileName(), SOURCE);
public void initialize(T persistable, Source sourcce) {
this.initialize(persistable, persistable.getDefaultStorageFileName(), sourcce);
}

public void initialize(T persistable, String fileName, Source SOURCE) {
public void initialize(T persistable, String fileName, Source sourcce) {
this.persistable = persistable;
this.fileName = fileName;
this.SOURCE = SOURCE;
this.source = sourcce;
storageFile = new File(dir, fileName);
ALL_PERSISTENCE_MANAGERS.put(fileName, this);
}
Expand Down Expand Up @@ -268,7 +268,7 @@ public void requestPersistence() {
timer = UserThread.runPeriodically(() -> {
persistNow(null);
UserThread.execute(() -> timer = null);
}, SOURCE.delayInSec, TimeUnit.SECONDS);
}, source.delayInSec, TimeUnit.SECONDS);
}
}

Expand Down Expand Up @@ -299,7 +299,7 @@ public void writeToDisk(protobuf.PersistableEnvelope serialized, @Nullable Runna

try {
// Before we write we backup existing file
FileUtil.rollingBackup(dir, fileName, SOURCE.getNumMaxBackupFiles());
FileUtil.rollingBackup(dir, fileName, source.getNumMaxBackupFiles());

if (!dir.exists() && !dir.mkdir())
log.warn("make dir failed {}", fileName);
Expand Down Expand Up @@ -370,7 +370,7 @@ public String toString() {
",\n dir=" + dir +
",\n storageFile=" + storageFile +
",\n persistable=" + persistable +
",\n priority=" + SOURCE +
",\n priority=" + source +
",\n usedTempFilePath=" + usedTempFilePath +
",\n persistenceRequested=" + persistenceRequested +
"\n}";
Expand Down

0 comments on commit 207d098

Please sign in to comment.