smolnar82 opened a new pull request #371:
URL: https://github.com/apache/knox/pull/371


   ## What changes were proposed in this pull request?
   
   - Let end-users customize the size/TTL attributes of the cache in 
`DefaultKeystoreService` I introduced while working on 
[KNOX-2136](https://issues.apache.org/jira/browse/KNOX-2136)
   - `AliasBasedTokenStateService.updateExpiration` updates the data in-memory 
and let the background thread does its job
   - if `AliasBasedTokenStateService` is selected as token state service, a new 
background thread is run when the service is started which reads previously 
persisted relevant aliases into the in-memory collections (in 
`DefaultTokenStateService`). With this change, it's not needed to override 
`getTokens` in `AliasBasedTokenStateService` which is only used by the reaper 
thread when evicting expired tokens. Instead, the token eviction logic will 
wait until everything is loaded.
   - `DefaultTokenStateService.tokenExpirations` and 
`DefaultTokenStateService.maxTokenLifetimes` became `ConcurrentHashMap`s -> get 
rid of many of the synchronization blocks -> easier to read and maintain the 
code and `CHM` performs better than synchronization + `HashMap`
   
   ## How was this patch tested?
   
   Updated and ran JUnit tests as well as executed the performance test tool 
multiple times to make sure I achieved the performance goals I was looking for 
with these changes.


----------------------------------------------------------------
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]


Reply via email to