From a9fe176a305b474050727d80c1f42941ecf1a2dc Mon Sep 17 00:00:00 2001 From: Ellen Spertus Date: Sun, 3 Jun 2018 16:54:08 -0700 Subject: Added HBaseBuilder.build() and had HBaseRowCountJob call it. --- scalding/src/main/scala/sandcrawler/HBaseBuilder.scala | 6 ++---- scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala | 10 +++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/scalding/src/main/scala/sandcrawler/HBaseBuilder.scala b/scalding/src/main/scala/sandcrawler/HBaseBuilder.scala index c55aef6..35aeb46 100644 --- a/scalding/src/main/scala/sandcrawler/HBaseBuilder.scala +++ b/scalding/src/main/scala/sandcrawler/HBaseBuilder.scala @@ -40,10 +40,8 @@ object HBaseBuilder { (families, groupedColNames.map({fields => new Fields(fields : _*)})) } - /* - def build(table: String, server: String, colSpec: List[String], sourceMode: SourceMode, keyList: List[String]) { - val (families: List[String], fields: List[Fields]) = parseColSpec(colSpec) + def build(table: String, server: String, colSpec: List[String], sourceMode: SourceMode, keyList: List[String] = List("key")) = { + val (families, fields) = parseColSpec(colSpec) new HBaseSource(table, server, new Fields("key"), families, fields, sourceMode = sourceMode, keyList = keyList) } - */ } diff --git a/scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala b/scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala index 79ebbb1..9d074ab 100644 --- a/scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala +++ b/scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala @@ -24,13 +24,9 @@ class HBaseRowCountJob(args: Args) extends JobBase(args) with HBasePipeConversio } object HBaseRowCountJob { - def getHBaseSource = new HBaseSource( - //"table_name", - //"quorum_name:2181", + def getHBaseSource = HBaseBuilder.build( "wbgrp-journal-extract-0-qa", // HBase Table Name "mtrcs-zk1.us.archive.org:2181", // HBase Zookeeper server (to get runtime config info; can be array?) - new Fields("key"), - List("file"), - List(new Fields("size", "mimetype")), - sourceMode = SourceMode.SCAN_ALL) + List("file:size", "file:mime"), + SourceMode.SCAN_ALL) } -- cgit v1.2.3