From 7bfb1ef88eda039ef0280f9f4398bd2cd5239555 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 15 Jun 2018 02:46:14 +0000 Subject: please: status-count --- please | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'please') diff --git a/please b/please index 04aa709..2d4cae8 100755 --- a/please +++ b/please @@ -74,6 +74,8 @@ def run_extract(args): subprocess.call(cmd, shell=True) def run_rowcount(args): + if args.rebuild: + rebuild_scalding() print("Starting rowcount job...") output = "{}/output-{}/{}-rowcount".format( HDFS_DIR, @@ -87,6 +89,22 @@ def run_rowcount(args): --output {}""".format(output) subprocess.call(cmd, shell=True) +def run_statuscount(args): + if args.rebuild: + rebuild_scalding() + print("Starting statuscount job...") + output = "{}/output-{}/{}-statuscount".format( + HDFS_DIR, + args.env, + datetime.strftime(datetime.now(), "%Y-%m-%d-%H%M.%S")) + cmd = """hadoop jar \ + scalding/target/scala-2.11/sandcrawler-assembly-0.2.0-SNAPSHOT.jar \ + com.twitter.scalding.Tool sandcrawler.HBaseStatusCountJob \ + --hdfs \ + --app.conf.path scalding/ia_cluster.conf \ + --output {}""".format(output) + subprocess.call(cmd, shell=True) + def main(): parser = argparse.ArgumentParser() @@ -114,6 +132,9 @@ def main(): sub_rowcount = subparsers.add_parser('row-count') sub_rowcount.set_defaults(func=run_rowcount) + sub_statuscount = subparsers.add_parser('status-count') + sub_statuscount.set_defaults(func=run_statuscount) + args = parser.parse_args() if not args.__dict__.get("func"): print("tell me what to do! (try --help)") -- cgit v1.2.3