Resources



Sample Code and Libraries

Java Library for Amazon Elastic MapReduce

Click for a printer friendly version of this document Printer Friendly Save to del.icio.us
 

Java Library for Amazon Elastic MapReduce

Submitted By: Elena@AWS  
AWS Products Used: Amazon Elastic MapReduce
Language(s): Java
License: Apache License 2.0

About this Library

  • Based on the 2009-03-31 API version.

What's New?

  • 2009-04-21:
    • Initial release

Prerequisites

Reference Documentation

Package Content

Path Overview
lib Binary distribution of library
src Source distribution of library.
third-party Binary distribution of library dependencies.
build.xml Ant build file to build the library

Quick Start

Library comes with code samples for each available service API. To get started with the library, follow these steps:
  1. Extract the amazon-elasticmapreduce-2009-03-31-java-library.zip file into a working directory.
  2. Add all sources under "src" directory to your compilation path.
  3. Add all jars files under "third-party/*" directory to your classpath. NOTE: if you are using JDK 1.6, do not add jaxb jars
  4. Edit desired sample. For example: DescribeJobFlowsSample.java


    • Set AWS Access Key ID and AWS Secret Access Key
    • String accessKeyId = "Your Access Key ID";
      String secretAccessKey = "Your Secret Access Key";
                      


    • Set request parameters. For example, find following pre-generated snippet:
    • DescribeJobFlowsRequest request = new DescribeJobFlowsRequest();
      // @TODO: set request parameters here
      // invokeDescribeJobFlows(service, request);
                      


    • And uncomment third line:
    • DescribeJobFlowsRequest request = new DescribeJobFlowsRequest();
      invokeDescribeJobFlows(service, request);
                      

  5. Compile and run DescribeJobFlows. You should see the output similar to the following:


  6.     DescribeJobFlowsResponse
            ResponseMetadata
                RequestId
                    95cdcb68-f46c-400b-8265-8c2de2a5c475
                

    Note, you may also see additional debugging output. To adjust level of debugging, modify log4j.properties available in the root of the source tree.

  7. Experiment with samples. When ready, add library binary distribution to your application classpath, and use it.

Making Requests to a Different Region

To make the service call to a different region, instantiate the client with the configuration object, and pass the region-specific endpoint. For example:

AmazonElasticMapReduce service = new AmazonElasticMapReduceClient
        (accessKeyId, secretAccessKey, 
            new AmazonElasticMapReduceConfig()
            .withServiceURL("https://eu-west-1.elasticmapreduce.amazonaws.com"));
                

See the Amazon Elastic MapReduce Developer Guide for a complete list of region endpoints.

Comments, Questions or Feedback

If you have any comments, questions or feedback on the library, please post it here.


Reviews
Create Review Write a Review
Be the first to review this.
Welcome, Guest Help
Login Login