[
https://issues.apache.org/jira/browse/KNOX-2134?focusedWorklogId=359422&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-359422
]
ASF GitHub Bot logged work on KNOX-2134:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Dec/19 14:25
Start Date: 13/Dec/19 14:25
Worklog Time Spent: 10m
Work Description: smolnar82 commented on pull request #218: KNOX-2134 -
Checking if password is available via local alias service before going to fetch
it from remote ZK server
URL: https://github.com/apache/knox/pull/218
## What changes were proposed in this pull request?
Formatted the code and did a minor cleanup to make it easier to read and
understand the code.
Apart from code cleanup, I changed the way how passwords are fetched in
`ZookeeperRemoteAliasService`: before going to the remote ZK server we first
check if the desired password is available through the local alias service. If
so; we skip the remote check. This came with a separate commit to make it
easier for review (see
[here](https://github.com/apache/knox/commit/66933502ccfd2b64d244c636c6c28fbb22cc8b8e)).
## How was this patch tested?
Added a JUnit test to measure performance (ignoring it from automatic
execution, but can be executed manually by commenting out the `Ignore`
annotation): added and fetched 200 aliases/passwords with and without my
changes in place with the following results
|Without cache (ms) | With Cache (ms) |
|--|--|
|
30841<br>31335<br>32762<br>31646<br>31736<br>31641<br>31204<br>34219<br>33720<br>33297
|
16715<br>16265<br>17469<br>17312<br>17482<br>20990<br>17343<br>19637<br>19240<br>17705
|
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 359422)
Time Spent: 1h 50m (was: 1h 40m)
> Add caching to ZookeeperRemoteAliasService
> ------------------------------------------
>
> Key: KNOX-2134
> URL: https://issues.apache.org/jira/browse/KNOX-2134
> Project: Apache Knox
> Issue Type: Bug
> Components: Server
> Affects Versions: 1.3.0
> Reporter: Philip Zampino
> Assignee: Sandor Molnar
> Priority: Major
> Fix For: 1.4.0
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> The ZookeeperRemoteAliasService implementation always goes to ZooKeeper to
> retrieve alias data. Instead, it should cache the data locally to make
> password retrieval much faster.
> The implementation already receives pushes from ZooKeeper when alias znodes
> change, so instead of only updating the associated local alias service, it
> can also update its own cache.
> This way, it only ever needs to go to ZooKeeper for add/remove operations.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)