public interface YarnEnvironmentConfigurer
SpringYarnConfigurerAdapter
から使用される YarnEnvironmentBuilder
のインターフェース。 通常、構成は以下のように使用されます。
@Configuration @EnableYarn static class Config extends SpringYarnConfigurerAdapter { @Override public void configure(YarnEnvironmentBuilder environment) throws Exception { environment .withClasspath() .entry("cpEntry1") .entry("cpEntry2") .useDefaultYarnClasspath(true); } }
修飾子と型 | メソッドと説明 |
---|---|
YarnEnvironmentConfigurer | entry(java.lang.String key, java.lang.String value) 環境変数を指定します。 |
YarnEnvironmentConfigurer | entry(java.lang.String id, java.lang.String key, java.lang.String value) 識別子を使用して環境変数を指定します。 |
YarnEnvironmentConfigurer | includeLocalSystemEnv(boolean includeLocalSystemEnv) 既存のシステム環境変数を自動的に含めるかどうかを指定します。 |
YarnEnvironmentConfigurer | includeLocalSystemEnv(java.lang.String id, boolean includeLocalSystemEnv) 既存のシステム環境変数を識別子とともに自動的に含めるかどうかを指定します。 |
YarnEnvironmentConfigurer | propertiesLocation(java.lang.String... locations) プロパティの場所を指定します。 |
YarnEnvironmentConfigurer | propertiesLocationId(java.lang.String id, java.lang.String[] locations) 識別子を使用してプロパティの場所を指定します。 |
EnvironmentClasspathConfigurer | withClasspath() クラスパス環境変数を指定します。 |
EnvironmentClasspathConfigurer | withClasspath(java.lang.String id) 識別子を使用してクラスパス環境変数を指定します。 |
PropertiesConfigurer<YarnEnvironmentConfigurer> | withProperties() PropertiesConfigurer を使用してプロパティを指定します。 |
PropertiesConfigurer<YarnEnvironmentConfigurer> | withProperties(java.lang.String id) 識別子付きの PropertiesConfigurer を使用してプロパティを指定します。 |
EnvironmentClasspathConfigurer withClasspath() throws java.lang.Exception
新しい DefaultEnvironmentClasspathConfigurer
を現在のビルダーに適用します。JavaConfig と XML の同等のものを以下に示します。
JavaConfig:
public void configure(YarnEnvironmentBuilder environment) throws Exception { environment .withClasspath() .entry("cpEntry1") .entry("cpEntry2") .useDefaultYarnClasspath(true); }
<yarn:environment> <yarn:classpath use-yarn-app-classpath="true" delimiter=":"> cpEntry1 cpEntry2 </yarn:classpath> </yarn:environment>
EnvironmentClasspathConfigurer
java.lang.Exception
- エラーが発生した場合 EnvironmentClasspathConfigurer withClasspath(java.lang.String id) throws java.lang.Exception
id
- 識別子 EnvironmentClasspathConfigurer
java.lang.Exception
- エラーが発生した場合 withClasspath()
YarnEnvironmentConfigurer entry(java.lang.String key, java.lang.String value)
public void configure(YarnEnvironmentConfigure environment) throws Exception { environment .entry("myKey1","myValue1") .entry("myKey2","myValue2"); }
<yarn:environment> myKey1=myValue1 myKey2=myValue2 </yarn:environment>
key
- 環境キー value
- 環境価値 YarnEnvironmentConfigurer
YarnEnvironmentConfigurer entry(java.lang.String id, java.lang.String key, java.lang.String value)
id
- 識別子 key
- 環境キー value
- 環境価値 YarnEnvironmentConfigurer
entry(String, String)
YarnEnvironmentConfigurer propertiesLocation(java.lang.String... locations) throws java.io.IOException
public void configure(YarnEnvironmentConfigure environment) throws Exception { environment .entry("myKey1","myValue1") .entry("myKey2","myValue2") .propertiesLocation("cfg-1.properties", "cfg-2.properties"); }
<yarn:environment properties-location="cfg-1.properties, cfg-2.properties"> myKey1=myValue1 myKey2=myValue2 </yarn:environment>
locations
- プロパティファイルの場所 YarnEnvironmentConfigurer
java.io.IOException
- エラーが発生した場合 YarnEnvironmentConfigurer propertiesLocationId(java.lang.String id, java.lang.String[] locations) throws java.io.IOException
id
- 識別子 locations
- プロパティファイルの場所 YarnEnvironmentConfigurer
java.io.IOException
- エラーが発生した場合 propertiesLocation(String...)
YarnEnvironmentConfigurer includeLocalSystemEnv(boolean includeLocalSystemEnv)
public void configure(YarnEnvironmentConfigure environment) throws Exception { environment .includeLocalSystemEnv(false); }
<yarn:environment include-local-system-env="false"/>
includeLocalSystemEnv
- システム環境変数を含めるかどうか YarnEnvironmentConfigurer
YarnEnvironmentConfigurer includeLocalSystemEnv(java.lang.String id, boolean includeLocalSystemEnv)
id
- 識別子 includeLocalSystemEnv
- システム環境変数を含めるかどうか YarnEnvironmentConfigurer
includeLocalSystemEnv(boolean)
PropertiesConfigurer<YarnEnvironmentConfigurer> withProperties() throws java.lang.Exception
PropertiesConfigurer
を使用してプロパティを指定します。public void configure(YarnEnvironmentConfigure environment) throws Exception { Properties props = new Properties(); environment .withProperties() .properties(props) .property("myKey1", ",myValue1") .and(); }
<util:properties id="props" location="props.properties"/> <prop key="myKey1">myValue1</prop> </util:properties> <yarn:environment properties-ref="props"/>
PropertiesConfigurer
java.lang.Exception
- エラーが発生した場合 PropertiesConfigurer<YarnEnvironmentConfigurer> withProperties(java.lang.String id) throws java.lang.Exception
PropertiesConfigurer
を使用してプロパティを指定します。id
- 識別子 PropertiesConfigurer
java.lang.Exception
- エラーが発生した場合 withProperties()