Skip to content

Commit

Permalink
Solved a bug with force-acceptance and added more log.
Browse files Browse the repository at this point in the history
  • Loading branch information
spark committed Mar 2, 2017
1 parent 027c1ad commit 3db3c58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void compute(Vertex<PathfinderVertexID, PathfinderVertexType, PathfinderE
super.compute(vertex, messages);
PathfinderVertexID vertexId = vertex.getId();
PathfinderVertexType vertexValue = vertex.getValue();
// if(vertexValue.hasLOEsDepleted() && !vertexValue.isRoot()){
// if(vertexValue.hasLOEsDepleted()/* && !vertexValue.isRoot()*/)/*{*/
// sendMessage(vertexValue.getFragmentIdentity(), new ControlledGHSMessage(vertex.getId(), ControlledGHSMessage.LOEs_DEPLETED));
// return;
// }
Expand All @@ -206,6 +206,8 @@ public void compute(Vertex<PathfinderVertexID, PathfinderVertexType, PathfinderE
removeEdgesRequest(vertexId, senderID);
break;
case ControlledGHSMessage.ACCEPT_MESSAGE:
if(vertex.getEdgeValue(senderID).isBranch())
continue;
if(!senderFragmentMap.containsKey(remoteFragment))
senderFragmentMap.put(remoteFragment, new SetWritable<PathfinderVertexID>());
((SetWritable<PathfinderVertexID>)(senderFragmentMap.get(remoteFragment))).add(senderID.copy());
Expand All @@ -214,8 +216,9 @@ public void compute(Vertex<PathfinderVertexID, PathfinderVertexType, PathfinderE
break;
case ControlledGHSMessage.ROOT_UPDATE:
vertexValue.setFragmentIdentity(remoteFragment);
log.info("Updated root after force-accept");
break;
log.info("Updated root after force-accept");
return;
//break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void compute(Vertex<PathfinderVertexID, PathfinderVertexType, PathfinderE
Iterator<PathfinderVertexIDWithShortValue> msgs = messages.iterator();
while(msgs.hasNext()){
PathfinderVertexIDWithShortValue message = msgs.next();
log.info("Received leaf message " + message.getPfID() + " value " + message.getDepth());
switch(message.getDepth()){
case 0:
if(depth == -1){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void compute(Vertex<PathfinderVertexID, PathfinderVertexType, PathfinderE
if(vertexValue.getDepth() == -1){
vertexValue.setMISValue(Math.random());
log.info("MIS Ping");
Iterable<PathfinderVertexID> targets = Toolbox.getSpecificEdgesForVertex(vertex, PathfinderEdgeType.BRANCH/*, PathfinderEdgeType.INTERFRAGMENT_EDGE*/);
Iterable<PathfinderVertexID> targets = Toolbox.getSpecificEdgesForVertex(vertex, PathfinderEdgeType.BRANCH, PathfinderEdgeType.INTERFRAGMENT_EDGE);
if(targets != null)
sendMessageToMultipleEdges(targets.iterator(), new DoubleValueAndShortDepth(vertexValue.getMISValue(), vertexValue.getDepth()));
}
Expand Down Expand Up @@ -123,7 +123,7 @@ public void compute(Vertex<PathfinderVertexID, PathfinderVertexType, PathfinderE

if(!foundSmaller){
log.info("MIS reply");
Iterable<PathfinderVertexID> targets = Toolbox.getSpecificEdgesForVertex(vertex, PathfinderEdgeType.BRANCH/*, PathfinderEdgeType.INTERFRAGMENT_EDGE*/);
Iterable<PathfinderVertexID> targets = Toolbox.getSpecificEdgesForVertex(vertex, PathfinderEdgeType.BRANCH, PathfinderEdgeType.INTERFRAGMENT_EDGE);
if(targets != null)
sendMessageToMultipleEdges(targets.iterator(), new BooleanWritable(true));
}
Expand Down

0 comments on commit 3db3c58

Please sign in to comment.