This is an automated email from the ASF dual-hosted git repository.

mattmann pushed a commit to branch gsoc18
in repository https://gitbox.apache.org/repos/asf/drat.git

commit 1becc74403ad16e8593c8a52647af535d0c93015
Author: Chris Mattmann <chris.a.mattm...@jpl.nasa.gov>
AuthorDate: Mon Aug 13 21:44:08 2018 -0700

    Add del stats.
---
 distribution/src/main/resources/bin/drat | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/distribution/src/main/resources/bin/drat 
b/distribution/src/main/resources/bin/drat
index b3fe9d4..8081a3e 100755
--- a/distribution/src/main/resources/bin/drat
+++ b/distribution/src/main/resources/bin/drat
@@ -33,6 +33,7 @@ function print_help {
     echo "            reduce                                                   
| fire off the MapReduce reducer"
     echo "            help                                                     
| print this message"
     echo "            reset                                                    
| prepare to analyze an entirely new repo"
+    echo "            delstats                                                 
 | clear collected DRAT stats index"
     echo "                                                                     
| CAUTION: will delete previous crawls!"
 }
 
@@ -241,6 +242,30 @@ function reset {
         esac
 }
 
+# Clears the Solr Statistics repo for aggregating crawl stats. Expects no 
arguments.
+function delstats{
+    check_services_running "running"
+    check_num_args "delstats" $# 0
+    echo "This will remove any previous or current Solr DRAT stats 
information."
+    read -p "Do you wish to continue? [yN] " yn
+        case $yn in
+            [Yy]*)
+                echo "rm -rf $DRAT_HOME/solr/statistics/data"
+                rm -rf $DRAT_HOME/solr/statistics/data
+                echo "Please restart OODT with '\$DRAT_HOME/bin/oodt start' if 
you wish to run another crawl."
+            ;;
+            [Nn]*)
+                echo "Reset cancelled. Exiting..."
+                exit 0
+            ;;
+            *)
+                echo "Aborting..."
+                exit 1
+            ;;
+        esac
+
+}
+
 # Start parsing the arguments.
 case $1 in
     crawl)
@@ -261,6 +286,9 @@ case $1 in
     reset)
         reset
     ;;
+    delstats)
+       delstats
+    ;;
     help)
         print_help
     ;;

Reply via email to