Commit graph

1308 commits

Author SHA1 Message Date
chimp1984
0cc0cfc9a5
Use runAfter instead of runPeriodically 2020-10-04 12:54:27 -05:00
chimp1984
3b31dc9ff3
Fix typo 2020-10-04 12:53:20 -05:00
chimp1984
a612405d9d
Update common/src/main/java/bisq/common/persistence/PersistenceManager.java
Co-authored-by: sqrrm <sqrrm@users.noreply.github.com>
2020-10-04 12:49:02 -05:00
chimp1984
c9cd58a378
Fix rename mistakes 2020-10-03 12:48:23 -05:00
chimp1984
e9db7c6808
Rename Priority to Source. This should make it more clear what is the intention of the usage.
Rename:
LOW to NETWORK
MID to PRIVATE_LOW_PRIO
HIGH to PRIVATE

Change delay of MID/PRIVATE_LOW_PRIO from 30 min to 2 hours (we had different datastores before using it, now its only real low prio stores)

Add comment to each enum
2020-10-03 12:48:23 -05:00
chimp1984
137b5e81d1
Enforce that clients set the priority. Remove the initialize methods which did not have priority as a param.
Make initializePersistenceManager in StorageService abstract to enforce in concrete class to define priority.

Change priorities for future renaming to a different meaning. instead of priority we want to describe the category: private data, public data,.... will come in next commit
2020-10-03 12:48:22 -05:00
chimp1984
18f64d53ca
Persist all Priority.HIGH stores at shutdown to be more safe that we did not miss any state update.
Priority.HIGH stores are all those which contain private data. Others can be rebuilt from network data or are not critical like navigationPath.
2020-10-03 12:48:22 -05:00
chimp1984
10e9b054a0
Rename writeCompleted to onWriteCompleted
Add comment
Use decrementAndGet instead of getAndDecrement

Tested cases when there is an exception at write to disk, but as we call the result handler in the finally clause we get always called onWriteCompleted, so it cannot happen that we get stuck.
2020-10-03 12:48:22 -05:00
chimp1984
232fa8ddee
Execute result handler on userThread 2020-10-03 12:48:22 -05:00
chimp1984
c789650d0b
Move methods to base class 2020-10-03 12:48:22 -05:00
chimp1984
ccfda5b043
Cleanups, add generics, add final, remove unused code/comments/todos, 2020-10-03 12:48:21 -05:00
chimp1984
fa0d261397
Fix remaining issues, cleanups, add persit calls, remove unused code,...
Sorry too tired to create another 20 commits...
2020-10-03 12:48:21 -05:00
chimp1984
197e871a7b
Remove FileManager ans Storage. All is replaces not by PersistenceManager 2020-10-03 12:48:20 -05:00
chimp1984
1e91b09f7d
Remove persist method 2020-10-03 12:48:18 -05:00
chimp1984
074ed6753b
Remove lombok Delegate from PersistableList
Add final
Add setAll method
Remove Iterable interface
2020-10-03 12:48:17 -05:00
chimp1984
3a348d5a0f
Remove ThreadedPersistableEnvelope and use PersistableEnvelope instead
We will not need threading support anymore once we use the new persistenceManager as serialisation is done on the userThread.
2020-10-03 12:48:16 -05:00
chimp1984
d3be8dd48b
Remove UserThreadMappedPersistableEnvelope and use PersistableEnvelope instead
We will not need threading support anymore once we use the new persistenceManager as serialisation is done on the userThread.
2020-10-03 12:48:16 -05:00
chimp1984
35d9338615
Remove UserThreadMappedPersistableList and use PersistableList instead
We will not need threading support anymore once we use the new persistenceManager as serialisation is done on the userThread.
2020-10-03 12:48:15 -05:00
chimp1984
937c006d73
Add PersistenceManager class 2020-10-03 12:48:15 -05:00
chimp1984
92c9c3cd7e
Add getDefaultStorageFileName method 2020-10-03 12:48:15 -05:00
chimp1984
85b33bcfce
Remove awaitTermination
Remove UserThread.execute on shutdown
Rename threadname
2020-10-03 12:48:15 -05:00
chimp1984
6f6836f733
Refactor: Add removeAndBackupFile method 2020-10-03 12:48:15 -05:00
chimp1984
d27e4dc249
Refactor: Rename fields and methods, return early 2020-10-03 12:48:14 -05:00
chimp1984
802dcad2fb
Refactor: Rename CorruptedDatabaseFilesHandler 2020-10-03 12:48:14 -05:00
chimp1984
cda9d9eccf
Refactor: Move other 2 classes to file package 2020-10-03 12:48:14 -05:00
chimp1984
23507102dd
Refactor: Move CorruptedDatabaseFilesHandler 2020-10-03 12:48:14 -05:00
chimp1984
8aff1f8665
Refactor: Move FileUtil 2020-10-03 12:48:14 -05:00
chimp1984
25a7979b02
Merge branch 'master_upstream' into reduce-initial-date-request 2020-10-02 13:05:56 -05:00
chimp1984
f5862ec2f6
UserThread must not be used before application is created. 2020-10-01 23:01:49 -05:00
chimp1984
3df2f7e177
Add HISTORY field. Make isNewVersion public 2020-10-01 15:06:34 -05:00
chimp1984
df90b2440a
Add new methods and refactor APIs. Needed later for new classes.... 2020-10-01 15:02:44 -05:00
chimp1984
ff1380481d
Merge branch 'master_upstream' into improve-startup-routines
# Conflicts:
#	core/src/main/java/bisq/core/app/BisqSetup.java
2020-10-01 10:34:43 -05:00
chimp1984
9fce06832d
Rename baseCurrencyNetworkParameters to networkParameters 2020-10-01 09:46:11 -05:00
chimp1984
0af9e133a4
Cleanups 2020-10-01 09:42:33 -05:00
chimp1984
fb41a1984b
Merge branch 'master_upstream' into fix-delayed-payout-tx-issues
# Conflicts:
#	core/src/main/java/bisq/core/trade/TradeManager.java
#	desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java
2020-10-01 09:24:46 -05:00
chimp1984
6e7e975c05
Improve printSystemLoad 2020-09-30 23:03:11 -05:00
chimp1984
346ad517a1
Refactor: Move osUserDataDir method to Utilities, rename to getUserDataDir 2020-09-30 22:43:11 -05:00
chimp1984
a38f59a88a
Refactor: Move common bases setup code to CommonSetup 2020-09-30 22:36:18 -05:00
chimp1984
51ce37ded9
Refactor: Rearrange methods 2020-09-30 22:32:47 -05:00
chimp1984
073f1630b1
Remove Remove LimitedKeyStrengthException as not needed anymore 2020-09-30 22:32:10 -05:00
chimp1984
49866508c1
Remove checkCryptoPolicySetup as not needed anymore 2020-09-30 22:31:37 -05:00
chimp1984
4f9a6ea436
Refactor: Move periodic printSystemLoad to commonSetup 2020-09-30 22:17:36 -05:00
chimp1984
516da22a09
Refactor: Add setup method in DevEnv 2020-09-30 22:12:20 -05:00
chimp1984
b927f9719e
Refactor: Move DevEnv setup to CommonSetup 2020-09-30 22:11:29 -05:00
chimp1984
9d12bf7d52
Refactor: Move sig int handlers to CommonSetup 2020-09-30 22:10:44 -05:00
chimp1984
7ea3676c55
Refactor: Rename setup to setupUncaughtExceptionHandler
rename setupErrorHandler to checkCryptoPolicySetup
move UncaughtExceptionHandler code to setupUncaughtExceptionHandler
2020-09-30 21:55:50 -05:00
chimp1984
b6e97e371e
Refactor: add new setup method to CommonSetup with config (WIP) and call it at doExecute. Move AsciiLogo to CommonSetup 2020-09-30 21:53:29 -05:00
chimp1984
fe7ccbd6f9
Refactor: extract method 2020-09-30 21:51:31 -05:00
chimp1984
b73fff0aad
Refactor: Move AsciiLogo to common 2020-09-30 21:50:47 -05:00
chimp1984
3242d86321
Apply code inspection suggestions 2020-09-29 13:08:55 -05:00