-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README & add utility shell script (#151)
* doc: update obsolete content in README * feat: add cool shell script * revert: move health folder
- Loading branch information
1 parent
1d45e31
commit 584e221
Showing
2 changed files
with
191 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env bash | ||
|
||
COOL_CORE_PATH="${COOL_CORE_JAR_PATH:-./cool-core/target/cool-core-0.1-SNAPSHOT.jar}" | ||
COOL_QUERY_SERVER_PATH="${COOL_QUERY_SERVER_PATH:-./cool-queryserver/target/cool-queryserver-0.1-SNAPSHOT.jar}" | ||
|
||
|
||
main_help() { | ||
COOL_HELP_LEFT_ALIGN="%-17s" | ||
|
||
echo "Usage: $0 <command> [<args>]" | ||
echo | ||
echo Commands | ||
printf " $COOL_HELP_LEFT_ALIGN %s\n" "help" "Show this help menu" | ||
printf " $COOL_HELP_LEFT_ALIGN %s\n" "load" "Load dataset" | ||
printf " $COOL_HELP_LEFT_ALIGN %s\n" "cohortselection" "Perform cohort selection" | ||
printf " $COOL_HELP_LEFT_ALIGN %s\n" "cohortquery" "Perform cohort query" | ||
printf " $COOL_HELP_LEFT_ALIGN %s\n" "funnelquery" "Perform funnel query" | ||
printf " $COOL_HELP_LEFT_ALIGN %s\n" "olapquery" "Perform OLAP query" | ||
printf " $COOL_HELP_LEFT_ALIGN %s\n" "server" "Start query server" | ||
|
||
exit ${1:-0} | ||
} | ||
|
||
main_load() { | ||
java -cp $COOL_CORE_PATH com.nus.cool.functionality.CsvLoader "$@" | ||
} | ||
|
||
main_cohortselection() { | ||
java -cp $COOL_CORE_PATH com.nus.cool.functionality.CohortSelection "$@" | ||
} | ||
|
||
main_cohortquery() { | ||
java -cp $COOL_CORE_PATH com.nus.cool.functionality.CohortAnalysis "$@" | ||
} | ||
|
||
main_funnelquery() { | ||
java -cp $COOL_CORE_PATH com.nus.cool.functionality.FunnelAnalysis "$@" | ||
} | ||
|
||
main_olapquery() { | ||
java -cp $COOL_CORE_PATH com.nus.cool.functionality.IcebergLoader "$@" | ||
} | ||
|
||
main_server() { | ||
java -jar $COOL_QUERY_SERVER_PATH | ||
} | ||
|
||
function main() { | ||
if (($# == 0)); then | ||
main_help 0 | ||
fi | ||
|
||
case ${1} in | ||
help | load | cohortselection | cohortquery | funnelquery | olapquery | server) | ||
"main_$1" "${@:2}" | ||
;; | ||
*) | ||
echo "unknown command: $1" | ||
main_help 1 | ||
exit 1 | ||
;; | ||
esac | ||
} | ||
|
||
main "$@" |