A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expose Host Load for Java API through JNI
[simgrid.git]
/
examples
/
java
/
dht
/
kademlia
/
Node.java
diff --git
a/examples/java/dht/kademlia/Node.java
b/examples/java/dht/kademlia/Node.java
index
4e46ba0
..
6712da4
100644
(file)
--- a/
examples/java/dht/kademlia/Node.java
+++ b/
examples/java/dht/kademlia/Node.java
@@
-1,4
+1,4
@@
-/* Copyright (c) 2012-201
4, 2016
. The SimGrid Team.
+/* Copyright (c) 2012-201
8
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-57,16
+57,16
@@
public class Node extends Process {
}
public void mainLoop() {
}
public void mainLoop() {
- double next
_lookup_t
ime = Msg.getClock() + Common.RANDOM_LOOKUP_INTERVAL;
+ double next
LookupT
ime = Msg.getClock() + Common.RANDOM_LOOKUP_INTERVAL;
while (Msg.getClock() < this.deadline) {
try {
if (comm == null) {
comm = Task.irecv(Integer.toString(id));
}
if (!comm.test()) {
while (Msg.getClock() < this.deadline) {
try {
if (comm == null) {
comm = Task.irecv(Integer.toString(id));
}
if (!comm.test()) {
- if (Msg.getClock() >= next
_lookup_t
ime) {
+ if (Msg.getClock() >= next
LookupT
ime) {
randomLookup();
randomLookup();
- next
_lookup_t
ime += Common.RANDOM_LOOKUP_INTERVAL;
+ next
LookupT
ime += Common.RANDOM_LOOKUP_INTERVAL;
} else {
waitFor(1);
}
} else {
waitFor(1);
}
@@
-77,6
+77,7
@@
public class Node extends Process {
}
}
catch (Exception e) {
}
}
catch (Exception e) {
+ Msg.debug("Caught exception: " + e);
}
}
Msg.info(findNodeSuccedded + "/" + (findNodeSuccedded + findNodeFailed) + " FIND_NODE have succedded.");
}
}
Msg.info(findNodeSuccedded + "/" + (findNodeSuccedded + findNodeFailed) + " FIND_NODE have succedded.");
@@
-256,6
+257,7
@@
public class Node extends Process {
waitFor(1);
}
catch (Exception ex) {
waitFor(1);
}
catch (Exception ex) {
+ Msg.debug("Caught exception: " + ex);
}
} while (Msg.getClock() < timeout && !destinationFound);
}
}
} while (Msg.getClock() < timeout && !destinationFound);
}
@@
-275,7
+277,7
@@
public class Node extends Process {
public int sendFindNodeToBest(Answer nodeList) {
int destination = nodeList.getDestinationId();
int i;
public int sendFindNodeToBest(Answer nodeList) {
int destination = nodeList.getDestinationId();
int i;
- for (i = 0; i < Common.
alpha
&& i < nodeList.size(); i++) {
+ for (i = 0; i < Common.
ALPHA
&& i < nodeList.size(); i++) {
Contact node = nodeList.getNodes().get(i);
if (node.getId() != this.id) {
this.sendFindNode(node.getId(),destination);
Contact node = nodeList.getNodes().get(i);
if (node.getId() != this.id) {
this.sendFindNode(node.getId(),destination);