From 22334efa2ac7e4bd53dc0f039df1f49d22c9c7d1 Mon Sep 17 00:00:00 2001 From: John Zhao Date: Mon, 7 Mar 2016 14:05:59 -0800 Subject: [PATCH] KYLIN-1474 expose list, remove and cat in metastore.sh --- build/bin/metastore.sh | 24 ++++++++++++++++++++++ .../kylin/common/persistence/ResourceTool.java | 3 +++ 2 files changed, 27 insertions(+) diff --git a/build/bin/metastore.sh b/build/bin/metastore.sh index 05041f9..8908351 100755 --- a/build/bin/metastore.sh +++ b/build/bin/metastore.sh @@ -47,6 +47,27 @@ then echo "Starting restoring $_file" ${KYLIN_HOME}/bin/kylin.sh org.apache.kylin.common.persistence.ResourceTool upload $_file +elif [ "$1" == "list" ] +then + + _file=$2 + echo "Starting list $_file" + ${KYLIN_HOME}/bin/kylin.sh org.apache.kylin.common.persistence.ResourceTool list $_file + +elif [ "$1" == "remove" ] +then + + _file=$2 + echo "Starting remove $_file" + ${KYLIN_HOME}/bin/kylin.sh org.apache.kylin.common.persistence.ResourceTool remove $_file + +elif [ "$1" == "cat" ] +then + + _file=$2 + echo "Starting cat $_file" + ${KYLIN_HOME}/bin/kylin.sh org.apache.kylin.common.persistence.ResourceTool cat $_file + elif [ "$1" == "reset" ] then @@ -61,6 +82,9 @@ else echo "usage: metastore.sh backup" echo " metastore.sh reset" echo " metastore.sh restore PATH_TO_LOCAL_META" + echo " metastore.sh list RESOURCE_PATH" + echo " metastore.sh cat RESOURCE_PATH" + echo " metastore.sh remove RESOURCE_PATH" echo " metastore.sh clean [--delete true]" exit 1 fi diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java index 489e45a..2e1d527 100644 --- a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java +++ b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java @@ -41,6 +41,9 @@ public class ResourceTool { System.out.println("Usage: ResourceTool list RESOURCE_PATH"); System.out.println("Usage: ResourceTool download LOCAL_DIR"); System.out.println("Usage: ResourceTool upload LOCAL_DIR"); + System.out.println("Usage: ResourceTool reset"); + System.out.println("Usage: ResourceTool remove RESOURCE_PATH"); + System.out.println("Usage: ResourceTool cat RESOURCE_PATH"); return; } -- 2.5.4 (Apple Git-61)