File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
core/src/main/scala/org/apache/spark/util
external/flume/src/test/scala/org/apache/spark/streaming/flume Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1879,10 +1879,9 @@ private[spark] object Utils extends Logging {
18791879 conf : SparkConf ,
18801880 serviceName : String = " " ): (T , Int ) = {
18811881
1882- if (startPort != 0 && (startPort < 1024 || startPort >= 65536 )) {
1883- throw new IllegalArgumentException ( " startPort should be between " +
1882+ require (startPort == 0 || 1024 <= startPort && startPort < 65536 ,
1883+ " startPort should be between " +
18841884 " 1024(including) and 65536(excluding) or 0(for a random free port)." )
1885- }
18861885
18871886 val serviceString = if (serviceName.isEmpty) " " else s " ' $serviceName' "
18881887 val maxRetries = portMaxRetries(conf)
Original file line number Diff line number Diff line change @@ -20,14 +20,13 @@ package org.apache.spark.streaming.flume
2020import java .net .{InetSocketAddress , ServerSocket }
2121import java .nio .ByteBuffer
2222
23- import org .apache .commons .lang3 .RandomUtils
24-
2523import scala .collection .JavaConversions ._
2624import scala .collection .mutable .{ArrayBuffer , SynchronizedBuffer }
2725import scala .concurrent .duration ._
2826import scala .language .postfixOps
2927
3028import com .google .common .base .Charsets
29+ import org .apache .commons .lang3 .RandomUtils
3130import org .apache .avro .ipc .NettyTransceiver
3231import org .apache .avro .ipc .specific .SpecificRequestor
3332import org .apache .flume .source .avro
You can’t perform that action at this time.
0 commit comments