Commit graph

24 commits

Author SHA1 Message Date
Trolli Schmittlauch 5ed8a28fde refactor vservers map to RingMap to be able to index it
- in preparation for periodical rebalancing
- makes it possible to look up the next vserver for iterating through
  it, after refreshing the map in-between
- added some necessary RingMap functions
2020-10-05 02:27:02 +02:00
Trolli Schmittlauch 578cc362b9 fix tests 2020-09-25 22:33:40 +02:00
Trolli Schmittlauch 9bf7365a2c include target ID in request to address individual vserver
- necessary for dispatching the request to a certain vserver
- also refactored request sending to use a common `mkRequest`
- contributes to #2
2020-09-19 20:41:58 +02:00
Trolli Schmittlauch 5e745cd035 only specify upper key bound when querying load
As a querying node does not always know the lower bound of the queried
segment – determined by the predecessor – let the currently responsible
node provide that bound instead.

affects #71
2020-09-19 15:37:41 +02:00
Trolli Schmittlauch 41aaa8ff70 parse ASN.1 representation of load querying
includes tests
contributes to #71
2020-09-18 20:36:35 +02:00
Trolli Schmittlauch 969f6d7fc2 fix tests 2020-08-17 13:39:22 +02:00
Trolli Schmittlauch 8faa9dc016 fix test by providing a MockService 2020-08-01 18:58:49 +02:00
Trolli Schmittlauch 5ffe1b074e add reference from RealNode to Service
This required to make both RealNode(STM) and LocalNodeState(STM) parameterisable
polymorphic types
2020-07-30 02:19:52 +02:00
Trolli Schmittlauch d293cc05d1 data structure for RealNode holds common config and management data
contributes to #56, #34, #2
2020-07-07 17:36:12 +02:00
Trolli Schmittlauch e06c53ff7c stylish fixes 2020-07-02 01:38:51 +02:00
Trolli Schmittlauch f6481996d7 Change default response to QueryID for unjoined nodes
reason: allow unjoined nodes to find bootstrap node in local cache,
while always advertising itself to incoming requests for bootstrapping.
2020-07-02 00:54:14 +02:00
Trolli Schmittlauch 0494ddd696 stabilise periodically
contributes to #44
2020-06-20 21:24:31 +02:00
Trolli Schmittlauch 3f42f98443 adjust lookup to RingMap, fix #48
- change default lookup result when not joined to FOUND
- fix determining own responsibility #48
- adjust tests
2020-06-18 23:08:20 +02:00
Trolli Schmittlauch 22a6becf6b fix all previously working tests 2020-06-15 16:41:11 +02:00
Trolli Schmittlauch 7612f5532a create a test for parts of #48 2020-06-13 14:56:05 +02:00
Trolli Schmittlauch f15d83baff Refactor predecessors and successors to hold RemoteNodeStates
- neighbour nodes need to be contacted reliably
- Only holding NodeIDs requires a cache lookup for getting hostname and
  port. This is brittle as the entry could've been purged from cache.
- refactored ASN.1 scheme, types and add/ sort/ remove implementations

closes #46
2020-06-09 15:21:22 +02:00
Trolli Schmittlauch 2c827ea326 rename responseTo -> requestID to avoid partial record accessors 2020-06-08 20:31:18 +02:00
Trolli Schmittlauch cb769e088f add test for serialiseMessage part numbering 2020-06-06 13:45:35 +02:00
Trolli Schmittlauch 914e07a412 change NodeCache protection to STM
- putting the NodeCache behind an IORef had been chose because those
  could've been read non-blocking
- the same is true for TVars. The performance characteristics are likely
  worse, but at the advantage of composability within STM monads
2020-06-05 22:07:47 +02:00
Trolli Schmittlauch 2542091379 adjust rest of code to new message structure 2020-05-30 13:52:06 +02:00
Trolli Schmittlauch bbe7078369 adjust tests to work with new NodeState types
closes #20
2020-05-22 00:05:23 +02:00
Trolli Schmittlauch f6c252d314 sending a queryID request compiles (untested) 2020-05-20 18:55:24 +02:00
Hécate 41e999ed99 Linting integration
This commit brings in an HLint configuration file
and several recommended modifications such as:

* End-of-line extra spaces removal;
* Import lines ordering;
* Redundant $ removal;
* Generalisation of ++ and map to <> and fmap;
* Preferring `pure` over `return`;
* Removing extraenous extensions.

And finally, a `stylish-haskell` helper script
that detects if code files are dirty. Can be useful for CI,
although manually calling it can be nice if you would rather
first implement then beautify.
2020-05-19 12:42:06 +02:00
Trolli Schmittlauch 60c164dbb0 remove unnecessary directory level 2020-05-19 00:01:32 +02:00