diff options
author | Bryan Newbold <bnewbold@archive.org> | 2018-06-15 02:46:14 +0000 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2018-06-15 02:46:14 +0000 |
commit | 7bfb1ef88eda039ef0280f9f4398bd2cd5239555 (patch) | |
tree | 2b520bcb9471d0a9137468bb6f434fbab56625e6 | |
parent | 1e4cad9e66cce685a15e66dad61de7d39a81d7aa (diff) | |
download | sandcrawler-7bfb1ef88eda039ef0280f9f4398bd2cd5239555.tar.gz sandcrawler-7bfb1ef88eda039ef0280f9f4398bd2cd5239555.zip |
please: status-count
-rwxr-xr-x | please | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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)") |