[ 
https://issues.apache.org/jira/browse/KYLIN-5440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17686396#comment-17686396
 ] 

Yaguang Jia commented on KYLIN-5440:
------------------------------------

Dev Design

Adjust the logic to change the original behavior of truncating directly based 
on page_offset and page_size to handle the number of library tables that match 
the expected number to meet the front-end display requirements.

When a user initiates a request, taking a normal user as an example (here we 
have many pages of tables).

The administrator has permissions to all tables, and some steps are skipped in 
the permission verification step, which is theoretically the fastest.

The two APIs get project_tables and get tables should show 7 tables in the 
first page by default

When a normal user has permission tables in the middle or later part of the 
full volume, the code logic will keep processing until the expected number of 7 
tables are displayed, or the user has only permission tables, for example 3, 
which can be understood as

the fastest processing efficiency when the user's permission table is in the 
front of the full volume table, processing only 7 tables.

And when the user's permission table is behind the full volume table, the 
processing is the least efficient, processing the full volume table to get 7 
tables or only 3 tables.

The default number of get snapshots displayed on the first page should be 20

The API also includes permission checks, which link permissions to tables, and 
when the user does not have permissions on the corresponding table, the 
Snapshot of the corresponding table is not visible.

 


Dev Design

调整逻辑,将原先基于 page_offset 和 page_size 直接截断的行为改为处理符合预期数量的库表数量,以满足前端展示需求。

当用户发起请求时,以普通用户为例(这里我们有很多页的表):


管理员拥有所有表的权限,在权限校验这步会跳过一些步骤,理论上是最快的。

* get project_tables 和 get tables 这两个 API 在第一页展现的表默认应该为 7 张

 


当普通用户拥有权限的表在全量表的中间或者靠后部分时,代码逻辑中会一直处理,直到符合预期展示数量的 7 张表,或者用户仅有的权限表,比如 3 张,可以理解为:
当用户的权限表在全量表靠前时,处理效率最快,仅处理 7 张表;
而当用户的权限表在全量表靠后时,处理效率最低,处理了全量表,才得到了 7 张表或者仅有的 3 张表。
get snapshots 在第一页展现的数量默认应该为 20 个
该 API 也包含权限的校验,其权限和表挂钩,当用户没有对应表的权限时,也看不到对应表的 Snapshot,逻辑和上述两个 API 的优化方案一致。

> API time-consuming optimization
> -------------------------------
>
>                 Key: KYLIN-5440
>                 URL: https://issues.apache.org/jira/browse/KYLIN-5440
>             Project: Kylin
>          Issue Type: Improvement
>    Affects Versions: 5.0-alpha
>            Reporter: Yaguang Jia
>            Assignee: Yaguang Jia
>            Priority: Major
>             Fix For: 5.0-alpha
>
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to