viceroy
Class TraverseTreeAbsoluteAlgorithm
java.lang.Object
|
+--viceroy.PapersAlgorithm
|
+--viceroy.TraverseTreeAbsoluteAlgorithm
- All Implemented Interfaces:
- LookupAlgorithm
- public class TraverseTreeAbsoluteAlgorithm
- extends PapersAlgorithm
- implements LookupAlgorithm
Change the Traverse Tree phase of the lookup algorithm
the change is as follows:
we check which peer is closer (absolute) to the target between this peer/left/right child
If left/right child is closer to the target
goto this child and continue in this phase
else // i am closer to the target
goto travese ring phase
- Since:
- 1.72
- Author:
- Anat Talmy
, Oren Dobzinski
|
Field Summary |
private static org.apache.log4j.Logger |
logger
logger for debug |
| Methods inherited from class viceroy.PapersAlgorithm |
getLookupState, getMessagePath, goToLeftChild, goToParent, goToPredecessor, goToRightChild, goToSuccessor, howOvershoots, lookupProceedToRoot, lookupTraverseRing, nextOnLookup, overshoots |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private static final org.apache.log4j.Logger logger
- logger for debug
TraverseTreeAbsoluteAlgorithm
public TraverseTreeAbsoluteAlgorithm(AuthorizedViceroyPeer peer)
- a constructor
- Parameters:
peer -
lookupTraverseTree
protected ViceroyPeer lookupTraverseTree(AuthorizedViceroyPeer peer,
Resource valueToLook)
throws ResourceNotFoundException
- TravereTreeAbs lookup. we change only the lookupTraveseTree
phase: we check which peer is closer (absolute) to the
target between this peer/left/right child
If left/right child is closer to the target
goto this child and continue in this phase
else // i am closer to the target
goto travese ring phase
- Overrides:
lookupTraverseTree in class PapersAlgorithm
- Parameters:
peer - valueToLook -
- Returns:
-
- Throws:
ResourceNotFoundException
newLookupAlgorithm
public LookupAlgorithm newLookupAlgorithm(AuthorizedViceroyPeer peer)
- creates a fresh new lookup algorithm, with empty path
- Specified by:
newLookupAlgorithm in interface LookupAlgorithm- Overrides:
newLookupAlgorithm in class PapersAlgorithm
- Parameters:
peer - starting point of the new algorithm
- Returns:
- a fresh new lookup algorithm, with empty path