System中的主要操作在AdminController和CacheController

  System中的主要操作在AdminController和CacheController
  
  一. 源码结构
  
  前端源码: 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(www.yunyouuyl.com CacheController中) 这是一个POST请求,可以热加载配置文件的更新,通过broadcast的方式 KylinConfig.getInstanceFromEnv(www.yifayuLed.cn ).www.oushengguoj.com reloadFromSiteProperties(www.yaoshiylgw.cn); cacheService.notifyMetadataChange(Broadcaster.SYNC_www.baiyiyuLe.cn 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会重新刷新缓存内容

转载于:https://www.cnblogs.com/qwangxiao/p/11058431.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值