diff options
author | Mosharaf Chowdhury <mosharaf@mosharaf-ubuntu.(none)> | 2010-10-26 21:26:45 -0700 |
---|---|---|
committer | Mosharaf Chowdhury <mosharaf@mosharaf-ubuntu.(none)> | 2010-10-26 21:26:45 -0700 |
commit | f7364111bb0d6f6e433d8f9e1b93e5d00c549801 (patch) | |
tree | 42e870c2eef2b89a221f45e004fedecd97da7334 | |
parent | 8587353b3e5dc7190fcb64dd162b6183da1208c2 (diff) | |
download | spark-f7364111bb0d6f6e433d8f9e1b93e5d00c549801.tar.gz spark-f7364111bb0d6f6e433d8f9e1b93e5d00c549801.tar.bz2 spark-f7364111bb0d6f6e433d8f9e1b93e5d00c549801.zip |
TalkToGuide breaks once the peer has all the blocks.
-rw-r--r-- | src/scala/spark/Broadcast.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/scala/spark/Broadcast.scala b/src/scala/spark/Broadcast.scala index 45a3685c7c..0821b0cc54 100644 --- a/src/scala/spark/Broadcast.scala +++ b/src/scala/spark/Broadcast.scala @@ -272,8 +272,7 @@ extends BroadcastRecipe with Logging { var oosGuide: ObjectOutputStream = null var oisGuide: ObjectInputStream = null - // TODO: Do we need a breaking mechanism out of this infinite loop? - while (true) { + while (hasBlocks < totalBlocks) { clientSocketToGuide = new Socket(gInfo.hostAddress, gInfo.listenPort) oosGuide = new ObjectOutputStream (clientSocketToGuide.getOutputStream) oosGuide.flush @@ -289,8 +288,7 @@ extends BroadcastRecipe with Logging { logInfo("Received suitableSources from Master " + suitableSources) - // Update local list of sources by adding or replacing - // TODO: There might be some contradiciton on the use of listOfSources + // Update local list of known sources by adding or replacing listOfSources.synchronized { suitableSources.foreach { srcInfo => // Removing old copy of srcInfo to be replaced with a new one |