Skip to content
Snippets Groups Projects
Commit c9cad03c authored by Mosharaf Chowdhury's avatar Mosharaf Chowdhury
Browse files

- Using the new Cache implementation.

- Removed unused code related to dualMode (deprecated).
parent 73714da5
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ extends Logging { ...@@ -67,7 +67,7 @@ extends Logging {
@serializable @serializable
case class SourceInfo (val hostAddress: String, val listenPort: Int, case class SourceInfo (val hostAddress: String, val listenPort: Int,
val totalBlocks: Int, val totalBytes: Int, val replicaID: Int) val totalBlocks: Int, val totalBytes: Int)
extends Comparable [SourceInfo] with Logging { extends Comparable [SourceInfo] with Logging {
var currentLeechers = 0 var currentLeechers = 0
......
package spark package spark
import com.google.common.collect.MapMaker
import java.io._ import java.io._
import java.net._ import java.net._
import java.util.{Comparator, PriorityQueue, Random, UUID} import java.util.{Comparator, PriorityQueue, Random, UUID}
...@@ -84,7 +82,7 @@ extends Broadcast with Logging { ...@@ -84,7 +82,7 @@ extends Broadcast with Logging {
pqOfSources = new PriorityQueue[SourceInfo] pqOfSources = new PriorityQueue[SourceInfo]
val masterSource_0 = val masterSource_0 =
SourceInfo (hostAddress, listenPort, totalBlocks, totalBytes, 0) SourceInfo (hostAddress, listenPort, totalBlocks, totalBytes)
pqOfSources.add (masterSource_0) pqOfSources.add (masterSource_0)
// Register with the Tracker // Register with the Tracker
...@@ -288,7 +286,7 @@ extends Broadcast with Logging { ...@@ -288,7 +286,7 @@ extends Broadcast with Logging {
logInfo ("Connected to Master's guiding object") logInfo ("Connected to Master's guiding object")
// Send local source information // Send local source information
oosMaster.writeObject(SourceInfo (hostAddress, listenPort, -1, -1, 0)) oosMaster.writeObject(SourceInfo (hostAddress, listenPort, -1, -1))
oosMaster.flush oosMaster.flush
// Receive source information from Master // Receive source information from Master
...@@ -520,7 +518,7 @@ extends Broadcast with Logging { ...@@ -520,7 +518,7 @@ extends Broadcast with Logging {
// Add this new (if it can finish) source to the PQ of sources // Add this new (if it can finish) source to the PQ of sources
thisWorkerInfo = SourceInfo (sourceInfo.hostAddress, thisWorkerInfo = SourceInfo (sourceInfo.hostAddress,
sourceInfo.listenPort, totalBlocks, totalBytes, 0) sourceInfo.listenPort, totalBlocks, totalBytes)
logInfo ("Adding possible new source to pqOfSources: " + thisWorkerInfo) logInfo ("Adding possible new source to pqOfSources: " + thisWorkerInfo)
pqOfSources.add (thisWorkerInfo) pqOfSources.add (thisWorkerInfo)
} }
...@@ -713,7 +711,7 @@ extends Broadcast with Logging { ...@@ -713,7 +711,7 @@ extends Broadcast with Logging {
private object ChainedBroadcast private object ChainedBroadcast
extends Logging { extends Logging {
val values = new MapMaker ().softValues ().makeMap[UUID, Any] val values = Cache.newKeySpace()
var valueToGuidePortMap = Map[UUID, Int] () var valueToGuidePortMap = Map[UUID, Int] ()
......
package spark package spark
import com.google.common.collect.MapMaker
import java.io._ import java.io._
import java.net._ import java.net._
import java.util.UUID import java.util.UUID
...@@ -56,7 +54,7 @@ extends Broadcast with Logging { ...@@ -56,7 +54,7 @@ extends Broadcast with Logging {
private object DfsBroadcast private object DfsBroadcast
extends Logging { extends Logging {
val values = new MapMaker ().softValues ().makeMap[UUID, Any] val values = Cache.newKeySpace()
private var initialized = false private var initialized = false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment