https://codereview.appspot.com/275450043/diff/1/src/main/java/se/kth/crypt/server/core/MasterElectionCalculator.java File src/main/java/se/kth/crypt/server/core/MasterElectionCalculator.java (right): https://codereview.appspot.com/275450043/diff/1/src/main/java/se/kth/crypt/server/core/MasterElectionCalculator.java#newcode41 src/main/java/se/kth/crypt/server/core/MasterElectionCalculator.java:41: long writes = serverNode.getAndResetWrites(); If I understood your algorithm ...
8 years, 5 months ago
(2015-11-23 08:36:48 UTC)
#2
https://codereview.appspot.com/275450043/diff/1/src/main/java/se/kth/crypt/se...
File src/main/java/se/kth/crypt/server/core/MasterElectionCalculator.java
(right):
https://codereview.appspot.com/275450043/diff/1/src/main/java/se/kth/crypt/se...
src/main/java/se/kth/crypt/server/core/MasterElectionCalculator.java:41: long
writes = serverNode.getAndResetWrites();
If I understood your algorithm correctly, then I would like to point out
aforementioned limitations.
Resetting, number of accumulated writes, is equivalent to forgetting all
previous history of events. The performance of the algorithm (system) will
depend on the frequency of getAndResets, ultimately it will depends if your
sampling frequency matches frequency of latency changes. This can be (most
likely) different for nodes in different geographic regions.
Also:
- consider if you want to add another service that needs to know number of
writes?
- this algorithm is not atomic. If it fail half way, consecutive retry will give
inaccurate results due to some nodes counters being cleared.
Think about computing a rolling value, e.g. writes/second/minute etc.
Issue 275450043: Added MasterElectionCalculator. We can now calculate the points at any time
Created 8 years, 5 months ago by bruce.yinhe.kth
Modified 8 years ago
Reviewers: robert.erneborg, marcus.falgert
Base URL:
Comments: 1