aboutsummaryrefslogtreecommitdiffstats
path: root/please
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2018-08-20 18:50:07 -0700
committerBryan Newbold <bnewbold@archive.org>2018-08-21 21:25:56 -0700
commit7c49fecd01cbd89bb5987442b89a4aafc1186ff9 (patch)
treec73d532fde19e2492fff573edb1d0ef10d7b084f /please
parent9514b6a3620a98e4fc069ca31b77eac6f9c98bec (diff)
downloadsandcrawler-7c49fecd01cbd89bb5987442b89a4aafc1186ff9.tar.gz
sandcrawler-7c49fecd01cbd89bb5987442b89a4aafc1186ff9.zip
make col counter generic
Diffstat (limited to 'please')
-rwxr-xr-xplease28
1 files changed, 28 insertions, 0 deletions
diff --git a/please b/please
index 0cc4b72..8a46978 100755
--- a/please
+++ b/please
@@ -165,6 +165,30 @@ def run_grobidscorabledump(args):
env=args.env)
subprocess.call(cmd, shell=True)
+def run_colcount(args):
+ if args.rebuild:
+ rebuild_scalding()
+ print("Starting colcount job...")
+ output = "{}/output-{}/{}-colcount-{}".format(
+ HDFS_DIR,
+ args.env,
+ datetime.strftime(datetime.now(), "%Y-%m-%d-%H%M.%S"),
+ args.column)
+ cmd = """hadoop jar \
+ scalding/target/scala-2.11/sandcrawler-assembly-0.2.0-SNAPSHOT.jar \
+ com.twitter.scalding.Tool sandcrawler.HBaseColCountJob \
+ --hdfs \
+ --app.conf.path scalding/ia_cluster.conf \
+ --hbase-table wbgrp-journal-extract-0-{env} \
+ --zookeeper-hosts {zookeeper_hosts} \
+ --column {column} \
+ --output {output}""".format(
+ column=args.column,
+ output=output,
+ zookeeper_hosts=ZOOKEEPER_HOSTS,
+ env=args.env)
+ subprocess.call(cmd, shell=True)
+
def main():
parser = argparse.ArgumentParser()
@@ -206,6 +230,10 @@ def main():
sub_grobidscorabledump = subparsers.add_parser('grobid-scorable-dump')
sub_grobidscorabledump.set_defaults(func=run_grobidscorabledump)
+ sub_colcount = subparsers.add_parser('col-count')
+ sub_colcount.set_defaults(func=run_colcount)
+ sub_colcount.add_argument('column',
+ help="column name to use in count")
args = parser.parse_args()
if not args.__dict__.get("func"):