Commit Graph

2884 Commits

Author SHA1 Message Date
Rsl1122
e398a53425 Refactored UsersTable#getUserInformation to a query 2019-02-16 14:29:10 +02:00
Rsl1122
ee74fc328e Refactored BukkitImporter to use new db things:
- Refactored UsersTable#getSavedUUIDs to a query
- Removed #getRegisterDates, #updateName, #getAllTimesKicked,
  #getUUIDsAndNamesByID - not used
- Refactored UserInfoTable#getSavedUUIDs to a query
- Removed UserInfoTable#getServerUserInfo - not used
2019-02-16 14:29:09 +02:00
Rsl1122
9616d5b6f0 Fixed possible ExecutorService leak in BukkitImporter 2019-02-16 14:29:08 +02:00
Rsl1122
4f68a59dcb Removed old world removal from UserImportRefiner 2019-02-16 14:29:08 +02:00
Rsl1122
29bd29979a Missing license header added 2019-02-16 14:29:07 +02:00
Rsl1122
8eede58cd6 SessionsTable now static information class:
- Made constructor private
- Removed getter in SQLDB
2019-02-16 14:29:06 +02:00
Rsl1122
2b9199d2e2 Refactored SessionsTable#getIDServerIDRelation to a query 2019-02-16 14:29:06 +02:00
Rsl1122
f4adf4a52c Removed 3 SessionsTable methods - not used:
- getPlaytime, getPlaytimeOfServer, getSessionCount
2019-02-16 14:29:05 +02:00
Rsl1122
57bc5b532e ServerTable now a static information class:
- Made constructor private
- Removed getter in SQLDB
2019-02-16 14:29:04 +02:00
Rsl1122
817d157065 Refactored ServerTable#getServerNames to a query 2019-02-16 14:29:03 +02:00
Rsl1122
240b6cb29e Refactored ServerTable#setAsUninstalled to a transaction 2019-02-16 14:29:02 +02:00
Rsl1122
1810a758f2 Missing license header added 2019-02-16 14:29:01 +02:00
Rsl1122
4cc310f8a6 Removed ServerTable#getServerID - no longer used 2019-02-16 14:29:00 +02:00
Rsl1122
029c1378f3 [#746] Made Server UUID generation random
- Refactored ServerInfo classes a bit in this commit, made them use
  Optional<Server> instead of Optional<Integer> (server id)
- Removed all uses of FetchOperations#getServerId
2019-02-16 14:28:59 +02:00
Rsl1122
f0f32f3ec4 Refactored ServerTable#saveCurrentServerInfo to a transaction 2019-02-16 14:28:58 +02:00
Rsl1122
2e9f6148d6 Fixed Smells, Level Minor (SonarCloud):
- Function<String, String> in GeoInfoStoreTransaction
- Unused throws clause in Version10Patch
- Bad variable name in UsersTable

- Fixed WorldTimesQueries again
2019-02-16 14:28:58 +02:00
Rsl1122
32f3cae7c4 More smells:
- Fixed accidental breakage of a WorldTimes query

Fixed Smells, Level Major (SonarCloud):
- Use of keySet instead of entrySet in LargeStoreQueries
- Unused variable in NicknameQueries now used
- Unused fields removed from UsersTable
- Unused fields removed from PlayerProcessors
- Same variable name as field in WorldMap
2019-02-16 14:28:57 +02:00
Rsl1122
4eb8c6476a Bunch of code smells:
- Sorted out SessionQueries ORDER BY usefulness with a TreeMap

Level Critical (SonarCloud):
- Smell: Duplicated String literals in the Queries: " FROM ", " WHERE ",
  " AND ", etc
- Smell: GeoInfoStoreTransaction static value assignment
- Smell: Patch - Duplicate switch case
- Smell: DataCache - Empty constructor without comment
2019-02-16 14:28:55 +02:00
Rsl1122
23799d303f Moved db init transactions to their own package 2019-02-16 14:28:54 +02:00
Rsl1122
18cc7af151 Optimized CleanTransaction inactive player query
- Removed SessionsTable#getLastSeenForAllPlayers
- Made a test to ensure that the clean transaction does not delete all
  players
- Fixed Peak player count fetch statement
2019-02-16 14:28:53 +02:00
Rsl1122
6f474d2aea Moved 4 command transactions to their own package 2019-02-16 14:28:52 +02:00
Rsl1122
b9164d7eff Made SettingsTable into a static information class:
- Made constructor private
- Removed getter in SQLDB
2019-02-16 14:28:52 +02:00
Rsl1122
59040df981 Refactored SettingsTable#fetchNewerConfig to a query 2019-02-16 14:28:51 +02:00
Rsl1122
1cf8daf6c2 Refactored SettingsTable#storeConfig to a transaction 2019-02-16 14:28:50 +02:00
Rsl1122
edcd7bd53a Made KillsTable static information class:
- Made KillsTable constructor private
- Removed getter in SQLDB
2019-02-16 14:28:50 +02:00
Rsl1122
2d5f9254ed Made WorldTimesTable static information class:
- Made WorldTimesTable constructor private
- Removed getter in SQLDB
2019-02-16 14:28:49 +02:00
Rsl1122
038d0354a0 Removed unused Session Query 2019-02-16 14:28:48 +02:00
Rsl1122
adb2b865e1 Refactored many session fetch methods to queries:
- Sessions of a Server
- Sessions of a Player
- Flat sessions with kills and world data

Removed:
- KillsTable#addKillsToSessions(UUID uuid, Map<Integer, Session>)
- KillsTable#addDeathsToSessions(UUID uuid, Map<Integer, Session>)
- WorldTimesTable#addWorldTimesToSessions(UUID uuid, Map<Integer, Session> sessions)
- SessionsTable#getSessionInformation, #getSessions, #getSessionInfoOfServer
2019-02-16 14:28:47 +02:00
Rsl1122
70417f5359 Fixed test failures, 3 bugs:
- RawDataContainer using getUnsafe in getValue which threw error where
  no error should be thrown
- BaseUserQueries#fetchServerBaseUsers had ambiguous registered column
- WorldTimesQueries#fetchPlayerWorldTimesOnServers had ambiguous
  server_uuid column
2019-02-16 14:28:47 +02:00
Rsl1122
4d951cea20 Optimized ServerPlayerContainersQuery PerServerContainer creation 2019-02-16 14:28:46 +02:00
Rsl1122
7657527e73 Some query optimizations to ServerPlayerContainersQuery:
- Sorted out BaseUser, UserInfo debacle
- GeoInfo query no longer fetches GeoInfo of all servers
- Nickname query no longer fetches Nicknames of all servers
- Ping query no longer fetches Ping of all servers
- Left some comments with what still needs work
2019-02-16 14:28:46 +02:00
Rsl1122
54460bc8e1 Moved Queries around to make it easier to find them.
This is done because I had forgotten where a lot of the queries
resided, meaning that the location of each query was not intuitive.

New ordering attempts to have objects that can be filtered by different
variables (Server UUID, Player UUID for example) near each other.
2019-02-16 14:28:45 +02:00
Rsl1122
faa9af5eb5 Made larger Containers use DynamicDataContainer
This should optimize small object creation for cases where a lot of
raw data is stored, as no extra supplier needs to be created
2019-02-16 14:28:43 +02:00
Rsl1122
01a9bdd457 Created two new implementations of DataContainer
- RawDataContainer, stores all values as the objects instead of
  using any Suppliers
- DynamicDataContainer, stores all values in either RawDataContainer or
  SupplierDataContainer based on which methods are called
2019-02-16 14:28:43 +02:00
Rsl1122
b1a579cd88 Extracted DataContainer into an interface 2019-02-16 14:28:42 +02:00
Rsl1122
9520d20c3e Made DataContainer#putAll(Map<Key, Supplier>) private 2019-02-16 14:28:41 +02:00
Rsl1122
8a34a04f04 DataContainer#getMap now returns Map<Key, Object> instead 2019-02-16 14:28:41 +02:00
Rsl1122
38b33e1051 Made DataContainer#getSupplier(Key) private 2019-02-16 14:28:40 +02:00
Rsl1122
3bbca4e8e8 Some PerServerContainer queries
- Deprecated PerServerKeys.PLAYER_KILLS
- Deprecated PerServerKeys.PLAYER_DEATHS
- Added PerServerKeys.PLAYER_DEATH_COUNT
- Added PerServerKeys.MOB_DEATH_COUNT
2019-02-16 14:28:39 +02:00
Rsl1122
2d07f27449 Made NicknamesTable static information class
- Made constructor private
- Removed getter in SQLDB
2019-02-16 14:28:39 +02:00
Rsl1122
64a3bc3fe0 Refactored NicknamesTable#getNicknameInformation to a query 2019-02-16 14:28:38 +02:00
Rsl1122
71a5592fd1 Refactored NicknamesTable#saveUserName to a transaction:
- Removed NameProcessor
2019-02-16 14:28:37 +02:00
Rsl1122
cce5688f80 Removed usage of ServerTable#getServerNames from AnalysisContainer 2019-02-16 14:28:36 +02:00
Rsl1122
15c414e2ab Removed ServerTable#getServerInfo 2019-02-16 14:28:36 +02:00
Rsl1122
eadc45d7ed Removed ServerTable#getServerUUID 2019-02-16 14:28:35 +02:00
Rsl1122
5776215c1e Removed ServerTable#getServerUUIDs() 2019-02-16 14:28:34 +02:00
Rsl1122
427971267e Removed ServerTable#getServerName(UUID serverUUID) - not used 2019-02-16 14:28:34 +02:00
Rsl1122
9145f6aa28 Removed SessionsTable#getSessionInfoOfServer() - not used 2019-02-16 14:28:33 +02:00
Rsl1122
687d300e87 Removed SessionsTable#getPlaytimeOfServer(UUID serverUUID) - not used 2019-02-16 14:28:32 +02:00
Rsl1122
4e6f6546d9 Removed SessionsTable#getSessionCount(UUID uuid, long afterDate) - not used 2019-02-16 14:28:31 +02:00