再利用使用AWS Java SDK的亚马逊弹性麻preduce实例 [英] Re-use Amazon Elastic MapReduce instance using aws java sdk

查看:181
本文介绍了再利用使用AWS Java SDK的亚马逊弹性麻preduce实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个链接(再利用亚马逊的弹性麻preduce例如)提供了一种方法来重新使用实例是这样弹性-MA preduce --jobflow作业ID \     --jar S3N://some-path/x.jar \     --step名新的一步名\     --args ...

This link (Re-use Amazon Elastic MapReduce instance) provides a way to re-use an instance like this elastic-mapreduce --jobflow job-id \ --jar s3n://some-path/x.jar \ --step-name "New step name" \ --args ...

但我怎么可以做同样的驱动程序来运行,即通过使用AWS Java SDK的运行另一个作业。我认为必须有JobFlowInstancesConfig类中的一些方法来设置ID,但我无法找到任何东西。 <一href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/elasticma$p$pduce/model/JobFlowInstancesConfig.html" rel="nofollow">http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/elasticma$p$pduce/model/JobFlowInstancesConfig.html

but how can I do the same in a Driver program to run the job i.e. by using aws java sdk to run another job . I thought there must be some method in JobFlowInstancesConfig class for setting the id but I couldn't find any thing. http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/elasticmapreduce/model/JobFlowInstancesConfig.html

任何帮助是AP preciated。

Any help is appreciated.

推荐答案

其实我不会回答,因为downvotes我得到了最初。  我做了这样的事情(我还没有添加整个code在这里,但下面可能会有所帮助的链接)

Actually I wasn't going to answer because of the downvotes I got initially . I did something like this (I have not added the entire code here but the link following it may help)

static AddJobFlowStepsRequest AJFSrequest;
List <StepConfig>steps = new LinkedList();
AJFSrequest = new AddJobFlowStepsRequest();
AJFSrequest.setJobFlowId("j-VKJMSIU34SFQ");

HadoopJarStepConfig jarConfig = new HadoopJarStepConfig(S3N_HADOOP_JAR);
jarConfig.setArgs(ARGS_AS_LIST);
StepConfig stepConfig =new StepConfig(S3N_HADOOP_JAR.substring(S3N_HADOOP_JAR.indexOf('/') + 1),jarConfig);

String lastState = "";
steps.add(stepConfig);
AJFSrequest.setSteps(steps);
emr.addJobFlowSteps(AJFSrequest);

http://chathurah.blogspot.in/2010/ 03 /编程推出弹性-map.html

这篇关于再利用使用AWS Java SDK的亚马逊弹性麻preduce实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆