rajasekarv / vega

A new arguably faster implementation of Apache Spark from scratch in Rust
Apache License 2.0
2.23k stars 205 forks source link

Improve addressing #7

Closed steven-joruk closed 4 years ago

steven-joruk commented 4 years ago

src/local_ip.rs was calling out to the hostname binary, which isn't a portable way of getting the local address - macOS doesn't have the binary at all and on my Linux distro hostname takes -i instead of -I. Spark uses the SPARK_LOCAL_IP environmental variable, so I used it too.

The master address and port were passed around lots of places, then later converted to a SocketAddr, it's simpler to just immediately create a SocketAddr and pass that around without needing to worry about parsing errors.

I added unit tests for the reading of the addresses, but one part that needs more attention are the couple of places where 0.0.0.0:{} was hard coded as the master address, which now use the configurable value.

rajasekarv commented 4 years ago

thanks @steven-joruk