TableAuthManager.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:ditb 作者:
/**
 * Updates the internal global permissions cache
 *
 * @param userPerms
 */
private void updateGlobalCache(ListMultimap<String,TablePermission> userPerms) {
  PermissionCache<Permission> newCache = null;
  try {
    newCache = initGlobal(conf);
    for (Map.Entry<String,TablePermission> entry : userPerms.entries()) {
      if (AuthUtil.isGroupPrincipal(entry.getKey())) {
        newCache.putGroup(AuthUtil.getGroupName(entry.getKey()),
            new Permission(entry.getValue().getActions()));
      } else {
        newCache.putUser(entry.getKey(), new Permission(entry.getValue().getActions()));
      }
    }
    globalCache = newCache;
    mtime.incrementAndGet();
  } catch (IOException e) {
    // Never happens
    LOG.error("Error occured while updating the global cache", e);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号