aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllen Spertus <ellen.spertus@gmail.com>2018-07-28 15:43:16 -0700
committerEllen Spertus <ellen.spertus@gmail.com>2018-07-28 15:43:16 -0700
commit304196e01e69826047e5e14af949d5efc80d1ece (patch)
tree401c39d350e3835d306a7f88c5e3c109724799f9
parent70f3bc389f76d3fab76a67329c59891ae0f2804f (diff)
parent6970c63e2f111023be29b34e36c929dc0da5f70f (diff)
downloadsandcrawler-304196e01e69826047e5e14af949d5efc80d1ece.tar.gz
sandcrawler-304196e01e69826047e5e14af949d5efc80d1ece.zip
Merge branch 'grobid-crossref' of git.archive.org:webgroup/sandcrawler into grobid-crossref
-rwxr-xr-xplease28
1 files changed, 28 insertions, 0 deletions
diff --git a/please b/please
index a244b80..3563343 100755
--- a/please
+++ b/please
@@ -116,6 +116,29 @@ def run_statuscount(args):
env=args.env)
subprocess.call(cmd, shell=True)
+def run_matchcrossref(args):
+ if args.rebuild:
+ rebuild_scalding()
+ print("Starting matchcrossref job...")
+ output = "{}/output-{}/{}-matchcrossref".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.HBaseCrossrefScoreJob \
+ --hdfs \
+ --app.conf.path scalding/ia_cluster.conf \
+ --hbase-table wbgrp-journal-extract-0-{env} \
+ --zookeeper-hosts {zookeeper_hosts} \
+ --crossref-input {crossref_input} \
+ --output {output}""".format(
+ output=output,
+ zookeeper_hosts=ZOOKEEPER_HOSTS,
+ env=args.env,
+ crossref_input=args.crossref_input)
+ subprocess.call(cmd, shell=True)
+
def main():
parser = argparse.ArgumentParser()
@@ -146,6 +169,11 @@ def main():
sub_statuscount = subparsers.add_parser('status-count')
sub_statuscount.set_defaults(func=run_statuscount)
+ sub_matchcrossref = subparsers.add_parser('match-crossref')
+ sub_matchcrossref.set_defaults(func=run_matchcrossref)
+ sub_matchcrossref.add_argument('crossref_input',
+ help="full HDFS path of Crossref JSON dump")
+
args = parser.parse_args()
if not args.__dict__.get("func"):
print("tell me what to do! (try --help)")