Kelvin Mwinuka
4bc1f44e1d
Added Apache 2.0 license header to all go files in src folder
2024-03-24 18:30:17 +08:00
Kelvin Mwinuka
f27a0dda79
Implemented eviction algorithm that samples a configurable number of keys with TTLs (default 20) at a configurable interval (default 100ms) and deletes the keys that are expired.
2024-03-12 02:12:55 +08:00
Kelvin Mwinuka
c414da16b4
KeyExists keyspace function now removes the key if the key expiry is in the past.
...
KeyData type moved to utils package to allow sharing between multiple packages.
Updated all commands and command tests to pass context object to KeyExists, KeyLock, keyUnlock, KeyRLock, and KeyRUnlock.
Create context object for each test in all test suites instead of just passing context.Background() to all functions that accept a context.
2024-03-10 23:19:05 +08:00
Kelvin Mwinuka
82be1f6068
Added addedTime to EntryLFU object to control which entry will be removed if access count is the same. If two entries have the same access count, the older entry should be removed first.
...
SetKeyExpiry and GetValue keyspace receiver functions now require context object to be passed.
Created adjustMemoryUsage function for key eviction for LFU, LRU, and Random eviction policies.
Updated all modules to pass context to SetKeyExpirty and GetValue functions.
2024-03-08 00:26:49 +08:00
Kelvin Clement Mwinuka
5c347cb7de
Changed max-memory to uint64. Added TODO commends on how to handle memory checking for key eviction.
2024-03-05 22:45:05 +08:00
Kelvin Clement Mwinuka
28f97656c4
Removed etc and get modules and replaced them with generic module. Implemented functions to set and remove the expiry of a key. Implemented LRU and LFU caches using heap.
2024-03-03 16:21:12 +08:00
Kelvin Clement Mwinuka
e569bf6837
Added config flags max-memory and eviction-policy to manage memory usage. Created ParseMemory utility function to parse max-memory value into bytes. Created LFU cache to be used with heap data structure for managing LFU cache.
2024-03-01 16:25:04 +08:00
Kelvin Clement Mwinuka
fbb0b8dc8d
Removed plugin-dir cli flag as its not used
2024-02-26 00:37:00 +08:00
Kelvin Clement Mwinuka
5e1e362b28
Updated flags from camelCase to kebab-case
2024-02-25 23:27:57 +08:00
Kelvin Clement Mwinuka
ab366c4f73
Craeted AppendStore and PreambleStore engines
2024-02-25 11:39:51 +08:00
Kelvin Clement Mwinuka
8c35d3b001
Changed config json and yaml tags to PascalCase from camelCase
2024-02-03 06:46:49 +08:00
Kelvin Clement Mwinuka
69c9170f56
Implemented mTLS listener to verify client certificates.
2024-02-03 06:40:03 +08:00
Kelvin Clement Mwinuka
135b3eacb1
Removed 'Key' config
2024-02-03 00:30:59 +08:00
Kelvin Clement Mwinuka
f9ae87862c
Implemented multiple server cert/key pairs. Implemented mTLS for verifying client using multiple pem files.
2024-02-03 00:24:59 +08:00
Kelvin Clement Mwinuka
c0b3fe36a1
Updated config file to log config file close error
2024-02-02 00:10:27 +08:00
Kelvin Clement Mwinuka
15d289c33d
Added config flags to choose between aof restore and snapshot restore in standalone mode.
2024-02-01 04:42:44 +08:00
Kelvin Clement Mwinuka
97f0f142a6
Added configuration options for snapshot threshold and snapshot interval
2024-01-25 18:59:04 +08:00
Kelvin Clement Mwinuka
9017f12fa9
Removed http options flag as it will not be used for now.
...
Moved server cluster receiver functions into cluster.go.
Moved keyspace receiver functions into keyspace.go.
Moved module and command loading into modules.go.
Updated Dockerfile and docker-compose to remove http flag to server.
2024-01-22 17:38:44 +08:00
Kelvin Clement Mwinuka
1ac941151f
Refactored broadcast for joining raft cluster. Instead of broadcasting repeatedly with a ticker, the message will be relayed using gossip protocol until it reaches the raft leader.
...
Created scaffolding for forwarding mutation commands from replica nodes to leader node.
2024-01-19 16:40:55 +08:00
Kelvin Clement Mwinuka
5f39a64a8d
Refactored command modules to always accept connection parameter in order to streamline command processing.
...
Updated server command list and enabled subcommands and granular cluster sync for individual subcommands.
Renamed "set" packate to "etc" as "set" will be used for the set data type in the future.
2023-12-13 19:34:52 +08:00
Kelvin Clement Mwinuka
9e0291d98b
Return error from GetConfig function
2023-12-08 14:01:19 +08:00
Kelvin Clement Mwinuka
c1a4957be2
Added requirePass and password server configuration options to set password for default user
2023-12-08 10:15:29 +08:00
Kelvin Clement Mwinuka
1382ef494b
Implemented ACL Init on server.
...
Implemented reading of ACL from JSON and YAML files into user list in memory.
2023-12-07 16:53:23 +08:00
Kelvin Clement Mwinuka
0e37052547
Added bootstrapCluster arg for server. This argument is what will determine if the server bootstraps a raft cluster.
...
CreateKeyAndLock function will now wither create a lock or obtain an existing lock.
2023-11-21 19:12:07 +08:00
Kelvin Clement Mwinuka
974fc24617
Removed client subdirectory from monorepo into its own repository.
...
Renamed "server" subdirectory to "src" as this entire derectory now only has server code.
Removed "bin" directory to project root.
Moved Dockerfile to project root.
2023-11-10 22:42:23 +08:00