[ 
https://issues.apache.org/jira/browse/TEZ-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14084174#comment-14084174
 ] 

Thaddeus Diamond commented on TEZ-1370:
---------------------------------------

I'm trying to get it working, but it seems a little strange that this API is 
different than the normal vertex.  If I do:

{noformat}
VertexLocationHint vertexLocationHint = new VertexLocationHint(null);

ProcessorDescriptor sleepProcDescriptor = new 
ProcessorDescriptor(SleepProcessor.class.getName());
SleepProcessor.SleepProcessorConfig sleepProcessorConfig = new 
SleepProcessor.SleepProcessorConfig(5000);
sleepProcDescriptor.setUserPayload(sleepProcessorConfig.toUserPayload());

Resource resource = Resource.newInstance(tezVertexMemoryMb, tezVertexVCores);

PreWarmContext preWarmContext = new PreWarmContext(sleepProcDescriptor, 
resource, preWarmNumberOfContainers, vertexLocationHint);
tezClient.preWarm(preWarmContext);
{noformat}

I get an NPE in {{TezYarnUtils}}:144 (has to do with grabbing stuff for the 
environment).  The example in {{OrderedWordCount}} (all I could find using this 
API in the source codebase) has a bunch of MR converters.  I'm going to try 
setting up some empty resource maps since I don't actually care about 
preloading those, just want to start the JVM.  I think though either way this 
should be fixed, the example I provide above should be enough to prewarm.

> Provide a configuration so when a session is started a set of containers are 
> started with it
> --------------------------------------------------------------------------------------------
>
>                 Key: TEZ-1370
>                 URL: https://issues.apache.org/jira/browse/TEZ-1370
>             Project: Apache Tez
>          Issue Type: Wish
>    Affects Versions: 0.5.0
>         Environment: branch -> master
> hadoop -> HDP 2.1/CDH 5.0
>            Reporter: Thaddeus Diamond
>
> This could use the existing 
> {{TezConfiguration.TEZ_AM_SESSION_MIN_HELD_CONTAINERS}} configuration or a 
> new one.
> The API would be as follows:
> {noformat}
> TezConfiguration tezConfiguration = new TezConfiguration(hadoopConfiguration);
> tezConfiguration.setBoolean(TEZ_AM_SESSION_MODE, true)
> tezConfiguration.setInt(TEZ_AM_SESSION_STARTUP_CONTAINERS, 3)
> TezClient tezClient = new TezClient("foobar", tezConfiguration);
> // The following should start 3 containers
> tezClient.start();
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to