Commit Graph

22 Commits (9b915b3d36382b19b2717a1858a4178e70cabeaf)

Author SHA1 Message Date
Nelson R. Perez dc348b2578 Changed the 'updateNode' to make it also add a new node if it was not present 2019-09-25 17:31:54 -05:00
Nelson R. Perez 562955586b Preventing a potential problem at the NetworkServiceManager and introducing some getters
- Preventing accidentally calling the 'bindService' twice at the NetworkServiceManager
- Providing a getter for the node list at the NodeLatencyVerifier
- Created a getter for the NodeLatencyVerifier at the NetworkService
2019-06-13 07:49:36 -05:00
Nelson R. Perez 4181141b4e Actually updating the node latency 2019-02-13 23:30:25 -05:00
Nelson R. Perez af5896a160 Replaced the PriorityQueue by the PriorityBlockingQueue in the LatencyNodeProvider class due to the fact that multiple threads can access the same provider 2018-11-08 17:59:01 -05:00
Severiano Jaramillo b6aab142b6 - Added a method to remove nodes from LatencyNodeProvider and implemented a HashSet to keep track of such removed nodes. The reason is that calls to this class are asynchronous and only removing a node from the mFullNodeHeap was not enough to guarantee that it was not going to be added again.
- Added a isRemoved variable to FullNode class, so that the object can carry itself the removal status information and be able to use the same publish subject to broadcast the status of the FullNode.
- Added a method to remove nodes from NodeLatencyVerifier, removed such nodes from pending node latency measurements map 'nodeURLMap' and publish/broadcast the FullNode information with isRemoved=true so that components listening can act accordingly.
- Make proper changes to sample app's RemoteNodeActivity so that it removes 'removed' nodes from the list.
2018-11-08 15:14:01 -06:00
Nelson R. Perez 0fa75dcf22 Removed unneeded system log 2018-10-23 15:32:47 -05:00
Nelson R. Perez 878bc52d78 Fixed problem with the comparation function between two FullNode instances 2018-10-23 15:30:37 -05:00
Nelson R. Perez a6e5910144 Fixing issues with the LatencyNodeProvider#getSortedNodes() method 2018-10-22 13:53:47 -05:00
Nelson R. Perez a5f0ba1345 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-10-18 18:00:19 -05:00
Nelson R. Perez d37d35e0c6 Returning latency as Long.MAX_VALUE instead of zero to non-initialized FullNode instances 2018-10-18 17:57:27 -05:00
Nelson R. Perez 63eebf11c4 Exposing an interface that allows the fine tuning of the alpha parameter used to calculate the exponential moving average of measured latencies 2018-10-18 17:36:34 -05:00
Nelson R. Perez 36420e7f56 Trying to fix a NullPointerException by checking the refeence and enclosing the whole chunk of code into a syncronized block 2018-10-15 18:35:26 -05:00
Nelson R. Perez b37bb9dce0 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-09-27 17:43:45 -05:00
Nelson R. Perez e357ffba66 Removed debug logs 2018-09-27 17:42:51 -05:00
Severiano Jaramillo 9374b125a1 Use a more descriptive value (simulating infinite) when the node could not be reached, in NodeLatencyVerifier 2018-09-27 13:10:28 -05:00
Severiano Jaramillo bb14110b09 Fix small issue in the NodeLatencyVerifier that caused incorrect (very small) readings to no-reachable nodes due to no internet connection. 2018-09-27 11:33:18 -05:00
Nelson R. Perez d109d86bf3 - Storing connectivity status at the FullNode class
- Flipping this flag accordingly at the NetworkService whenever we connect/disconnect from a specific node
- Notifying the NodeLatencyVerifier of this change
2018-09-26 17:17:31 -05:00
Nelson R. Perez ede7265989 NodeLatencyVerifier
- Using an HttpUrl instance as a key to the map of FullNode instances, we were using simple String here before, but turned out not to be too reliable

NetworkService
- Introducing the NodeLatencyVerifier instance into the NetworkService, and making its use optional
- In case the user opts to use the node-latency verification, the initial connection is delayed until we obtain a measurement of all nodes
- Exposing a PublishSubject, this allows users of the library to get notified of the node latency measurements

NetworkServiceManager
- A boolean flag is now used to decide whether or not to start a NetworkService instance with the node-latency verification feature ON
2018-09-20 21:51:14 -05:00
Nelson R. Perez 776630dd57 - Introduced some instrumented test dependencies
- Fixed a problem in the LatencyNodeProvider#updateNode(FullNode) method
- Fixed a bug in the LatencyNodeProvider#getSortedNodes() method
- Introducing the NodeLatencyVerifier class
2018-09-20 16:21:25 -05:00
Nelson R. Perez ccf61858e4 Modified the NetworkService and the NetworkServiceManager classes in order to pass arguments to the service via Intent extras and to allow delayed network connection 2018-09-19 16:44:26 -05:00
Nelson R. Perez 25222e5ea9 Introducing the NodeProvider interface and its implementation LatencyNodeProvider 2018-09-18 11:15:07 -05:00
Nelson R. Perez 83ce2de14d Introducing the FullNode class, which keeps track of the delay to each full node it represents 2018-09-17 17:48:49 -05:00