Kylin页面System操作源码解读 原 荐

栏目: 服务器 · 发布时间: 6年前

内容简介:System中的主要操作在AdminController和CacheController前端源码: angular:下面为自定义方法:

System中的主要操作在AdminController和CacheController

一. 源码结构

Kylin页面System操作源码解读 原 荐 Kylin页面System操作源码解读 原 荐

前端源码: angular:下面为自定义方法:

* Method type is PUT
 * Additional Query parameter action=config is sent
 * The expected return type not is an Array
 */ updateConfig: {method: 'PUT', params: {action: 'config'}, isArray: false}
KylinApp.factory('AdminService', ['$resource', function ($resource, config) {
  return $resource(Config.service.url + 'admin/:action', {}, {
    env: {method: 'GET', params: {action: 'env'}, isArray: false},
    config: {method: 'GET', params: {action: 'config'}, isArray: false},
    publicConfig: {method: 'GET', params: {action: 'public_config'}, isArray: false},
    cleanStorage: {method: 'DELETE', params: {action: 'storage'}, isArray: false},
    updateConfig: {method: 'PUT', params: {action: 'config'}, isArray: false}
  });
}]);
params: {action: 'config'}对应AdminController的RequestMapping的映射

二. 探索每个按钮

1. Server Config的刷新按钮

调用的是getConfig(AdminController中的getConfig方法) getConfig操作会从ThreadLocal的KylinConfig中查找有没有此对象,如果有则获取返回,所以当set Config之后,有了KylinConfig对象,所以Server Config的刷新按钮可以获取到修改后的配置属性

2. Server Environment刷新按钮

调用的是getEnv操作(AdminController中的getEnv方法)

3. Set Config按钮

调用updateKylinConfig,会将前端也就是页面上传过来的kv值进行更新,会将数据存储到KylinConfig对象内存中。这是一个put操作,在restful中相当于调用服务器的update方法。

4. Clean Up Storage

调用(AdminController中的cleanupStorage方法) storage对应cleanupStorage,此操作的运行原理官网解释: http://kylin.apache.org/docs/howto/howto_cleanup_storage.html, 也就是会清除kylin cube构建 工作期间生成的hdfs中间文件

5. reloadConfig

调用hotLoadKylinConfig(CacheController中) 这是一个POST请求,可以热加载配置文件的更新,通过broadcast的方式 KylinConfig.getInstanceFromEnv().reloadFromSiteProperties(); cacheService.notifyMetadataChange(Broadcaster.SYNC_ALL, Broadcaster.Event.UPDATE, Broadcaster.SYNC_ALL); reloadFromSiteProperties操作会使用BackwardCompatibilityConfig的check方法,将key,value强制转换为String类型, 类似于格式化

6. Calculate Cardinality

预估某个hive表的基数,点击这个按钮会让用户填写hive表相关信息

7. Disable Cache

是将kylin.query.cache-enabled参数设为false

8. Enable Cache

是将kylin.query.cache-enabled参数设为true

9. Reload metadata

调用CacheController的announceWipeCache方法 会使用Broadcaster清除所有节点缓存

所以,当set config之后,只是将参数设置到了Properties对象中,并不持久化,而当reload时,会读取kylin.properties文件的配置,所以reload会重新刷新缓存内容


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Art of Computer Programming, Volume 2

The Art of Computer Programming, Volume 2

Knuth, Donald E. / Addison-Wesley Professional / 1997-11-04 / USD 79.99

Finally, after a wait of more than thirty-five years, the first part of Volume 4 is at last ready for publication. Check out the boxed set that brings together Volumes 1 - 4A in one elegant case, and ......一起来看看 《The Art of Computer Programming, Volume 2》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具