Skip to content

Instantly share code, notes, and snippets.

View erraggy's full-sized avatar

Robbie Coleman erraggy

View GitHub Profile

Keybase proof

I hereby claim:

  • I am erraggy on github.
  • I am erraggy (https://keybase.io/erraggy) on keybase.
  • I have a public key whose fingerprint is DF66 1AE8 1FAD 953F 69D8 2094 6808 156D 53F8 2883

To claim this, I am signing this object:

implicit object KittenSeqConverter extends SeqConverter[Kitten]
class WebTablePagesBySiteJob extends HJob[NoSettings]("Get articles by site",
HMapReduceTask(
HTaskID("Articles by Site"),
HTaskConfigs(),
HIO(
HTableInput(WebCrawlingSchema.WebTable),
HPathOutput("/reports/wordcount")
),
new FromTableBinaryMapperFx(WebCrawlingSchema.WebTable) {
val webPage : WebPageRow = row //For illustrative purposes we're specifying the type here, no need to
ExampleSchema.ExampleTable
.put("Chris").value(_.title, "My Life, My Times")
.put("Joe").value(_.title, "Joe's Life and Times")
.put("Fred").value(_.viewsArr,Seq("Chris","Bissell"))
.increment("Chris").value(_.views, 10l)
.put("Chris").valueMap(_.viewCountsByDay, Map(YearDay(2011,16)->60l, YearDay(2011,17)->50l))
.execute()
class WebPageRow(table: WebTable, result: DeserializedResult) extends HRow[WebTable, String](result, table) {
def domain = new URL(rowid).getAuthority
}
case class YearDay(year: Int, day: Int)
ExampleSchema.ExampleTable.put(1346l).valueMap(_.viewCounts, Map("Today" -> 61l, "Yesterday" -> 86l)).execute
val viewCounts = family[String, String, Long]("views")
ExampleSchema.ExampleTable
.put("Chris").value(_.title, "My Life, My Times")
.put("Joe").value(_.title, "Joe's Life and Times")
.increment("Chris").value(_.views, 10l)
.execute()
new WebSearchAggregationJob().run(Settings.None, LocalCluster.getTestConfiguration)