Compare commits
2 commits
f7ed0ee8d8
...
eab5a73ead
Author | SHA1 | Date | |
---|---|---|---|
|
eab5a73ead | ||
|
6313a06a83 |
|
@ -243,7 +243,7 @@ cacheVerifyThread nsSTM = forever $ do
|
||||||
forkIO $ sendQueryIdMessages targetID latestNs (Just (1 + jEntriesPerSlice latestNs)) (nodesToQuery targetID) >> pure () -- ask for 1 entry more than j because of querying the middle
|
forkIO $ sendQueryIdMessages targetID latestNs (Just (1 + jEntriesPerSlice latestNs)) (nodesToQuery targetID) >> pure () -- ask for 1 entry more than j because of querying the middle
|
||||||
)
|
)
|
||||||
|
|
||||||
threadDelay $ toEnum (fromEnum maxEntryAge `div` 20)
|
threadDelay $ 10^6 * round maxEntryAge `div` 20
|
||||||
|
|
||||||
|
|
||||||
-- | Checks the invariant of at least @jEntries@ per cache slice.
|
-- | Checks the invariant of at least @jEntries@ per cache slice.
|
||||||
|
@ -355,7 +355,7 @@ stabiliseThread nsSTM = forever $ do
|
||||||
)
|
)
|
||||||
|
|
||||||
-- TODO: make delay configurable
|
-- TODO: make delay configurable
|
||||||
threadDelay (60 * 1000)
|
threadDelay (60 * 10^6)
|
||||||
where
|
where
|
||||||
-- | send a stabilise request to the n-th neighbour
|
-- | send a stabilise request to the n-th neighbour
|
||||||
-- (specified by the provided getter function) and on failure retr
|
-- (specified by the provided getter function) and on failure retr
|
||||||
|
@ -450,7 +450,7 @@ requestMapPurge mapVar = forever $ do
|
||||||
putMVar mapVar $ Map.filter (\entry@(RequestMapEntry _ _ ts) ->
|
putMVar mapVar $ Map.filter (\entry@(RequestMapEntry _ _ ts) ->
|
||||||
now - ts < responsePurgeAge
|
now - ts < responsePurgeAge
|
||||||
) rMapState
|
) rMapState
|
||||||
threadDelay $ fromEnum responsePurgeAge * 2000
|
threadDelay $ round responsePurgeAge * 2 * 10^6
|
||||||
|
|
||||||
|
|
||||||
-- | Wait for messages, deserialise them, manage parts and acknowledgement status,
|
-- | Wait for messages, deserialise them, manage parts and acknowledgement status,
|
||||||
|
|
|
@ -243,19 +243,19 @@ instance Typeable a => Show (TQueue a) where
|
||||||
|
|
||||||
-- | convenience function that replaces the predecessors of a 'LocalNodeState' with the k closest nodes from the provided list
|
-- | convenience function that replaces the predecessors of a 'LocalNodeState' with the k closest nodes from the provided list
|
||||||
setPredecessors :: [RemoteNodeState] -> LocalNodeState -> LocalNodeState
|
setPredecessors :: [RemoteNodeState] -> LocalNodeState -> LocalNodeState
|
||||||
setPredecessors preds ns = ns {predecessors = takeRMapPredecessors (getNid ns) (kNeighbours ns) . rMapFromList $ preds}
|
setPredecessors preds ns = ns {predecessors = takeRMapPredecessors (getNid ns) (kNeighbours ns) . rMapFromList . filter ((/=) (getNid ns) . getNid) $ preds}
|
||||||
|
|
||||||
-- | convenience function that replaces the successors of a 'LocalNodeState' with the k closest nodes from the provided list
|
-- | convenience function that replaces the successors of a 'LocalNodeState' with the k closest nodes from the provided list
|
||||||
setSuccessors :: [RemoteNodeState] -> LocalNodeState -> LocalNodeState
|
setSuccessors :: [RemoteNodeState] -> LocalNodeState -> LocalNodeState
|
||||||
setSuccessors succs ns = ns {successors = takeRMapSuccessors (getNid ns) (kNeighbours ns) . rMapFromList $ succs}
|
setSuccessors succs ns = ns {successors = takeRMapSuccessors (getNid ns) (kNeighbours ns) . rMapFromList . filter ((/=) (getNid ns) . getNid) $ succs}
|
||||||
|
|
||||||
-- | sets the predecessors of a 'LocalNodeState' to the closest k nodes of the current predecessors and the provided list, combined
|
-- | sets the predecessors of a 'LocalNodeState' to the closest k nodes of the current predecessors and the provided list, combined
|
||||||
addPredecessors :: [RemoteNodeState] -> LocalNodeState -> LocalNodeState
|
addPredecessors :: [RemoteNodeState] -> LocalNodeState -> LocalNodeState
|
||||||
addPredecessors preds ns = ns {predecessors = takeRMapPredecessors (getNid ns) (kNeighbours ns) . addRMapEntries preds . rMapFromList $ predecessors ns}
|
addPredecessors preds ns = ns {predecessors = takeRMapPredecessors (getNid ns) (kNeighbours ns) . addRMapEntries preds . rMapFromList . filter ((/=) (getNid ns) . getNid) $ predecessors ns}
|
||||||
|
|
||||||
-- | sets the successors of a 'LocalNodeState' to the closest k nodes of the current successors and the provided list, combined
|
-- | sets the successors of a 'LocalNodeState' to the closest k nodes of the current successors and the provided list, combined
|
||||||
addSuccessors :: [RemoteNodeState] -> LocalNodeState -> LocalNodeState
|
addSuccessors :: [RemoteNodeState] -> LocalNodeState -> LocalNodeState
|
||||||
addSuccessors succs ns = ns {successors = takeRMapSuccessors (getNid ns) (kNeighbours ns) . addRMapEntries succs . rMapFromList $ successors ns}
|
addSuccessors succs ns = ns {successors = takeRMapSuccessors (getNid ns) (kNeighbours ns) . addRMapEntries succs . rMapFromList . filter ((/=) (getNid ns) . getNid) $ successors ns}
|
||||||
|
|
||||||
-- | Class for all types that can be identified via an EpiChord key.
|
-- | Class for all types that can be identified via an EpiChord key.
|
||||||
-- Used for restricting the types a 'RingMap' can store
|
-- Used for restricting the types a 'RingMap' can store
|
||||||
|
|
Loading…
Reference in a new issue