diff options
author | Bryan Newbold <bnewbold@archive.org> | 2018-06-08 15:06:39 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2018-06-08 15:06:39 -0700 |
commit | 00d256bbb9837ba3071f2ad58d2f3c857157d09a (patch) | |
tree | e0cbb82d2fc675776a944864b5154b46a248fd6e /scalding/src/main | |
parent | f81e193b4a2c7f61a46d1ead1bdf6b746997b3a8 (diff) | |
download | sandcrawler-bnewbold-backfill.tar.gz sandcrawler-bnewbold-backfill.zip |
make hbase_table and zookeeper_hosts CLI argsbnewbold-backfill
Diffstat (limited to 'scalding/src/main')
-rw-r--r-- | scalding/src/main/scala/sandcrawler/HBaseMimeCountJob.scala | 18 | ||||
-rw-r--r-- | scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala | 21 |
2 files changed, 24 insertions, 15 deletions
diff --git a/scalding/src/main/scala/sandcrawler/HBaseMimeCountJob.scala b/scalding/src/main/scala/sandcrawler/HBaseMimeCountJob.scala index 819a652..a6ab53a 100644 --- a/scalding/src/main/scala/sandcrawler/HBaseMimeCountJob.scala +++ b/scalding/src/main/scala/sandcrawler/HBaseMimeCountJob.scala @@ -9,9 +9,11 @@ import parallelai.spyglass.hbase.{HBaseSource, HBasePipeConversions} import parallelai.spyglass.hbase.HBaseConstants.SourceMode class HBaseMimeCountJob(args: Args) extends JobBase(args) with HBasePipeConversions { + val output = args("output") - HBaseMimeCountJob.getHBaseSource + HBaseMimeCountJob.getHBaseSource(args("hbase-table"), + args("zookeeper-hosts")) .read .fromBytesWritable(List('mime)) .debug @@ -20,9 +22,13 @@ class HBaseMimeCountJob(args: Args) extends JobBase(args) with HBasePipeConversi } object HBaseMimeCountJob { - 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?) - List("file:mime"), - SourceMode.SCAN_ALL) + + def getHBaseSource(hbase_table: String, zookeeper_hosts: String) : HBaseSource = { + return HBaseBuilder.build( + hbase_table, + zookeeper_hosts, + List("file:mime"), + SourceMode.SCAN_ALL) + } + } diff --git a/scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala b/scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala index 0c8e615..7f5c84a 100644 --- a/scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala +++ b/scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala @@ -10,12 +10,10 @@ import parallelai.spyglass.hbase.HBaseConstants.SourceMode class HBaseRowCountJob(args: Args) extends JobBase(args) with HBasePipeConversions { - - // For now doesn't actually count, just dumps a "word count" - val output = args("output") - HBaseRowCountJob.getHBaseSource + HBaseRowCountJob.getHBaseSource(args("hbase-table"), + args("zookeeper-hosts")) .read .debug .groupAll { _.size('count) } @@ -23,9 +21,14 @@ class HBaseRowCountJob(args: Args) extends JobBase(args) with HBasePipeConversio } object HBaseRowCountJob { - 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?) - List("file:size", "file:mime"), - SourceMode.SCAN_ALL) + + // eg, "wbgrp-journal-extract-0-qa", "mtrcs-zk1.us.archive.org:2181" + def getHBaseSource(hbase_table: String, zookeeper_hosts: String) : HBaseSource = { + return HBaseBuilder.build( + hbase_table, + zookeeper_hosts, + List("file:size"), + SourceMode.SCAN_ALL) + } + } |