aboutsummaryrefslogtreecommitdiffstats
path: root/please
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2018-06-15 02:46:14 +0000
committerBryan Newbold <bnewbold@archive.org>2018-06-15 02:46:14 +0000
commit7bfb1ef88eda039ef0280f9f4398bd2cd5239555 (patch)
tree2b520bcb9471d0a9137468bb6f434fbab56625e6 /please
parent1e4cad9e66cce685a15e66dad61de7d39a81d7aa (diff)
downloadsandcrawler-7bfb1ef88eda039ef0280f9f4398bd2cd5239555.tar.gz
sandcrawler-7bfb1ef88eda039ef0280f9f4398bd2cd5239555.zip
please: status-count
Diffstat (limited to 'please')
-rwxr-xr-xplease21
1 files changed, 21 insertions, 0 deletions
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)")