Skip to content

Commit

Permalink
Update ReceiverTracker.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
nishkamravi2 committed Jun 12, 2015
1 parent 68e8540 commit bc23907
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,15 @@ class ReceiverTracker(ssc: StreamingContext, skipReceiverLaunch: Boolean = false
val locations = new Array[ArrayBuffer[String]](receivers.length)
if (!executors.isEmpty) {
var i = 0
for (i <- 0 to (receivers.length - 1)) {
for (i <- 0 until receivers.length) {
locations(i) = new ArrayBuffer[String]()
if (receivers(i).preferredLocation.isDefined) {
locations(i) += receivers(i).preferredLocation.get
}
}

var count = 0;
for (i <- 0 to (max(receivers.length, executors.length) - 1)) {
for (i <- 0 until max(receivers.length, executors.length)) {
if (!receivers(i % receivers.length).preferredLocation.isDefined) {
locations(i % receivers.length) += executors(count)
count += 1;
Expand Down

0 comments on commit bc23907

Please sign in to comment.