{"id":17305,"date":"2013-09-16T01:00:50","date_gmt":"2013-09-15T22:00:50","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=17305"},"modified":"2013-09-13T09:37:29","modified_gmt":"2013-09-13T06:37:29","slug":"configuring-hadoop-with-guava-mapsplitters","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html","title":{"rendered":"Configuring Hadoop with Guava MapSplitters"},"content":{"rendered":"<p>In this post we are going to provide a new twist on passing configuration parameters to a Hadoop Mapper via the Context object. Typically, we set configuration parameters as key\/value pairs on the Context object when starting a map-reduce job. Then in the Mapper we use the key(s) to retrieve the value(s) to use for our configuration needs. The twist is we will set a specially formatted string on the <code>Context<\/code> object and when retrieving the value in the Mapper, use a Guava <a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release\/javadoc\/com\/google\/common\/base\/Splitter.MapSplitter.html\" target=\"_blank\"><code>MapSplitter<\/code> <\/a> to convert the formatted string into a <code>HashMap<\/code> that will be used for obtaining configuration parameters. We may be asking ourselves why go to this trouble? By doing configuration this way we are able to pass multiple parameters to a Mapper with a single key-value pair set on the Context object. To illustrate one possible usage, we will revisit the <a title=\"MapReduce Algorithms \u2013 Understanding Data Joins Part 1\" href=\"http:\/\/www.javacodegeeks.com\/2013\/07\/mapreduce-algorithms-understanding-data-joins-part-1.html\" target=\"_blank\">last post<\/a>, where we covered how to perform reduce-side joins. There are two problems with the proposed solution in that post. First, we are assuming the key to join on is always the first value in a delimited string from a file. Second, we assume that the same delimiter is used for each file. What if we want to join data from files where the key is located in different locations per file and some files use different delimiters? Additionally we want to use the same delimiter (if any) for all of the data we output regardless of the delimiter used in any of the input files. While this is admittedly a contrived situation, it will serve well for demonstration purposes. First let\u2019s go over what the <code>MapSplitter<\/code> class is and how we can use it.<\/p>\n<h2>MapSplitter<\/h2>\n<p>The <a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release\/javadoc\/com\/google\/common\/base\/Splitter.MapSplitter.html\" target=\"_blank\"><code>MapSplitter<\/code> <\/a> is a nested class in the <a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release\/javadoc\/com\/google\/common\/base\/Splitter.html\" target=\"_blank\"><code>Splitter<\/code><\/a> class. The <code>Spitter<\/code> takes a String and splits it into parts with a given delimiter. The MapSplitter goes a step further by creating a Map&lt;String,String&gt; from a string with key-value pairs separated with one delimiter and the pairs themselves separated with another delimiter altogether. Let\u2019s take a look at an example:<\/p>\n<pre class=\" brush:java\">Map&lt;String,String&gt; configParams = Splitter.splitOn(\"#\")\r\n                                   .withKeyValueSeparator(\"=\")\r\n                                   .split(\"6=June#7=July#8=August\");<\/pre>\n<p>In the example above the String <code>\"6=June#7=July#8=August\"<\/code> would be converted into a Map with keys 6,7 and 8 mapped to June, July and August respectively. The <code>MapSplitter<\/code> is a very simple, but powerful class. Now we know how the <code>MapSplitter<\/code> works, let\u2019s take a look at how we can use it to help us set configuration parameters for our map-reduce jobs<\/p>\n<h2>Configuration using the MapSplitter<\/h2>\n<p>Previously we set the index position of our join key and the delimiter to split on as the same for all files by setting the values in the <code>Context<\/code> object for the map-reduce job. Now we want to be able to set those on a per input file basis as needed. We will still have default values as needed. In order to accomplish this change we will create a properties file that will have the name of the file as the key and the value will be a string formatted to be used by the <code>MapSplitter<\/code>. Our properties file will look like this:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:java\">oneToManyEmployer2.txt=keyIndex=1&amp;separator=|\r\noneToManyVehicles2.txt=keyIndex=1&amp;separator=#<\/pre>\n<p>Here we are indicating the the file oneToManyEmployer2.txt has our join key at index position 1 and the delimiter is a \u201c|\u201d pipe character and the oneToManyVehicles2.txt file has the join key at index position 1 and uses a \u201c,\u201d comma as a delimiter. We are going to make a few changes to our driver class. First we are going to load the properties file (assuming we have placed the file in a directory located relative to where we invoke hadoop).<\/p>\n<pre class=\" brush:java\">InputStream inputStream = new FileInputStream(new File(\".\/jobs\/join-config.properties\"));\r\nProperties properties = new Properties();\r\nproperties.load(inputStream);<\/pre>\n<p>First we define a regular <code>Splitter<\/code> object that will split the file names on a forward slash \u2018\/\u2019. Next as we loop through the file names we get the base name of the file by calling <code>Iterables.getLast<\/code> on the <code>Iterable<\/code> object returned from the <code>Splitter.split<\/code> method call. Then we attempt to retrieve a configured property string for each file in the <code>Properties.getProperty<\/code> method. Take note we also pass the <code>defaultMapConfig<\/code> variable that supplies default values if the property is not found for the file. We\u2019ve also added some additional configuration keys and values; the delimiter to use when joining values together and the join order for the file, which is determined by it\u2019s position in the arguments provided to the program. Then we simply place the formatted string into the <code>Context<\/code> object using the file name as the key.<\/p>\n<pre class=\" brush:java\">String defaultMapConfig = \"keyIndex=0&amp;separator=,\";\r\nSplitter splitter = Splitter.on('\/');\r\nfor (int i = 0; i &lt; args.length - 1; i++) {\r\n    String fileName = Iterables.getLast(splitter.split(args[i]));\r\n    String mapConfig = properties.getProperty(fileName, defaultMapConfig);\r\n    builder.append(mapConfig).append(\"&amp;joinDelimiter=,&amp;joinOrder=\").append(i + 1);\r\n    config.set(fileName, builder.toString());\r\n    builder.setLength(0);\r\n    filePaths.append(args[i]).append(\",\");\r\n}<\/pre>\n<h2>Using the configuration values<\/h2>\n<p>To use our config values we will first have to retrieve the <code>HashMap<\/code> stored as a String that contains our configuration parameters<\/p>\n<pre class=\" brush:java\">private Splitter.MapSplitter mapSplitter = Splitter.on(\"&amp;\").withKeyValueSeparator(\"=\");\r\n.......\r\nprivate Map&lt;String,String&gt; getConfigurationMap(Context context){\r\n        FileSplit fileSplit = (FileSplit)context.getInputSplit();\r\n        String configString = context.getConfiguration().get(fileSplit.getPath().getName());\r\n        return mapSplitter.split(configString);\r\n    }<\/pre>\n<p>Here we are using a <code>MapSplitter<\/code> instance variable and to create our <code>HashMap<\/code> by retrieving the formatted string stored in the <code>Context<\/code> with the file name used by this Mapper. Now we can simply pull the needed configuration parameters out from the map as shown here in the <code>setup<\/code> method:<\/p>\n<pre class=\" brush:java\">protected void setup(Context context) throws IOException, InterruptedException {\r\n        Map&lt;String,String&gt; configMap = getConfigurationMap(context);\r\n        keyIndex = Integer.parseInt(configMap.get(\"keyIndex\"));\r\n        String separator = configMap.get(\"separator\");\r\n        splitter = Splitter.on(separator).trimResults();\r\n        String joinDelimiter = configMap.get(\"joinDelimiter\");\r\n        joiner = Joiner.on(joinDelimiter);\r\n        joinOrder = Integer.parseInt(configMap.get(\"joinOrder\"));\r\n    }<\/pre>\n<p>The code in the <code>map<\/code> method remains the same as it was from our previous <a title=\"MapReduce Algorithms \u2013 Understanding Data Joins Part 1\" href=\"http:\/\/www.javacodegeeks.com\/2013\/07\/mapreduce-algorithms-understanding-data-joins-part-1.html\" target=\"_blank\">post<\/a> Now we have completely configurable settings per file and we aren&#8217;t restricted to having the join key in one position or having to use the same delimiter per file. Of course this is just one example, but the approach outlined here could be used to configure many other settings and it only requires one key in the <code>Context<\/code> object.<\/p>\n<h2>Results<\/h2>\n<p>Initially our data looked like this:<\/p>\n<h4>oneToManyEmployer2.txt:<\/h4>\n<pre class=\" brush:bash\">\r\nCreative Wealth|cdd8dde3-0349-4f0d-b97a-7ae84b687f9c\r\nSusie's Casuals|81a43486-07e1-4b92-b92b-03d0caa87b5f\r\nSuper Saver Foods|aef52cf1-f565-4124-bf18-47acdac47a0e\r\n.....\r\n<\/pre>\n<h4>oneToManyVehicles2.txt:<\/h4>\n<pre class=\" brush:bash\">\r\n2003 Holden Cruze#cdd8dde3-0349-4f0d-b97a-7ae84b687f9c\r\n2012 Volkswagen T5#81a43486-07e1-4b92-b92b-03d0caa87b5f\r\n2009 Renault Trafic#aef52cf1-f565-4124-bf18-47acdac47a0e\r\n.....\r\n<\/pre>\n<h4>singlePersonRecords.txt:<\/h4>\n<pre class=\" brush:bash\">\r\ncdd8dde3-0349-4f0d-b97a-7ae84b687f9c,Esther,Garner,4071 Haven Lane,Okemos,MI\r\n81a43486-07e1-4b92-b92b-03d0caa87b5f,Timothy,Duncan,753 Stadium Drive,Taunton,MA\r\naef52cf1-f565-4124-bf18-47acdac47a0e,Brett,Ramsey,4985 Shinn Street,New York,NY\r\n......\r\n<\/pre>\n<p>After running our map-reduce job our results look exactly like we want them:<\/p>\n<pre class=\" brush:bash\">\r\n08db7c55-22ae-4199-8826-c67a5689f838,John,Gregory,258 Khale Street,Florence,SC,2010 Nissan Titan,Ellman's Catalog Showrooms\r\n0c521380-f868-438c-9916-4ab4ea76d316,Robert,Eversole,518 Stratford Court,Fayetteville,NC,2002 Toyota Highlander,Specialty Restaurant Group\r\n1303e8a6-0085-45b1-8ea5-26c809635da1,Joe,Nagy,3438 Woodstock Drive,El Monte,CA,2011 Hyundai ix35,Eagle Food Centers\r\n15360125-38d6-4f1e-a584-6ab9d1985ab8,Sherri,Hanks,4082 Old House Drive,Alexandria,OH,2003 Toyota Solara,Odyssey Records &amp; Tapes\r\n......\r\n<\/pre>\n<h2>Resources<\/h2>\n<ul>\n<li><a title=\"Data-Intensive Text Processing with MapReduce\" href=\"http:\/\/www.amazon.com\/Data-Intensive-Processing-MapReduce-Synthesis-Technologies\/dp\/1608453421\" target=\"_blank\">Data-Intensive Processing with MapReduce<\/a> by Jimmy Lin and Chris Dyer<\/li>\n<li><a href=\"http:\/\/www.amazon.com\/Hadoop-Definitive-Guide-Tom-White\/dp\/1449311520\/ref=tmm_pap_title_0?ie=UTF8&amp;qid=1347589052&amp;sr=1-1\" target=\"_blank\">Hadoop: The Definitive Guide<\/a> by Tom White<\/li>\n<li><a title=\"Source Code\" href=\"https:\/\/github.com\/bbejeck\/hadoop-algorithms\" target=\"_blank\">Source Code and Tests<\/a> from blog<\/li>\n<li><a href=\"http:\/\/www.amazon.com\/Programming-Hive-Edward-Capriolo\/dp\/1449319335\" target=\"_blank\">Programming Hive<\/a> by Edward Capriolo, Dean Wampler and Jason Rutherglen<\/li>\n<li><a href=\"http:\/\/www.amazon.com\/Programming-Pig-Alan-Gates\/dp\/1449302645\" target=\"_blank\">Programming Pig<\/a> by Alan Gates<\/li>\n<li><a href=\"http:\/\/hadoop.apache.org\/docs\/r0.20.2\/api\/index.html\">Hadoop API<\/a><\/li>\n<li><a href=\"http:\/\/mrunit.apache.org\/\" target=\"_blank\">MRUnit<\/a> for unit testing Apache Hadoop map reduce jobs<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/codingjunkie.net\/configuring-hadoop\/\">Configuring Hadoop with Guava MapSplitters<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Bill Bejeck at the <a href=\"http:\/\/codingjunkie.net\/\">Random Thoughts On Coding<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this post we are going to provide a new twist on passing configuration parameters to a Hadoop Mapper via the Context object. Typically, we set configuration parameters as key\/value pairs on the Context object when starting a map-reduce job. Then in the Mapper we use the key(s) to retrieve the value(s) to use for &hellip;<\/p>\n","protected":false},"author":110,"featured_media":62,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[184,280],"class_list":["post-17305","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-hadoop","tag-google-guava"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Configuring Hadoop with Guava MapSplitters<\/title>\n<meta name=\"description\" content=\"In this post we are going to provide a new twist on passing configuration parameters to a Hadoop Mapper via the Context object. Typically, we set\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Configuring Hadoop with Guava MapSplitters\" \/>\n<meta property=\"og:description\" content=\"In this post we are going to provide a new twist on passing configuration parameters to a Hadoop Mapper via the Context object. Typically, we set\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-15T22:00:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-hadoop-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bill Bejeck\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bill Bejeck\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html\"},\"author\":{\"name\":\"Bill Bejeck\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/69f9f11896bf9cfd7278b440efeda646\"},\"headline\":\"Configuring Hadoop with Guava MapSplitters\",\"datePublished\":\"2013-09-15T22:00:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html\"},\"wordCount\":963,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-hadoop-logo.jpg\",\"keywords\":[\"Apache Hadoop\",\"Google Guava\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html\",\"name\":\"Configuring Hadoop with Guava MapSplitters\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-hadoop-logo.jpg\",\"datePublished\":\"2013-09-15T22:00:50+00:00\",\"description\":\"In this post we are going to provide a new twist on passing configuration parameters to a Hadoop Mapper via the Context object. Typically, we set\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-hadoop-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-hadoop-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/09\\\/configuring-hadoop-with-guava-mapsplitters.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Configuring Hadoop with Guava MapSplitters\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/69f9f11896bf9cfd7278b440efeda646\",\"name\":\"Bill Bejeck\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0ab8cd639470515ff498599471cc60f21b2d0b14301ff22cadc708dc19c8be?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0ab8cd639470515ff498599471cc60f21b2d0b14301ff22cadc708dc19c8be?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0ab8cd639470515ff498599471cc60f21b2d0b14301ff22cadc708dc19c8be?s=96&d=mm&r=g\",\"caption\":\"Bill Bejeck\"},\"description\":\"Husband, father of 3, passionate about software development.\",\"sameAs\":[\"http:\\\/\\\/codingjunkie.net\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Bill-Bejeck\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Configuring Hadoop with Guava MapSplitters","description":"In this post we are going to provide a new twist on passing configuration parameters to a Hadoop Mapper via the Context object. Typically, we set","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html","og_locale":"en_US","og_type":"article","og_title":"Configuring Hadoop with Guava MapSplitters","og_description":"In this post we are going to provide a new twist on passing configuration parameters to a Hadoop Mapper via the Context object. Typically, we set","og_url":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-09-15T22:00:50+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-hadoop-logo.jpg","type":"image\/jpeg"}],"author":"Bill Bejeck","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Bill Bejeck","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html"},"author":{"name":"Bill Bejeck","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/69f9f11896bf9cfd7278b440efeda646"},"headline":"Configuring Hadoop with Guava MapSplitters","datePublished":"2013-09-15T22:00:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html"},"wordCount":963,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-hadoop-logo.jpg","keywords":["Apache Hadoop","Google Guava"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html","url":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html","name":"Configuring Hadoop with Guava MapSplitters","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-hadoop-logo.jpg","datePublished":"2013-09-15T22:00:50+00:00","description":"In this post we are going to provide a new twist on passing configuration parameters to a Hadoop Mapper via the Context object. Typically, we set","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-hadoop-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-hadoop-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/09\/configuring-hadoop-with-guava-mapsplitters.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Configuring Hadoop with Guava MapSplitters"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/69f9f11896bf9cfd7278b440efeda646","name":"Bill Bejeck","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6f0ab8cd639470515ff498599471cc60f21b2d0b14301ff22cadc708dc19c8be?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6f0ab8cd639470515ff498599471cc60f21b2d0b14301ff22cadc708dc19c8be?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f0ab8cd639470515ff498599471cc60f21b2d0b14301ff22cadc708dc19c8be?s=96&d=mm&r=g","caption":"Bill Bejeck"},"description":"Husband, father of 3, passionate about software development.","sameAs":["http:\/\/codingjunkie.net\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Bill-Bejeck"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/17305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=17305"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/17305\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/62"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=17305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=17305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=17305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}