spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DB Tsai <dbt...@stanford.edu>
Subject Re: Passing runtime config to workers?
Date Fri, 16 May 2014 21:39:36 GMT
Since the evn variables in driver will not be passed into workers, the most
easy way you can do is refer to the variables directly in workers from
driver.

For example,

val variableYouWantToUse = System.getenv("something defined in env")

rdd.map(
you can access `variableYouWantToUse` here
)



Sincerely,

DB Tsai
-------------------------------------------------------
My Blog: https://www.dbtsai.com
LinkedIn: https://www.linkedin.com/in/dbtsai


On Fri, May 16, 2014 at 1:59 PM, Robert James <srobertjames@gmail.com>wrote:

> What is a good way to pass config variables to workers?
>
> I've tried setting them in environment variables via spark-env.sh, but, as
> far as I can tell, the environment variables set there don't appear in
> workers' environments.  If I want to be able to configure all workers,
> what's a good way to do it?  For example, I want to tell all workers:
> USE_ALGO_A or USE_ALGO_B - but I don't want to recompile.
>

Mime
View raw message