diff options
| author | Bryan Newbold <bnewbold@archive.org> | 2018-06-17 10:00:28 -0700 | 
|---|---|---|
| committer | Bryan Newbold <bnewbold@archive.org> | 2018-06-17 10:00:28 -0700 | 
| commit | 2a2921d82a5a46549e9be2c2eb5703ce28fa7579 (patch) | |
| tree | 1cf775d36e590889128942711208e4b37022e73d /scalding/src/main | |
| parent | 8cc18540e2663ab02428c15c2e1f17fe5624e1aa (diff) | |
| download | sandcrawler-2a2921d82a5a46549e9be2c2eb5703ce28fa7579.tar.gz sandcrawler-2a2921d82a5a46549e9be2c2eb5703ce28fa7579.zip | |
hbase table and zk host as arguments
Diffstat (limited to 'scalding/src/main')
| -rw-r--r-- | scalding/src/main/scala/sandcrawler/HBaseCountJob.scala | 10 | ||||
| -rw-r--r-- | scalding/src/main/scala/sandcrawler/HBaseRowCountJob.scala | 21 | 
2 files changed, 18 insertions, 13 deletions
| diff --git a/scalding/src/main/scala/sandcrawler/HBaseCountJob.scala b/scalding/src/main/scala/sandcrawler/HBaseCountJob.scala index 815478b..53ce325 100644 --- a/scalding/src/main/scala/sandcrawler/HBaseCountJob.scala +++ b/scalding/src/main/scala/sandcrawler/HBaseCountJob.scala @@ -13,7 +13,9 @@ class HBaseCountJob(args: Args, colSpec: String) extends JobBase(args) with HBas    HBaseBuilder.parseColSpec(colSpec)    val Col: String = colSpec.split(":")(1) -  HBaseCountJob.getHBaseSource(colSpec) +  HBaseCountJob.getHBaseSource(args("hbase-table"), +                               args("zookeeper-hosts"), +                               colSpec)      .read      .fromBytesWritable(Symbol(Col))      .debug @@ -22,9 +24,9 @@ class HBaseCountJob(args: Args, colSpec: String) extends JobBase(args) with HBas  }  object HBaseCountJob { -  def getHBaseSource(colSpec: String) = 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?) +  def getHBaseSource(hbase_table: String, zookeeper_hosts: String, colSpec: String) = HBaseBuilder.build( +    hbase_table,      // HBase Table Name +    zookeeper_hosts,  // HBase Zookeeper server (to get runtime config info; can be array?)      List(colSpec),      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) +  } +  } | 
