public synchronized boolean seekToNewSource ( long targetPos , boolean throwWhenNotFound ) throws IOException { boolean markedDead = deadNodes . containsKey ( currentNode ) ; addToDeadNodes ( currentNode ) ; DatanodeInfo oldNode = currentNode ; DatanodeInfo newNode = blockSeekTo ( targetPos , throwWhenNotFound ) ; if ( ! markedDead ) { /* remove it from deadNodes. blockSeekTo could have cleared * deadNodes and added currentNode again. Thats ok. */ deadNodes . remove ( oldNode ) ; } if ( ! oldNode . getStorageID ( ) . equals ( newNode . getStorageID ( ) ) ) { currentNode = newNode ; return true ; } else { return false ; } }
Seek to given position on a node other than the current node . If a node other than the current node is found then returns true . If another node could not be found then returns false .