Skip to content

Instantly share code, notes, and snippets.

View AndyCross's full-sized avatar

Andy Cross AndyCross

View GitHub Profile
@AndyCross
AndyCross / HelloWorldJob.cs
Created November 22, 2012 16:09
StreamingUnit
using Elastacloud.Hadoop.StreamingUnitExample.Job.Map;
using Elastacloud.Hadoop.StreamingUnitExample.Job.Reduce;
using Microsoft.Hadoop.MapReduce;
namespace Elastacloud.Hadoop.StreamingUnitExample.Job
{
public class HelloWorldJob : HadoopJob<HelloWorldMapper, HelloWorldReducer>
{
public override HadoopJobConfiguration Configure(ExecutorContext context)
{
@AndyCross
AndyCross / Modified1.cs
Created November 22, 2012 17:11
StreamingUnit2
//example input: Hello, Andy
if (!inputLine.StartsWith("Hello, "))
{
context.Log(string.Format("The inputLine {0} is not in the correct format", inputLine));
return;
}
@AndyCross
AndyCross / Job.cs
Created November 27, 2012 15:14
Hadoop Compression
//public override HadoopJobConfiguration Configure(ExecutorContext context)
HadoopJobConfiguration config = new HadoopJobConfiguration();
config.InputPath = "/input/data.log.gz";
config.OutputFolder = "/output/output" + DateTime.Now.ToString("yyyyMMddhhmmss");
config.AdditionalGenericArguments.Add("-D \"io.compression.codecs=org.apache.hadoop.io.compress.GzipCodec\"");
return config;
using System;
using Microsoft.Hadoop.MapReduce;
namespace Elastacloud.Hadoop.SampleDataMapReduceJob
{
public class SampleMapper : MapperBase
{
public override void Map(string inputLine, MapperContext context)
{
try
@AndyCross
AndyCross / asv.cs
Created December 10, 2012 19:25
HDInsight ASV
public override HadoopJobConfiguration Configure(ExecutorContext context)
{
try
{
HadoopJobConfiguration config = new HadoopJobConfiguration();
config.InputPath = "asv://container/inputpath/";
config.OutputFolder = "asv://container/outputpath" + DateTime.Now.ToString("yyyyMMddhhmmss");
return config;
}
@AndyCross
AndyCross / file1.cs
Created December 13, 2012 16:05
hdinsight setstatuser
public static class ContextBaseExtension
{
public static void SetStatus(this ContextBase context, string statusMessage)
{
Console.Error.WriteLine("reporter:status:{0}", statusMessage);
}
}
@AndyCross
AndyCross / file2.cs
Created December 13, 2012 16:09
hdinsight stastatus12
context.SetStatus("Sleeping During Map!");
Thread.Sleep(180000);
@AndyCross
AndyCross / file3.cs
Created December 13, 2012 16:10
hdinsight setstatuser3
using System;
using Microsoft.Hadoop.MapReduce;
namespace Elastacloud.Hadoop.SampleDataMapReduceJob
{
public class SampleMapper : MapperBase
{
public override void Map(string inputLine, MapperContext context)
{
try
@AndyCross
AndyCross / something.cshtml
Created January 21, 2014 15:43
A line for DropdownlistFor (for neckbeard)
@Html.DropDownListFor(m => m.Language, new SelectList(Enum.GetValues(typeof(Asos.Partyr.Common.Models.Entry.PartyLanguage)), Model.Language))
<a class="twitter-timeline" href="https://twitter.com/search?q=%23azure+-%23TranslateApiException+min_retweets%3A1" data-widget-id="451033701543989248">Tweets about "#azure -#TranslateApiException min_retweets:1"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>