diff options
-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)") |