Repository: kylin Updated Branches: refs/heads/master 0aea876f8 -> a8dd0ec91
KYLIN-1884 Reload metadata automatically after migrating cube Signed-off-by: shaofengshi <shaofeng...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a8dd0ec9 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a8dd0ec9 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a8dd0ec9 Branch: refs/heads/master Commit: a8dd0ec91de8455f2bf2252832b0cf822fc74e44 Parents: 0aea876 Author: kangkaisen <kangkai...@live.com> Authored: Wed Jul 13 17:42:33 2016 +0800 Committer: shaofengshi <shaofeng...@apache.org> Committed: Mon Jul 18 21:36:06 2016 +0800 ---------------------------------------------------------------------- .../kylin/storage/hbase/util/CubeMigrationCLI.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/a8dd0ec9/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CubeMigrationCLI.java ---------------------------------------------------------------------- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CubeMigrationCLI.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CubeMigrationCLI.java index 541c173..2fffa52 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CubeMigrationCLI.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CubeMigrationCLI.java @@ -42,6 +42,8 @@ import org.apache.kylin.common.persistence.JsonSerializer; import org.apache.kylin.common.persistence.RawResource; import org.apache.kylin.common.persistence.ResourceStore; import org.apache.kylin.common.persistence.Serializer; +import org.apache.kylin.common.restclient.Broadcaster; +import org.apache.kylin.common.restclient.RestClient; import org.apache.kylin.common.util.Bytes; import org.apache.kylin.common.util.Dictionary; import org.apache.kylin.cube.CubeInstance; @@ -148,6 +150,7 @@ public class CubeMigrationCLI { if (realExecute.equalsIgnoreCase("true")) { doOpts(); checkMigrationSuccess(dstConfig, cubeName, true); + updateMeta(dstConfig); } else { showOpts(); } @@ -547,4 +550,17 @@ public class CubeMigrationCLI { } } } + + private static void updateMeta(KylinConfig config){ + String[] nodes = config.getRestServers(); + for (String node : nodes) { + RestClient restClient = new RestClient(node); + try { + logger.info("update meta cache for " + node); + restClient.wipeCache(Broadcaster.TYPE.ALL.getType(), Broadcaster.EVENT.UPDATE.getType(), "all"); + } catch (IOException e) { + logger.error(e.getMessage()); + } + } + } }