<br />
<b>Deprecated</b>:  Creation of dynamic property wpdb::$categories is deprecated in <b>/home/garrens3/public_html/blog/wp-includes/wp-db.php</b> on line <b>760</b><br />
<br />
<b>Deprecated</b>:  Creation of dynamic property wpdb::$post2cat is deprecated in <b>/home/garrens3/public_html/blog/wp-includes/wp-db.php</b> on line <b>760</b><br />
<br />
<b>Deprecated</b>:  Creation of dynamic property wpdb::$link2cat is deprecated in <b>/home/garrens3/public_html/blog/wp-includes/wp-db.php</b> on line <b>760</b><br />
<br />
<b>Deprecated</b>:  Using ${var} in strings is deprecated, use {$var} instead in <b>/home/garrens3/public_html/blog/wp-includes/comment-template.php</b> on line <b>1747</b><br />
<br />
<b>Deprecated</b>:  Optional parameter $term_id declared before required parameter $meta_value is implicitly treated as a required parameter in <b>/home/garrens3/public_html/blog/wp-content/plugins/advanced-code-editor/advanced-code-editor.php</b> on line <b>1927</b><br />
<br />
<b>Deprecated</b>:  Optional parameter $term_id declared before required parameter $meta_value is implicitly treated as a required parameter in <b>/home/garrens3/public_html/blog/wp-content/plugins/advanced-code-editor/advanced-code-editor.php</b> on line <b>1941</b><br />
<br />
<b>Deprecated</b>:  Optional parameter $term_id declared before required parameter $meta_key is implicitly treated as a required parameter in <b>/home/garrens3/public_html/blog/wp-content/plugins/advanced-code-editor/advanced-code-editor.php</b> on line <b>1956</b><br />
<br />
<b>Deprecated</b>:  Optional parameter $term_id declared before required parameter $key is implicitly treated as a required parameter in <b>/home/garrens3/public_html/blog/wp-content/plugins/advanced-code-editor/advanced-code-editor.php</b> on line <b>1970</b><br />
<br />
<b>Deprecated</b>:  Automatic conversion of false to array is deprecated in <b>/home/garrens3/public_html/blog/wp-content/plugins/loginizer/init.php</b> on line <b>250</b><br />
<br />
<b>Deprecated</b>:  Automatic conversion of false to array is deprecated in <b>/home/garrens3/public_html/blog/wp-content/plugins/loginizer/init.php</b> on line <b>265</b><br />
<br />
<b>Deprecated</b>:  Creation of dynamic property WP_Block_Type::$skip_inner_blocks is deprecated in <b>/home/garrens3/public_html/blog/wp-includes/class-wp-block-type.php</b> on line <b>391</b><br />
<br />
<b>Deprecated</b>:  Creation of dynamic property WP_Block_Type::$skip_inner_blocks is deprecated in <b>/home/garrens3/public_html/blog/wp-includes/class-wp-block-type.php</b> on line <b>391</b><br />
{"id":73,"date":"2015-01-16T12:12:51","date_gmt":"2015-01-16T20:12:51","guid":{"rendered":"http:\/\/garrens.com\/blog\/?p=73"},"modified":"2015-01-16T12:12:51","modified_gmt":"2015-01-16T20:12:51","slug":"the-power-of-hadoop-in-under-10-lines","status":"publish","type":"post","link":"https:\/\/garrens.com\/blog\/2015\/01\/16\/the-power-of-hadoop-in-under-10-lines\/","title":{"rendered":"The Power of Hadoop in under 10 lines!"},"content":{"rendered":"<p>Okay Okay, I may have oversold it a bit, but here are less than 10 bash lines that resemble (if you squint <em><strong>really<\/strong><\/em> hard) <a href=\"http:\/\/garrens.com\/blog\/2014\/12\/18\/jelly-bean-analogy-to-mapreduce\/\" target=\"_blank\">Hadoop\/MapReduce<\/a>.<\/p>\n<pre>code_to_run=$1\r\nin_file=$2\r\nout_file=$3\r\nsplit -d -a 5 -l 100000 $in_file $in_file\"_\" &amp;&amp; \\\r\nls $in_file\"_\"* | xargs -P8 -n1 -I file $code_to_run file file.out &amp;&amp; \\\r\ncat $in_file\"_\"*.out &gt; $out_file &amp;&amp; \\\r\nrm $in_file\"_\"*\r\n<\/pre>\n<p>What will this do?<br \/>\nTakes 3 args<\/p>\n<ul>\n<li>code_to_run is just a path to an executable<\/li>\n<li>in_file is a path to a single in_file<\/li>\n<li>out_file is a path to a single out_file<\/li>\n<\/ul>\n<pre>split -d -a 5 -l 100000 $in_file $in_file\"_\"<\/pre>\n<p>Split the in_file into 100,000 line chunks with an underscore and numbers following (e.g. in_file = &#8220;file.tsv&#8221;, temp files file.tsv_00000, file.tsv_00001, etc)<\/p>\n<pre>ls $in_file\"_\"* | xargs -P8 -n1 -I file $code_to_run file file.out<\/pre>\n<p>Get a list of all temp numbered in files, pass into xargs to run 8 processes of your code_to_run executable passing in the chunked in_file and outputting a chunked out_file.<\/p>\n<pre>cat $in_file\"_\"*.out &gt; $out_file<\/pre>\n<p>Then cat chunked out files into single out file as you expect<\/p>\n<pre>rm $in_file\"_\"*\r\n<\/pre>\n<p>Cleanup (re: remove) all temporary files; both in and out temporary files will be removed.<\/p>\n<p>For the sake of data safety, we include &#8220;&amp;&amp;&#8221; following each line to ensure all subsequent commands are not run unless the prior conditions are met.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Okay Okay, I may have oversold it a bit, but here are less than 10 bash lines that resemble (if you squint really hard) Hadoop\/MapReduce. code_to_run=$1 in_file=$2 out_file=$3 split -d -a 5 -l 100000 $in_file $in_file&#8221;_&#8221; &amp;&amp; \\ ls $in_file&#8221;_&#8221;* | xargs -P8 -n1 -I file $code_to_run file file.out &amp;&amp; \\ cat $in_file&#8221;_&#8221;*.out &gt; $out_file&hellip; <a href=\"https:\/\/garrens.com\/blog\/2015\/01\/16\/the-power-of-hadoop-in-under-10-lines\/\" title=\"Read More\" class=\"read-more\">Continue reading<span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/posts\/73"}],"collection":[{"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":2,"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/posts\/73\/revisions\/77"}],"wp:attachment":[{"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/garrens.com\/blog\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}