Skip to content
Snippets Groups Projects
Commit 39e23256 authored by Patrick Wendell's avatar Patrick Wendell
Browse files

Removing dead code

parent 8ca1cc17
No related branches found
No related tags found
No related merge requests found
......@@ -589,19 +589,6 @@ private object Utils extends Logging {
"%s at %s:%s".format(callSiteInfo.lastSparkMethod, callSiteInfo.firstUserFile,
callSiteInfo.firstUserLine)
}
/**
* Try to find a free port to bind to on the local host. This should ideally never be needed,
* except that, unfortunately, some of the networking libraries we currently rely on (e.g. Spray)
* don't let users bind to port 0 and then figure out which free port they actually bound to.
* We work around this by binding a ServerSocket and immediately unbinding it. This is *not*
* necessarily guaranteed to work, but it's the best we can do.
*/
def findFreePort(): Int = {
val socket = new ServerSocket(0)
val portBound = socket.getLocalPort
socket.close()
portBound
}
/** Return a string containing the last `n` bytes of a file. */
def lastNBytes(path: String, n: Int): String = {
......
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